From 6fb1d73521c2156e687276e982e778dfa7283111 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:29:12 -0700 Subject: [PATCH 001/110] MOdified pairing input form to apply new method of displaying pairing events. --- .../web/onprc_ehr/form/field/PairingsCombo.js | 251 ++++++++++++++++++ .../model/sources/Pairing_Properties.js | 13 +- 2 files changed, 260 insertions(+), 4 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js new file mode 100644 index 000000000..f51510e75 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2018-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * This creates a combobox suitable to display SNOMED results. It is a 2-part field, where the top combo allows you to + * select the 'snomed subset'. When a subset is picked, the bottom combo loads that subset of codes. This is designed as + * a mechanism to support more managable sets of allowable values for SNOMED entry. It is heavily tied to ehr_lookups.snomed_subsets + * and ehr_lookups.snomed_subset_codes. + * @param {object} config The configuation object. + * @param {string} [config.defaultSubset] The default SNOMED subset to load + * + */ +Ext4.define('ONPRC_EHR.form.field.pairingCombo', { + extend: 'Ext.ux.CheckCombo', + alias: 'widget.onprc_ehr-pairingcombo', + + activeSubset: null, + addAllSelector: true, + + initComponent: function(){ + this.getSnomedStore(); + this.activeSubset = this.defaultSubset; + + Ext4.apply(this, { + trigger2Cls: Ext4.form.field.ComboBox.prototype.triggerCls, + onTrigger2Click: Ext4.form.field.ComboBox.prototype.onTriggerClick, + trigger1Cls: 'x4-form-search-trigger', + xtype: 'labkey-combo', + queryMode: 'local', + name: this.name, + typeAhead: true, + snomedStore: this.snomedStore, + displayField: 'codeAndMeaning', + valueField: 'code', + forceSelection: true, + caseSensitive: false, + anyMatch: true, + store: { + type: 'labkey-store', + schemaName: 'ehr_lookups', + storeId: 'snomedStore_' + this.id, + queryName: 'snomed_combo_list', + columns: 'code,meaning,codeAndMeaning,categories', + sort: 'meaning', + maxRows: 0, + autoLoad: true, + listeners: { + scope: this, + delay: 100, + load: function(s){ + if (this.activeSubset) + this.applyFilter(this.activeSubset); + } + } + } + }); + + this.callParent(arguments); + + this.on('render', function(field){ + Ext4.QuickTips.register({ + target: field.triggerEl.elements[0], + text: 'Click to change the SNOMED subset' + }); + }, this); + }, + + //used to prevent combo/editor from closing when toggling snomed subsets + validateBlur: function(){ + return !this.window; + }, + + onTrigger1Click: function(){ + var cfg = this.getFilterComboCfg(); + cfg.value = this.activeSubset || cfg.value; + + this.window = Ext4.create('Ext.window.Window', { + title: 'Choose Event Type Category', + modal: true, + closeAction: 'destroy', + width: 410, + bodyStyle: 'padding: 5px;', + items: [{ + html: 'Because the entire SNOMED list is long, most SNOMED fields show a subset of the full list. The field below can be used to change which subset is shown, or you can choose all codes. Please note that the SNOMED field should narrow down the list of codes as you begin typing.', + border: false, + style: 'padding-bottom: 10px;' + }, cfg], + buttons: [{ + text: 'Submit', + scope: this, + handler: function(btn){ + var win = btn.up('window'); + var val = win.down('#filterCombo').getValue(); + if (!val){ + Ext4.Msg.alert('Error', 'Must choose a subset'); + return; + } + + win.close(); + this.window = null; + this.applyFilter(val); + } + },{ + text: 'Close', + scope: this, + handler: function(btn){ + var win = btn.up('window'); + win.close(); + this.window = null; + } + }] + + }).show(); + }, + + ensureRecord: function(val){ + if (this.isDestroyed){ + return; + } + + if (!this.store){ + LDK.Assert.assertNotEmpty('this.store is null in SnomedCombo.ensureRecord()', this.store); + } + + var recIdx = this.store.findExact('code', val); + if (recIdx == -1){ + recIdx = this.snomedStore.findExact('code', val); + + if (recIdx != -1){ + if (this.store.isLoading()){ + var me = this; + this.store.on('load', function(){ + me.ensureRecord(val); + }, me, {single: true}); + } + else { + this.store.add(this.snomedStore.getAt(recIdx)); + } + } + else if (this.snomedStore.isLoading()){ + var me = this; + me.snomedStore.on('load', function(){ + me.ensureRecord(val); + //NOTE: if the value becomes NULL, it is likely because a user clicked on the combo prior to SNOMED store loading. + if (!me.getValue()) { + me.setValue(val); + } + }, me, {single: true}); + } + } + }, + + getSnomedStore: function(){ + if (this.snomedStore) + return this.snomedStore; + + this.snomedStore = EHR.DataEntryUtils.getSnomedStore(); + + if (!this.snomedStore.loading){ + if (this.activeSubset) + this.applyFilter(this.activeSubset); + } + + this.mon(this.snomedStore, 'load', function(){ + if (this.activeSubset) + this.applyFilter(this.activeSubset); + }, this); + + return this.snomedStore; + }, + + setValue: function(val){ + if (Ext4.isString(val)) { + this.ensureRecord(val); + } + else if (Ext4.isArray(val) && val.length == 1 && val[0].isModel) { + this.ensureRecord(val[0].get('code')); + } + else if (Ext4.isObject(val) && val.code){ + this.ensureRecord(val.code); + } + + this.callOverridden(arguments); + }, + + getFilterComboCfg: function(){ + return { + xtype: 'combo', + itemId: 'filterCombo', + emptyText: 'Pick subset...', + typeAhead: true, + isFormField: false, + fieldLabel: 'Choose Subset', + labelWidth: 120, + width: 380, + valueField: 'subset', + displayField: 'subset', + queryMode: 'local', + initialValue: this.activeSubset, + value: this.activeSubset, + nullCaption: 'All', + store: { + type: 'labkey-store', + schemaName: 'ehr_lookups', + queryName: 'snomed_subsets', + sort: 'subset', + autoLoad: true, + listeners: { + scope: this, + load: function(s){ + s.add({subset: 'All'}); + } + } + } + }; + }, + + applyFilter: function(subset){ + var code = this.getValue(); + this.activeSubset = subset; + + if (this.snomedStore.loading || this.isDestroyed){ + return; + } + + LDK.Assert.assertNotEmpty('SnomedCombo.applyFilter() called w/ a null store', this.store); + if (!this.store){ + return; + } + + this.store.removeAll(); + + var records = []; + if (!subset || subset == 'All'){ + records = this.snomedStore.getRange(); + } + else { + var re = new RegExp('(,|^)' + subset + '(,|$)'); + this.snomedStore.each(function(r){ + if (r.get('categories') && r.get('categories').match(re)) + records.push(r); + }, this); + } + + this.store.add(records); + if (code) + this.ensureRecord(code); + } +}); diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 86f14a441..c2f6d8d20 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -22,12 +22,17 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, + // eventtype: { + // allowBlank: false, + // lookup: { + // sort: 'sort_order' + // } + // }, eventtype: { - allowBlank: false, - lookup: { - sort: 'sort_order' - } + xtype: 'onprc_ehr-pairingscombo', + defaultSubset: 'Common Treatments' }, + goal: { allowBlank: false, lookup: { From b71e1d968d6b5034d4fbc9a23190883e859e1dd0 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 9 Jun 2025 18:37:13 -0700 Subject: [PATCH 002/110] MOdified pairing input form to apply new method of displaying pairing events. --- .../onprc_ehr/model/sources/Pairing_Properties.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index c2f6d8d20..ad10f8541 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -22,15 +22,13 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - // eventtype: { - // allowBlank: false, - // lookup: { - // sort: 'sort_order' - // } - // }, + eventtype: { - xtype: 'onprc_ehr-pairingscombo', - defaultSubset: 'Common Treatments' + + editorConfig: { + xtype: 'ehr-snomedcombo', + defaultSubset: 'Common Treatments' + } }, goal: { From e16000288105dca317d46a1890cd865f0ee2c978 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 12 Jun 2025 13:26:58 -0700 Subject: [PATCH 003/110] MOdified pairing input form to apply new method of displaying pairing events. --- .../queries/study/Pairings.query.xml | 18 +++++++++++---- .../web/onprc_ehr/form/field/PairingsCombo.js | 22 +++++++++---------- .../model/sources/Pairing_Properties.js | 11 +++++++++- .../onprc_ehr/dataentry/PairingFormType.java | 6 +++++ 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index cff5930aa..dbe27494a 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -23,13 +23,23 @@ Start Date + + + + + + + + + + + false Start Type - onprc_ehr - PairingStartType - value - + ehr_lookups + snomed + code diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index f51510e75..b6c7bc6dd 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019 LabKey Corporation + * Copyright (c) 2013-2019 LabKey Corporation * * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ @@ -12,12 +12,12 @@ * @param {string} [config.defaultSubset] The default SNOMED subset to load * */ -Ext4.define('ONPRC_EHR.form.field.pairingCombo', { - extend: 'Ext.ux.CheckCombo', - alias: 'widget.onprc_ehr-pairingcombo', + + Ext4.define('ONPRC_EHR.form.field.pairingCombo', { + extend: 'EHR.form.field.SnomedCombo', + alias: 'widget.onprc_ehr-pairingcombo', activeSubset: null, - addAllSelector: true, initComponent: function(){ this.getSnomedStore(); @@ -62,7 +62,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { this.on('render', function(field){ Ext4.QuickTips.register({ target: field.triggerEl.elements[0], - text: 'Click to change the SNOMED subset' + text: 'Click to change the pairings event type' }); }, this); }, @@ -77,13 +77,13 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { cfg.value = this.activeSubset || cfg.value; this.window = Ext4.create('Ext.window.Window', { - title: 'Choose Event Type Category', + title: 'Choose the Event Type Category', modal: true, closeAction: 'destroy', width: 410, bodyStyle: 'padding: 5px;', items: [{ - html: 'Because the entire SNOMED list is long, most SNOMED fields show a subset of the full list. The field below can be used to change which subset is shown, or you can choose all codes. Please note that the SNOMED field should narrow down the list of codes as you begin typing.', + html: ' The field below can be used to change which category to be displayed, or you can choose all catgories. Please note that the event type field should narrow down the list of event types as you begin typing.', border: false, style: 'padding-bottom: 10px;' }, cfg], @@ -94,7 +94,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { var win = btn.up('window'); var val = win.down('#filterCombo').getValue(); if (!val){ - Ext4.Msg.alert('Error', 'Must choose a subset'); + Ext4.Msg.alert('Error', 'Must choose a event type category'); return; } @@ -189,10 +189,10 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { return { xtype: 'combo', itemId: 'filterCombo', - emptyText: 'Pick subset...', + emptyText: 'Pick event type category...', typeAhead: true, isFormField: false, - fieldLabel: 'Choose Subset', + fieldLabel: 'Choose a category', labelWidth: 120, width: 380, valueField: 'subset', diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index ad10f8541..373827d64 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -23,14 +23,23 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, + // eventtype: { + // + // editorConfig: { + // xtype: 'ehr-snomedcombo', + // defaultSubset: 'Common Treatments' + // } + // }, + eventtype: { editorConfig: { - xtype: 'ehr-snomedcombo', + xtype: 'onprc_ehr-pairingcombo', defaultSubset: 'Common Treatments' } }, + goal: { allowBlank: false, lookup: { diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index 735ae7b29..330e762e3 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -50,6 +50,12 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) //Added 6-7-2016 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/model/sources/Pairing_Properties.js")); + + //Added 6-9-2025 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairingsCombo.js")); + + + } @Override From df52b4796cb6556d53c183eb61e33ed5e3953610 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:14:39 -0700 Subject: [PATCH 004/110] MOdified pairing observation xtype controls. --- .../resources/web/onprc_ehr/form/field/PairingsCombo.js | 2 ++ .../web/onprc_ehr/model/sources/Pairing_Properties.js | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index b6c7bc6dd..fad6d808b 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -13,6 +13,8 @@ * */ +EHR.DataEntryUtils.getSnomedStore(); + Ext4.define('ONPRC_EHR.form.field.pairingCombo', { extend: 'EHR.form.field.SnomedCombo', alias: 'widget.onprc_ehr-pairingcombo', diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 373827d64..40677ecee 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -23,14 +23,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, - // eventtype: { - // - // editorConfig: { - // xtype: 'ehr-snomedcombo', - // defaultSubset: 'Common Treatments' - // } - // }, - eventtype: { editorConfig: { From da3480bb24574254fb8173c3f1b6249732a92772 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:31:27 -0700 Subject: [PATCH 005/110] MOdified pairing observation xtype controls. --- .../queries/study/Pairings.query.xml | 28 +++++++-------- .../web/onprc_ehr/form/field/PairingsCombo.js | 36 +++++++++---------- .../model/sources/Pairing_Properties.js | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index dbe27494a..ea4c0c1e0 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -23,25 +23,25 @@ Start Date - - - - - - - - - - - false Start Type - ehr_lookups - snomed - code + sla + Reference_Data + value + + + + + + + + + + + Start Remark 300 diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index fad6d808b..c66f42d78 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -16,7 +16,7 @@ EHR.DataEntryUtils.getSnomedStore(); Ext4.define('ONPRC_EHR.form.field.pairingCombo', { - extend: 'EHR.form.field.SnomedCombo', + extend: 'Ext.form.field.ComboBox', alias: 'widget.onprc_ehr-pairingcombo', activeSubset: null, @@ -34,18 +34,18 @@ EHR.DataEntryUtils.getSnomedStore(); name: this.name, typeAhead: true, snomedStore: this.snomedStore, - displayField: 'codeAndMeaning', - valueField: 'code', + displayField: 'value', + valueField: 'value', forceSelection: true, caseSensitive: false, anyMatch: true, store: { type: 'labkey-store', - schemaName: 'ehr_lookups', + schemaName: 'sla', storeId: 'snomedStore_' + this.id, - queryName: 'snomed_combo_list', - columns: 'code,meaning,codeAndMeaning,categories', - sort: 'meaning', + queryName: 'Reference_Data', + columns: 'value,columnnName', + sort: 'value', maxRows: 0, autoLoad: true, listeners: { @@ -126,9 +126,9 @@ EHR.DataEntryUtils.getSnomedStore(); LDK.Assert.assertNotEmpty('this.store is null in SnomedCombo.ensureRecord()', this.store); } - var recIdx = this.store.findExact('code', val); + var recIdx = this.store.findExact('value', val); if (recIdx == -1){ - recIdx = this.snomedStore.findExact('code', val); + recIdx = this.snomedStore.findExact('value', val); if (recIdx != -1){ if (this.store.isLoading()){ @@ -178,10 +178,10 @@ EHR.DataEntryUtils.getSnomedStore(); this.ensureRecord(val); } else if (Ext4.isArray(val) && val.length == 1 && val[0].isModel) { - this.ensureRecord(val[0].get('code')); + this.ensureRecord(val[0].get('value')); } - else if (Ext4.isObject(val) && val.code){ - this.ensureRecord(val.code); + else if (Ext4.isObject(val) && val.value){ + this.ensureRecord(val.value); } this.callOverridden(arguments); @@ -197,8 +197,8 @@ EHR.DataEntryUtils.getSnomedStore(); fieldLabel: 'Choose a category', labelWidth: 120, width: 380, - valueField: 'subset', - displayField: 'subset', + valueField: 'value', + displayField: 'value', queryMode: 'local', initialValue: this.activeSubset, value: this.activeSubset, @@ -206,8 +206,8 @@ EHR.DataEntryUtils.getSnomedStore(); store: { type: 'labkey-store', schemaName: 'ehr_lookups', - queryName: 'snomed_subsets', - sort: 'subset', + queryName: 'pairing_Subsets', + sort: 'value', autoLoad: true, listeners: { scope: this, @@ -241,13 +241,13 @@ EHR.DataEntryUtils.getSnomedStore(); else { var re = new RegExp('(,|^)' + subset + '(,|$)'); this.snomedStore.each(function(r){ - if (r.get('categories') && r.get('categories').match(re)) + if (r.get('columnName') && r.get('columnName').match(re)) records.push(r); }, this); } this.store.add(records); if (code) - this.ensureRecord(code); + this.ensureRecord(value); } }); diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 40677ecee..2226fffda 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -27,7 +27,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'Common Treatments' + defaultSubset: 'PairingStartType' } }, From 5bdb39ee728865d7a3fee9e064e94b3699e94994 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 16 Jun 2025 23:44:32 -0700 Subject: [PATCH 006/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index c66f42d78..5e106ced9 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -220,7 +220,7 @@ EHR.DataEntryUtils.getSnomedStore(); }, applyFilter: function(subset){ - var code = this.getValue(); + var value = this.getValue(); this.activeSubset = subset; if (this.snomedStore.loading || this.isDestroyed){ From efb787925e182396003d9b81531b1d0ba4abc7f6 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 17 Jun 2025 00:01:58 -0700 Subject: [PATCH 007/110] MOdified pairing observation xtype controls. --- .../queries/study/Pairings.query.xml | 10 -------- onprc_ehr/resources/web/onprc_ehr/Utils.js | 24 +++++++++++++++++++ .../web/onprc_ehr/form/field/PairingsCombo.js | 11 +++++---- .../model/sources/Pairing_Properties.js | 2 +- 4 files changed, 31 insertions(+), 16 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index ea4c0c1e0..6eb3f58b5 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -32,16 +32,6 @@ - - - - - - - - - - Start Remark 300 diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index c708e0d58..c4158cbb6 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -23,6 +23,30 @@ ONPRC.Utils = new function(){ success: LABKEY.Utils.getCallbackWrapper(LABKEY.Utils.getOnSuccess(config), config.scope) }); }, + getSnomedStore: function(){ + if (ONPRC_EHR._snomedStore) + return ONPRC_EHR._snomedStore; + + var storeId = ['sla', 'Reference_Data', 'value', 'columnName'].join('||'); + + ONPRC_EHR._snomedStore = Ext4.StoreMgr.get(storeId) || Ext4.create('LABKEY.ext4.data.Store', { + type: 'labkey-store', + schemaName: 'sla', + queryName: 'Reference_Data', + columns: 'value, columnName', + sort: 'value', + storeId: storeId, + autoLoad: true, + getRecordForCode: function(value){ + var recIdx = this.findExact('value', value); + if (recIdx != -1){ + return this.getAt(recIdx); + } + } + }); + + return ONPRC_EHR._snomedStore; + }, preloadSession: function() { LABKEY.Ajax.request({ diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 5e106ced9..f4f84ec45 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -13,9 +13,10 @@ * */ -EHR.DataEntryUtils.getSnomedStore(); - Ext4.define('ONPRC_EHR.form.field.pairingCombo', { +ONPRC.Utils.getSnomedStore(); + +Ext4.define('ONPRC_EHR.form.field.pairingCombo', { extend: 'Ext.form.field.ComboBox', alias: 'widget.onprc_ehr-pairingcombo', @@ -123,7 +124,7 @@ EHR.DataEntryUtils.getSnomedStore(); } if (!this.store){ - LDK.Assert.assertNotEmpty('this.store is null in SnomedCombo.ensureRecord()', this.store); + LDK.Assert.assertNotEmpty('this.store is null in pairingCombo.ensureRecord()', this.store); } var recIdx = this.store.findExact('value', val); @@ -158,7 +159,7 @@ EHR.DataEntryUtils.getSnomedStore(); if (this.snomedStore) return this.snomedStore; - this.snomedStore = EHR.DataEntryUtils.getSnomedStore(); + this.snomedStore = ONPRC.Utils.getSnomedStore(); if (!this.snomedStore.loading){ if (this.activeSubset) @@ -227,7 +228,7 @@ EHR.DataEntryUtils.getSnomedStore(); return; } - LDK.Assert.assertNotEmpty('SnomedCombo.applyFilter() called w/ a null store', this.store); + LDK.Assert.assertNotEmpty('pairingCombo.applyFilter() called w/ a null store', this.store); if (!this.store){ return; } diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 2226fffda..31ceb878f 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -27,7 +27,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingStartType' + defaultSubset: 'PairingStarttype' } }, From 8e1ddc0ce3a2303b117c2d005a72fa30c77ae6db Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 17 Jun 2025 00:45:59 -0700 Subject: [PATCH 008/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/web/onprc_ehr/Utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index c4158cbb6..30b5ac8db 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -23,13 +23,13 @@ ONPRC.Utils = new function(){ success: LABKEY.Utils.getCallbackWrapper(LABKEY.Utils.getOnSuccess(config), config.scope) }); }, - getSnomedStore: function(){ - if (ONPRC_EHR._snomedStore) - return ONPRC_EHR._snomedStore; + getpairingStore: function(){ + if (ONPRC_EHR._pairingStore) + return ONPRC_EHR._pairingStore; var storeId = ['sla', 'Reference_Data', 'value', 'columnName'].join('||'); - ONPRC_EHR._snomedStore = Ext4.StoreMgr.get(storeId) || Ext4.create('LABKEY.ext4.data.Store', { + ONPRC_EHR._pairingStore = Ext4.StoreMgr.get(storeId) || Ext4.create('LABKEY.ext4.data.Store', { type: 'labkey-store', schemaName: 'sla', queryName: 'Reference_Data', @@ -45,7 +45,7 @@ ONPRC.Utils = new function(){ } }); - return ONPRC_EHR._snomedStore; + return ONPRC_EHR._pairingStore; }, preloadSession: function() { From 37e1011ac873b1245327c758953a84c2348673e0 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 17 Jun 2025 00:47:03 -0700 Subject: [PATCH 009/110] MOdified pairing observation xtype controls. --- .../web/onprc_ehr/form/field/PairingsCombo.js | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index f4f84ec45..3f3186a1c 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -14,7 +14,7 @@ */ -ONPRC.Utils.getSnomedStore(); +ONPRC.Utils.getpairingStore(); Ext4.define('ONPRC_EHR.form.field.pairingCombo', { extend: 'Ext.form.field.ComboBox', @@ -23,7 +23,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { activeSubset: null, initComponent: function(){ - this.getSnomedStore(); + this.getpairingStore(); this.activeSubset = this.defaultSubset; Ext4.apply(this, { @@ -34,7 +34,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { queryMode: 'local', name: this.name, typeAhead: true, - snomedStore: this.snomedStore, + pairingStore: this.pairingStore, displayField: 'value', valueField: 'value', forceSelection: true, @@ -43,7 +43,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { store: { type: 'labkey-store', schemaName: 'sla', - storeId: 'snomedStore_' + this.id, + storeId: 'pairingStore_' + this.id, queryName: 'Reference_Data', columns: 'value,columnnName', sort: 'value', @@ -129,7 +129,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { var recIdx = this.store.findExact('value', val); if (recIdx == -1){ - recIdx = this.snomedStore.findExact('value', val); + recIdx = this.pairingStore.findExact('value', val); if (recIdx != -1){ if (this.store.isLoading()){ @@ -139,12 +139,12 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { }, me, {single: true}); } else { - this.store.add(this.snomedStore.getAt(recIdx)); + this.store.add(this.pairingStore.getAt(recIdx)); } } - else if (this.snomedStore.isLoading()){ + else if (this.pairingStore.isLoading()){ var me = this; - me.snomedStore.on('load', function(){ + me.pairingStore.on('load', function(){ me.ensureRecord(val); //NOTE: if the value becomes NULL, it is likely because a user clicked on the combo prior to SNOMED store loading. if (!me.getValue()) { @@ -155,23 +155,23 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { } }, - getSnomedStore: function(){ - if (this.snomedStore) - return this.snomedStore; + getpairingStore: function(){ + if (this.pairingStore) + return this.pairingStore; - this.snomedStore = ONPRC.Utils.getSnomedStore(); + this.pairingStore = ONPRC.Utils.getpairingStore(); - if (!this.snomedStore.loading){ + if (!this.pairingStore.loading){ if (this.activeSubset) this.applyFilter(this.activeSubset); } - this.mon(this.snomedStore, 'load', function(){ + this.mon(this.pairingStore, 'load', function(){ if (this.activeSubset) this.applyFilter(this.activeSubset); }, this); - return this.snomedStore; + return this.pairingStore; }, setValue: function(val){ @@ -208,6 +208,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { type: 'labkey-store', schemaName: 'ehr_lookups', queryName: 'pairing_Subsets', + columns: 'value,columnnName,title', sort: 'value', autoLoad: true, listeners: { @@ -224,7 +225,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { var value = this.getValue(); this.activeSubset = subset; - if (this.snomedStore.loading || this.isDestroyed){ + if (this.pairingStore.loading || this.isDestroyed){ return; } @@ -237,18 +238,18 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { var records = []; if (!subset || subset == 'All'){ - records = this.snomedStore.getRange(); + records = this.pairingStore.getRange(); } else { var re = new RegExp('(,|^)' + subset + '(,|$)'); - this.snomedStore.each(function(r){ + this.pairingStore.each(function(r){ if (r.get('columnName') && r.get('columnName').match(re)) records.push(r); }, this); } this.store.add(records); - if (code) + if (value) this.ensureRecord(value); } }); From 2583ae896d700e8db9af017223122411190fd8e8 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 17 Jun 2025 19:15:37 -0700 Subject: [PATCH 010/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 1 + .../resources/web/onprc_ehr/form/field/PairingsCombo.js | 4 ++-- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 6eb3f58b5..b59d6c2c1 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -25,6 +25,7 @@ Start Type + 200 sla Reference_Data diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 3f3186a1c..592136a57 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -146,7 +146,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { var me = this; me.pairingStore.on('load', function(){ me.ensureRecord(val); - //NOTE: if the value becomes NULL, it is likely because a user clicked on the combo prior to SNOMED store loading. + //NOTE: if the value becomes NULL, it is likely because a user clicked on the combo prior to pairing store loading. if (!me.getValue()) { me.setValue(val); } @@ -199,7 +199,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { labelWidth: 120, width: 380, valueField: 'value', - displayField: 'value', + displayField: 'title', queryMode: 'local', initialValue: this.activeSubset, value: this.activeSubset, diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 31ceb878f..03ef1ec51 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -27,7 +27,10 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingStarttype' + defaultSubset: 'PairingStarttype', + columnConfig: { + width: 300 + } } }, @@ -44,6 +47,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { endeventType: { lookup: { sort: 'sort_order' + }, + columnConfig: { + width: 200 } }, From 235e16a4a64e90641ccdb9a68b526bc752a3bf1e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 17 Jun 2025 19:36:58 -0700 Subject: [PATCH 011/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 592136a57..29c26854e 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -70,7 +70,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { }, this); }, - //used to prevent combo/editor from closing when toggling snomed subsets + //used to prevent combo/editor from closing when toggling pairing subsets validateBlur: function(){ return !this.window; }, From 8058b88df7b66dd97163cd61ce731d7ce67d0c2b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:05:32 -0700 Subject: [PATCH 012/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/web/onprc_ehr/Utils.js | 1 + onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js | 1 + 2 files changed, 2 insertions(+) diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index 30b5ac8db..129d7289e 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -34,6 +34,7 @@ ONPRC.Utils = new function(){ schemaName: 'sla', queryName: 'Reference_Data', columns: 'value, columnName', + filterArray: [LABKEY.Filter.create('enddate', null, LABKEY.Filter.Types.ISBLANK)], sort: 'value', storeId: storeId, autoLoad: true, diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 29c26854e..1b985afc7 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -46,6 +46,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { storeId: 'pairingStore_' + this.id, queryName: 'Reference_Data', columns: 'value,columnnName', + filterArray: [LABKEY.Filter.create('enddate', null, LABKEY.Filter.Types.ISBLANK)], sort: 'value', maxRows: 0, autoLoad: true, From 3e561af1d124357b646ab195b7c79e70db5713f8 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 18 Jun 2025 19:10:16 -0700 Subject: [PATCH 013/110] MOdified pairing observation xtype controls. --- .../queries/study/Pairings.query.xml | 25 ++++++++++++++++++- .../model/sources/Pairing_Properties.js | 12 ++++----- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index b59d6c2c1..616b19229 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -10,6 +10,10 @@ + + false + Infant ID + Pair Id This is used to identify the lowest cage number of the pair. It is used to determine which animals in the group are considered part of the pair. @@ -27,12 +31,27 @@ Start Type 200 + /ONPRC/EHR sla Reference_Data value + + + + + + + + + + + false + Prior Group Housing + + Start Remark 300 @@ -84,7 +103,10 @@ value - + + false + Other Infant + End Remark 300 @@ -110,6 +132,7 @@ true + diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 03ef1ec51..ddd880ded 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -24,7 +24,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { eventtype: { - editorConfig: { xtype: 'onprc_ehr-pairingcombo', defaultSubset: 'PairingStarttype', @@ -45,11 +44,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, endeventType: { - lookup: { - sort: 'sort_order' - }, - columnConfig: { - width: 200 + editorConfig: { + xtype: 'onprc_ehr-pairingcombo', + defaultSubset: 'PairingEndtype', + columnConfig: { + width: 300 + } } }, From e650933284590ad76e442e0e6749c3d295cb61ff Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 19 Jun 2025 14:22:30 -0700 Subject: [PATCH 014/110] MOdified pairing observation xtype controls. --- .../resources/queries/study/Pairings.query.xml | 15 +++++++++++++-- .../web/onprc_ehr/form/field/PairingsCombo.js | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 616b19229..3fe9e5f1e 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -77,12 +77,23 @@ End Date + + + + + + + + End Type + 200 - onprc_ehr - PairingEndType + /ONPRC/EHR + sla + Reference_Data value + diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 1b985afc7..e07e097f0 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -45,7 +45,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { schemaName: 'sla', storeId: 'pairingStore_' + this.id, queryName: 'Reference_Data', - columns: 'value,columnnName', + columns: 'value,columnName', filterArray: [LABKEY.Filter.create('enddate', null, LABKEY.Filter.Types.ISBLANK)], sort: 'value', maxRows: 0, @@ -209,7 +209,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { type: 'labkey-store', schemaName: 'ehr_lookups', queryName: 'pairing_Subsets', - columns: 'value,columnnName,title', + columns: 'value,columnName,title', sort: 'value', autoLoad: true, listeners: { From 2ec07319048974e230ddc5f3d487291181f7bd59 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 20 Jun 2025 00:43:20 -0700 Subject: [PATCH 015/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.js | 10 ++++ .../queries/study/Pairings.query.xml | 49 +++++-------------- .../web/onprc_ehr/form/field/PairingsCombo.js | 3 +- .../model/sources/Pairing_Properties.js | 4 +- 4 files changed, 27 insertions(+), 39 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.js b/onprc_ehr/resources/queries/study/Pairings.js index 20a136677..1f1f2e632 100644 --- a/onprc_ehr/resources/queries/study/Pairings.js +++ b/onprc_ehr/resources/queries/study/Pairings.js @@ -10,5 +10,15 @@ function onInit(event, helper){ helper.setScriptOptions({ errorSeverityForImproperHousing: 'INFO' }); + + + EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.AFTER_INSERT, 'study', 'pairings', function(helper, scriptErrors, row, oldRow) { + //if this category enforces only a single active flag at once, enforce it + //note: if this flag has a future date, preemptively set enddate on flags, since isActive should handle this + if (row.Id && row.flag && !row.enddate && row.date){ + helper.getJavaHelper().ensureSingleFlagCategoryActive(row.Id, row.flag, row.objectId, row.date); + } + }); + } diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 3fe9e5f1e..9c4cc8357 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -27,29 +27,24 @@ Start Date + Start Type - 200 - /ONPRC/EHR - sla - Reference_Data + onprc_ehr + PairingStartType value - - - - - - - - - - + false Prior Group Housing + + ehr_lookups + housingTypes + value + @@ -77,26 +72,16 @@ End Date - - - - - - - - End Type - 200 - /ONPRC/EHR - sla - Reference_Data + onprc_ehr + PairingEndType value - + Separation Reason @@ -123,15 +108,7 @@ 300 - - true - Housing Type - - ehr_lookups - pairingHousingType - value - - + Pair ID true diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index e07e097f0..396c4e9f9 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -14,7 +14,6 @@ */ -ONPRC.Utils.getpairingStore(); Ext4.define('ONPRC_EHR.form.field.pairingCombo', { extend: 'Ext.form.field.ComboBox', @@ -209,7 +208,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { type: 'labkey-store', schemaName: 'ehr_lookups', queryName: 'pairing_Subsets', - columns: 'value,columnName,title', + columns: 'value,title', sort: 'value', autoLoad: true, listeners: { diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index ddd880ded..89e1ef247 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -48,9 +48,11 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { xtype: 'onprc_ehr-pairingcombo', defaultSubset: 'PairingEndtype', columnConfig: { - width: 300 + width: 500 } + } + }, enddate: { From 948bb87b2be1b185afb50e766c748ed0a55df2c5 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:35:28 -0700 Subject: [PATCH 016/110] MOdified pairing observation xtype controls. --- .../model/sources/Pairing_Properties.js | 48 ++++++++++++------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 89e1ef247..949927ce9 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -15,6 +15,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { outcome: { allowBlank: false, + columnConfig: { + width: 160 + }, lookup: { filterArray: [ LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) @@ -26,16 +29,20 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { eventtype: { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingStarttype', - columnConfig: { - width: 300 - } + defaultSubset: 'PairingStarttype' + }, + columnConfig: { + width: 150 } }, goal: { allowBlank: false, + header: 'Divider Goal', + columnConfig: { + width: 170 + }, lookup: { filterArray: [ LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) @@ -46,13 +53,11 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { endeventType: { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingEndtype', - columnConfig: { - width: 500 - } - + defaultSubset: 'PairingEndtype' + }, + columnConfig: { + width: 150 } - }, enddate: { @@ -61,7 +66,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { separationreason: { allowBlank: true, - + columnConfig: { + width: 160 + }, lookup: { filterArray: [ LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) @@ -72,7 +79,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { observation: { allowBlank: true, columnConfig: { - width: 200 + width: 170 }, lookup: { filterArray: [ @@ -81,20 +88,25 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - remark2: { xtype: 'textareafield', - width: 400, - + columnConfig: { + width: 150 + } }, room: { allowBlank: false, + columnConfig: { + width: 130 + } }, remark: { - width: 400 - }, + columnConfig: { + width: 100 + } + } - } + } } }); \ No newline at end of file From 30814879b1cfec882fef7a255c881c917b57012d Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 23 Jun 2025 18:23:57 -0700 Subject: [PATCH 017/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 11 ++++++----- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 7 ++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 9c4cc8357..3bb04c13d 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -40,11 +40,11 @@ false Prior Group Housing - - ehr_lookups - housingTypes - value - + + ehr_lookups + pairingpriorgroups + value + @@ -103,6 +103,7 @@ false Other Infant + End Remark 300 diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 949927ce9..086169f83 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -86,7 +86,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) ] } - }, remark2: { xtype: 'textareafield', @@ -100,6 +99,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 130 } }, + prior_group_housing: { + allowBlank: false, + columnConfig: { + width: 100 + } + }, remark: { columnConfig: { width: 100 From edbe9417fc7a5888e96490e4dd7c7a707ddbfb4c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:07:53 -0700 Subject: [PATCH 018/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.js | 28 ++++++++++++++----- .../queries/study/Pairings.query.xml | 2 -- .../query/ONPRC_EHRTriggerHelper.java | 26 +++++++++++++++++ 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.js b/onprc_ehr/resources/queries/study/Pairings.js index 1f1f2e632..590c0f6b7 100644 --- a/onprc_ehr/resources/queries/study/Pairings.js +++ b/onprc_ehr/resources/queries/study/Pairings.js @@ -12,13 +12,27 @@ function onInit(event, helper){ }); - EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.AFTER_INSERT, 'study', 'pairings', function(helper, scriptErrors, row, oldRow) { - //if this category enforces only a single active flag at once, enforce it - //note: if this flag has a future date, preemptively set enddate on flags, since isActive should handle this - if (row.Id && row.flag && !row.enddate && row.date){ - helper.getJavaHelper().ensureSingleFlagCategoryActive(row.Id, row.flag, row.objectId, row.date); - } - }); + function onComplete(event, errors, triggerHelper){ + if (!triggerHelper.isETL() && !triggerHelper.isValidateOnly()){ + var studyRows = triggerHelper.getRows(); + var idsToClose = []; + if (studyRows){ + for (var i=0;i - Separation Reason @@ -121,7 +120,6 @@ true - 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 438167387..55a547f90 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 @@ -2626,7 +2626,33 @@ public void exec(ResultSet object) throws SQLException demographics.getUpdateService().updateRows(_user, _container, toUpdate, oldKeys, null, getExtraContext()); } } + public void closeActivePairingsRecords(List> records) throws Exception + { + TableInfo housing = getTableInfo("study", "pairings"); + List> toUpdate = new ArrayList<>(); + List> oldKeys = new ArrayList<>(); + + //sort on date + records = new ArrayList<>(records); + records.sort(new Comparator>() + { + @Override + public int compare(Map o1, Map o2) + { + try + { + Date date = dateTimeFormat.parse(o1.get("date").toString()); + Date date2 = dateTimeFormat.parse(o2.get("date").toString()); + return date == null ? -1 : date.compareTo(date2); + } + catch (ParseException e) + { + return 0; + } + } + }); + } public void recalculateAllVetAssignmentRecords() { EHRDemographicsService.get().recalculateForAllIdsInCache(_container, "onprc_ehr", "vet_assignment", true); From c539e9c11fae37b575a46cdcc266472e446cd4ee Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 25 Jun 2025 12:12:30 -0700 Subject: [PATCH 019/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.js | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.js b/onprc_ehr/resources/queries/study/Pairings.js index 590c0f6b7..3298ec58c 100644 --- a/onprc_ehr/resources/queries/study/Pairings.js +++ b/onprc_ehr/resources/queries/study/Pairings.js @@ -6,33 +6,31 @@ require("ehr/triggers").initScript(this); -function onInit(event, helper){ +function onInit(event, helper) { helper.setScriptOptions({ errorSeverityForImproperHousing: 'INFO' }); - - function onComplete(event, errors, triggerHelper){ - if (!triggerHelper.isETL() && !triggerHelper.isValidateOnly()){ - var studyRows = triggerHelper.getRows(); - var idsToClose = []; - if (studyRows){ - for (var i=0;i Date: Thu, 26 Jun 2025 01:00:36 -0700 Subject: [PATCH 020/110] MOdified pairing observation xtype controls. --- .../queries/study/Pairings.query.xml | 18 ++-- .../onprc_ehr/form/field/InfantEntryField.js | 82 +++++++++++++++++++ .../model/sources/Pairing_Properties.js | 37 +++++++-- 3 files changed, 125 insertions(+), 12 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 7786552e0..fa42871e7 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -24,6 +24,14 @@ Cage + + false + Other ID + + + false + Other Infant + Start Date @@ -98,22 +106,20 @@ value - - false - Other Infant - - + + Duration + End Remark 300 - Pair ID true This field is used to differentiate pairs. By convention is should usually be the lowest cage number in the group; however, it does not need to match this + Performed By diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js new file mode 100644 index 000000000..c6b9bc577 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * @cfg idFieldIndex The name of the field holding the Animal ID + */ +Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { + extend: 'LABKEY.ext4.ComboBox', + alias: 'widget.onprc_ehr-infantentryfield', + + // caseSensitive: false, + // anyMatch: true, + // displayField: 'InfantCageMate', + // forceSelection: true, + // + // idFieldIndex: 'Id', + // cageFieldIndex: null, + + trigger1Cls: 'x4-form-search-trigger', + + initComponent: function(){ + this.callParent(arguments); + }, + + onTrigger1Click: function(){ + var rec = EHR.DataEntryUtils.getBoundRecord(this); + if (!rec){ + Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); + return; + } + // var id = rec.get(this.idFieldIndex); + + if (!rec || !rec.get('Id')){ + Ext4.Msg.alert('Error', 'No Id Entered'); + return; + } + + Ext4.Msg.wait('Loading...'); + // this.showTextArea(); + + this.queryValue(rec, function(ret){ + Ext4.Msg.hide(); + + if (ret && ret.InfantCageMate){ + this.setValue(ret.InfantCageMate); + // this.linkEl.update('Refresh Hx'); + } + }, true); + }, + + queryValue: function(rec, cb, alwaysUseCallback){ + var date = rec.get('date') || new Date(); + var id = rec.get('Id'); + // this.pendingIdRequest = id; + LABKEY.Query.selectRows({ + schemaName: 'study', + queryName: 'CageMateInfant', + columns: 'Id,InfantCageMate', + filterArray: [ + LABKEY.Filter.create('Id', rec.get('Id'), LABKEY.Filter.Types.EQUAL) + ], + failure: LDK.Utils.getErrorCallback(), + scope: this, + success: function(results){ + if (!alwaysUseCallback && id != this.pendingIdRequest){ + console.log('more recent request, aborting'); + return; + } + + if (results && results.rows && results.rows.length){ + cb.call(this, results.rows[0], results.rows[0].Id); + } + else { + cb.call(this, null, id); + } + } + }); + } + +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 086169f83..78403db6b 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -32,7 +32,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { defaultSubset: 'PairingStarttype' }, columnConfig: { - width: 150 + width: 200 } }, @@ -56,7 +56,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { defaultSubset: 'PairingEndtype' }, columnConfig: { - width: 150 + width: 200 } }, @@ -87,12 +87,19 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { ] } }, - remark2: { + other_IDs: { xtype: 'textareafield', + header:'Other ID', columnConfig: { - width: 150 + width: 200 } }, + remark2: { + xtype: 'textareafield', + columnConfig: { + width: 200 + } + }, room: { allowBlank: false, columnConfig: { @@ -100,15 +107,33 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, prior_group_housing: { - allowBlank: false, + allowBlank: true, columnConfig: { width: 100 } }, - remark: { + duration: { + allowBlank:true, columnConfig: { width: 100 } + }, + other_infant: { + xtype: 'onprc_ehr-infantentryfield', + // editorConfig: { + // idFieldIndex: 'Id', + // cageFieldIndex: 'other_infant' + // }, + columnConfig: { + width: 160, + showLink: false + } + }, + remark: { + xtype: 'textareafield', + columnConfig: { + width: 200 + } } } From 43ea50c54c7086f2f5e7653be5da01fcfa94d8d7 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 26 Jun 2025 01:08:17 -0700 Subject: [PATCH 021/110] MOdified pairing observation xtype controls. --- .../onprc_ehr/form/field/InfantEntryField.js | 20 +++++-------------- .../model/sources/Pairing_Properties.js | 5 +---- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js index c6b9bc577..44c3def47 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js @@ -3,20 +3,11 @@ * * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ -/** - * @cfg idFieldIndex The name of the field holding the Animal ID - */ + Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { extend: 'LABKEY.ext4.ComboBox', alias: 'widget.onprc_ehr-infantentryfield', - // caseSensitive: false, - // anyMatch: true, - // displayField: 'InfantCageMate', - // forceSelection: true, - // - // idFieldIndex: 'Id', - // cageFieldIndex: null, trigger1Cls: 'x4-form-search-trigger', @@ -30,7 +21,7 @@ Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); return; } - // var id = rec.get(this.idFieldIndex); + if (!rec || !rec.get('Id')){ Ext4.Msg.alert('Error', 'No Id Entered'); @@ -38,22 +29,21 @@ Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { } Ext4.Msg.wait('Loading...'); - // this.showTextArea(); + this.queryValue(rec, function(ret){ Ext4.Msg.hide(); if (ret && ret.InfantCageMate){ this.setValue(ret.InfantCageMate); - // this.linkEl.update('Refresh Hx'); - } + } }, true); }, queryValue: function(rec, cb, alwaysUseCallback){ var date = rec.get('date') || new Date(); var id = rec.get('Id'); - // this.pendingIdRequest = id; + LABKEY.Query.selectRows({ schemaName: 'study', queryName: 'CageMateInfant', diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 78403db6b..ba0d1a32c 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -120,10 +120,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_infant: { xtype: 'onprc_ehr-infantentryfield', - // editorConfig: { - // idFieldIndex: 'Id', - // cageFieldIndex: 'other_infant' - // }, + columnConfig: { width: 160, showLink: false From 41e5bfc7d4fd576ae732e8e7c186ef5862f9746c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:53:22 -0700 Subject: [PATCH 022/110] MOdified pairing observation xtype controls. --- .../form/field/DurationEntryField.js | 31 +++++++++++++++++++ .../model/sources/Pairing_Properties.js | 5 ++- .../onprc_ehr/dataentry/PairingFormType.java | 11 +++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/DurationEntryField.js diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/DurationEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/DurationEntryField.js new file mode 100644 index 000000000..c646a7ee4 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/DurationEntryField.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +Ext4.define('ONPRC_EHR.form.field.DurationEntryField', { + extend: 'Ext.form.field.Trigger', + alias: 'widget.onprc_ehr-durationentryfield', + + triggerCls: 'x4-form-search-trigger', + triggerToolTip: 'Click to set this to match the current cage', + + initComponent: function(){ + this.callParent(arguments); + }, + + onTriggerClick: function(e){ + var rec = EHR.DataEntryUtils.getBoundRecord(this); + var interval = ''; + if (rec){ + var d2 = Ext4.Date.clearTime(new Date(), true); + var d1 = Ext4.Date.clearTime(rec.get('date'), true); + interval = Ext4.Date.getElapsed(d1, d2); + interval = interval / (1000 * 60 * 60 * 24); + interval = Math.floor(interval); + + if (interval) + this.setValue(interval); + } + } +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index ba0d1a32c..d43c33325 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -113,6 +113,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, duration: { + xtype: 'onprc_ehr-durationentryfield', allowBlank:true, columnConfig: { width: 100 @@ -120,10 +121,8 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_infant: { xtype: 'onprc_ehr-infantentryfield', - columnConfig: { - width: 160, - showLink: false + width: 160 } }, remark: { diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index 330e762e3..d402bb42d 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -54,6 +54,17 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) //Added 6-9-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairingsCombo.js")); + //Added 6-25-2025 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/InfantEntryField.js")); + + + //Added 6-25-2025 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/DurationEntryField.js")); + + + + + } From 44093d4713909be9eef9d325c5770352c13302d2 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 27 Jun 2025 13:40:54 -0700 Subject: [PATCH 023/110] MOdified pairing observation xtype controls. --- onprc_ehr/resources/queries/study/Pairings.js | 2 + .../query/ONPRC_EHRTriggerHelper.java | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/onprc_ehr/resources/queries/study/Pairings.js b/onprc_ehr/resources/queries/study/Pairings.js index 3298ec58c..b780181c6 100644 --- a/onprc_ehr/resources/queries/study/Pairings.js +++ b/onprc_ehr/resources/queries/study/Pairings.js @@ -6,6 +6,8 @@ require("ehr/triggers").initScript(this); +var ONPRC_triggerHelper = new org.labkey.onprc_ehr.query.ONPRC_EHRTriggerHelper(LABKEY.Security.currentUser.id, LABKEY.Security.currentContainer.id); + function onInit(event, helper) { helper.setScriptOptions({ errorSeverityForImproperHousing: 'INFO' 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 55a547f90..36b7e33d9 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 @@ -2626,12 +2626,14 @@ public void exec(ResultSet object) throws SQLException demographics.getUpdateService().updateRows(_user, _container, toUpdate, oldKeys, null, getExtraContext()); } } + public void closeActivePairingsRecords(List> records) throws Exception { TableInfo housing = getTableInfo("study", "pairings"); List> toUpdate = new ArrayList<>(); List> oldKeys = new ArrayList<>(); + //sort on date records = new ArrayList<>(records); records.sort(new Comparator>() @@ -2652,7 +2654,56 @@ public int compare(Map o1, Map o2) } } }); + + Set encounteredLsids = new HashSet<>(); + for (Map row : records) + { + Date date = dateTimeFormat.parse(row.get("date").toString()); + if (date.getHours() == 0 && date.getMinutes() == 0) + { + Exception e = new Exception(); + _log.error("Attempting to terminate study details records with a rounded date. This might indicate upstream code is rounding the date: " + dateTimeFormat.format(date), e); + } + + SimpleFilter filter = new SimpleFilter(FieldKey.fromString("Id"), row.get("Id")); + filter.addCondition(FieldKey.fromString("enddate"), null, CompareType.ISBLANK); + + //we want to only close those records starting prior to this record + filter.addCondition(FieldKey.fromString("date"), date, CompareType.LTE); + filter.addCondition(FieldKey.fromString("objectid"), row.get("objectid"), CompareType.NEQ_OR_NULL); + if (!encounteredLsids.isEmpty()) + { + filter.addCondition(FieldKey.fromString("lsid"), encounteredLsids, CompareType.NOT_IN); + } + + TableSelector ts = new TableSelector(housing, Collections.singleton("lsid"), filter, null); + List ret = ts.getArrayList(String.class); + if (!ret.isEmpty()) + { + encounteredLsids.addAll(ret); + for (String lsid : ret) + { + Map r = new CaseInsensitiveHashMap<>(); + r.put("lsid", lsid); + r.put("enddate", date); + toUpdate.add(r); + + Map keyMap = new CaseInsensitiveHashMap<>(); + keyMap.put("lsid", lsid); + oldKeys.add(keyMap); + } + } + } + + if (!toUpdate.isEmpty()) + { + _log.info("closing study pairing records: " + toUpdate.size()); + Map context = getExtraContext(); + context.put("skipAnnounceChangedParticipants", true); + housing.getUpdateService().updateRows(getUser(), getContainer(), toUpdate, oldKeys, null, context); + } } + public void recalculateAllVetAssignmentRecords() { EHRDemographicsService.get().recalculateForAllIdsInCache(_container, "onprc_ehr", "vet_assignment", true); From 8c6907fde0b63843b70a0394ed0196bed10679a8 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 1 Jul 2025 00:01:13 -0700 Subject: [PATCH 024/110] MOdified pairing observation xtype controls. --- .../queries/study/CageMateAdults.sql | 33 +++++++++ .../onprc_ehr/form/field/InfantEntryField.js | 3 +- .../form/field/PairedIDEntryField.js | 71 +++++++++++++++++++ .../model/sources/Pairing_Properties.js | 2 +- .../onprc_ehr/dataentry/PairingFormType.java | 3 + 5 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 onprc_ehr/resources/queries/study/CageMateAdults.sql create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql new file mode 100644 index 000000000..324f52569 --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT + + h1.Id, + group_concat(h2.Id, '; ') as adultcagemate + +FROM study.demographicsCurrentLocation h1 +JOIN study.demographicsCurrentLocation h2 ON ( + h1.room = h2.room AND + h1.cage = h2.cage AND + h1.Id != h2.Id +) + +WHERE + h1.room.housingType.value = 'Cage Location' AND + h2.Id.age.ageInyears >= 1 + +GROUP BY h1.Id diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js index 44c3def47..e14869028 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js @@ -41,7 +41,6 @@ Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { }, queryValue: function(rec, cb, alwaysUseCallback){ - var date = rec.get('date') || new Date(); var id = rec.get('Id'); LABKEY.Query.selectRows({ @@ -49,7 +48,7 @@ Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { queryName: 'CageMateInfant', columns: 'Id,InfantCageMate', filterArray: [ - LABKEY.Filter.create('Id', rec.get('Id'), LABKEY.Filter.Types.EQUAL) + LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) ], failure: LDK.Utils.getErrorCallback(), scope: this, diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js new file mode 100644 index 000000000..117093069 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ + +Ext4.define('ONPRC_EHR.form.field.PairedIDEntryField', { + extend: 'LABKEY.ext4.ComboBox', + alias: 'widget.onprc_ehr-pairedidentryfield', + + + trigger1Cls: 'x4-form-search-trigger', + + initComponent: function(){ + this.callParent(arguments); + }, + + onTrigger1Click: function(){ + var rec = EHR.DataEntryUtils.getBoundRecord(this); + if (!rec){ + Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); + return; + } + + + if (!rec || !rec.get('Id')){ + Ext4.Msg.alert('Error', 'No Id Entered'); + return; + } + + Ext4.Msg.wait('Loading...'); + + + this.queryValue(rec, function(ret){ + Ext4.Msg.hide(); + + if (ret && ret.adultcagemate){ + this.setValue(ret.adultcagemate); + } + }, true); + }, + + queryValue: function(rec, cb, alwaysUseCallback){ + var id = rec.get('Id'); + + LABKEY.Query.selectRows({ + schemaName: 'study', + queryName: 'CageMateAdults', + columns: 'Id,adultcagemate', + filterArray: [ + LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) + ], + failure: LDK.Utils.getErrorCallback(), + scope: this, + success: function(results){ + if (!alwaysUseCallback && id != this.pendingIdRequest){ + console.log('more recent request, aborting'); + return; + } + + if (results && results.rows && results.rows.length){ + cb.call(this, results.rows[0], results.rows[0].Id); + } + else { + cb.call(this, null, id); + } + } + }); + } + +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index d43c33325..b2a5f9018 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -88,7 +88,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, other_IDs: { - xtype: 'textareafield', + xtype: 'onprc_ehr-pairedidentryfield', header:'Other ID', columnConfig: { width: 200 diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index d402bb42d..24b28077e 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -61,6 +61,9 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) //Added 6-25-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/DurationEntryField.js")); + //Added 7-1-2026 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedIDEntryField.js")); + From 2833c6bbaf18e47c4214fa1db0a778f1bf8dd7ff Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:04:41 -0700 Subject: [PATCH 025/110] Modified pairing Observation input form to expand the input field width size. --- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index b2a5f9018..442ab265b 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -112,6 +112,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, + lowestcage: { + xtype: 'textareafield', + columnConfig: { + width: 200 + } + }, duration: { xtype: 'onprc_ehr-durationentryfield', allowBlank:true, From 066492612b9bdb1b37ae87813e491ececb412035 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 7 Jul 2025 23:26:28 -0700 Subject: [PATCH 026/110] Modified pairing Observation input form to expand the input field width size. --- .../resources/web/onprc_ehr/model/sources/Pairing_Properties.js | 1 + 1 file changed, 1 insertion(+) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 442ab265b..7e30d7ac0 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -114,6 +114,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, lowestcage: { xtype: 'textareafield', + height:50, columnConfig: { width: 200 } From 2487922b8122313c841fdf1f9f7d6f4d8216150c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 15 Jul 2025 21:30:10 -0700 Subject: [PATCH 027/110] Modified new pairing observation input form to include new input fields that auto load data. --- .../form/field/PairedDamEntryField.js | 74 +++++++++++++++++++ .../model/sources/Pairing_Properties.js | 19 ++--- 2 files changed, 84 insertions(+), 9 deletions(-) create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js new file mode 100644 index 000000000..c75c535d8 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ + +Ext4.define('ONPRC_EHR.form.field.PairedDamEntryField', { + extend: 'LABKEY.ext4.ComboBox', + alias: 'widget.onprc_ehr-paireddamdentryfield', + + + trigger1Cls: 'x4-form-search-trigger', + + initComponent: function(){ + this.callParent(arguments); + }, + + onTrigger1Click: function(){ + var rec = EHR.DataEntryUtils.getBoundRecord(this); + if (!rec){ + Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); + return; + } + + + if (!rec || !rec.get('Id')){ + Ext4.Msg.alert('Error', 'No Id Entered'); + return; + } + + Ext4.Msg.wait('Loading...'); + + + this.queryValue(rec, function(ret){ + Ext4.Msg.hide(); + + if (ret && ret.dam){ + this.setValue(ret.dam); + } + else if (ret && ret.fosterMom){ + this.setValue(ret.fosterMom); + } + }, true); + }, + + queryValue: function(rec, cb, alwaysUseCallback){ + var id = rec.get('other_infant'); + + LABKEY.Query.selectRows({ + schemaName: 'study', + queryName: 'demographicParents', + columns: 'Id,dam,fosterMom', + filterArray: [ + LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) + ], + failure: LDK.Utils.getErrorCallback(), + scope: this, + success: function(results){ + if (!alwaysUseCallback && id != this.pendingIdRequest){ + console.log('more recent request, aborting'); + return; + } + + if (results && results.rows && results.rows.length){ + cb.call(this, results.rows[0], results.rows[0].Id); + } + else { + cb.call(this, null, id); + } + } + }); + } + +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 7e30d7ac0..7d4c7fa63 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -87,13 +87,20 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { ] } }, - other_IDs: { + lowestcage: { xtype: 'onprc_ehr-pairedidentryfield', - header:'Other ID', + // header:'Other ID', columnConfig: { width: 200 } }, + other_IDs: { + xtype: 'onprc_ehr-paireddamdentryfield', + header:'Other ID', + columnConfig: { + width: 200 + } + }, remark2: { xtype: 'textareafield', columnConfig: { @@ -112,13 +119,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, - lowestcage: { - xtype: 'textareafield', - height:50, - columnConfig: { - width: 200 - } - }, + duration: { xtype: 'onprc_ehr-durationentryfield', allowBlank:true, From bb5aeb29058bbb109c2b3cd4e5cea5be076dfa3a Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 30 Jul 2025 00:36:17 -0700 Subject: [PATCH 028/110] Modified pairings input form. --- .../queries/onprc_ehr/PairingStartType.sql | 5 ----- .../resources/queries/onprc_ehr/Pairingmenus.sql | 15 +++++++++++++++ .../web/onprc_ehr/form/field/PairingsCombo.js | 10 +++++----- 3 files changed, 20 insertions(+), 10 deletions(-) delete mode 100644 onprc_ehr/resources/queries/onprc_ehr/PairingStartType.sql create mode 100644 onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql diff --git a/onprc_ehr/resources/queries/onprc_ehr/PairingStartType.sql b/onprc_ehr/resources/queries/onprc_ehr/PairingStartType.sql deleted file mode 100644 index 5aa0add81..000000000 --- a/onprc_ehr/resources/queries/onprc_ehr/PairingStartType.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Created: 6-20-2018 R.Blasa - -select value, sort_order from sla.Reference_Data -where columnName = 'PairingStarttype' -And endDate is null \ No newline at end of file diff --git a/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql b/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql new file mode 100644 index 000000000..44c3ee31e --- /dev/null +++ b/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql @@ -0,0 +1,15 @@ +-- Created: 7-29-2025 R.Blasa + +select value, + category + +from ehr_lookups.pairingstarttype +Where date_disabled is null + +union + +select value, + category + +from ehr_lookups.pairingendtypes +Where date_disabled is null \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js index 396c4e9f9..be6554a78 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js @@ -41,11 +41,11 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { anyMatch: true, store: { type: 'labkey-store', - schemaName: 'sla', + schemaName: 'onprc_ehr', storeId: 'pairingStore_' + this.id, - queryName: 'Reference_Data', - columns: 'value,columnName', - filterArray: [LABKEY.Filter.create('enddate', null, LABKEY.Filter.Types.ISBLANK)], + queryName: 'Pairingmenus', + columns: 'value,category', + filterArray: [LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK)], sort: 'value', maxRows: 0, autoLoad: true, @@ -243,7 +243,7 @@ Ext4.define('ONPRC_EHR.form.field.pairingCombo', { else { var re = new RegExp('(,|^)' + subset + '(,|$)'); this.pairingStore.each(function(r){ - if (r.get('columnName') && r.get('columnName').match(re)) + if (r.get('category') && r.get('category').match(re)) records.push(r); }, this); } From 17ff358b0a6c79110177c63d601651622fb78439 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:10:05 -0700 Subject: [PATCH 029/110] Modified pairings input form. --- onprc_ehr/resources/web/onprc_ehr/Utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index 129d7289e..ee302dc87 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -27,14 +27,14 @@ ONPRC.Utils = new function(){ if (ONPRC_EHR._pairingStore) return ONPRC_EHR._pairingStore; - var storeId = ['sla', 'Reference_Data', 'value', 'columnName'].join('||'); + var storeId = ['onprc_ehr', 'Pairingmenus', 'value', 'category'].join('||'); ONPRC_EHR._pairingStore = Ext4.StoreMgr.get(storeId) || Ext4.create('LABKEY.ext4.data.Store', { type: 'labkey-store', - schemaName: 'sla', - queryName: 'Reference_Data', - columns: 'value, columnName', - filterArray: [LABKEY.Filter.create('enddate', null, LABKEY.Filter.Types.ISBLANK)], + schemaName: 'onprc_ehr', + queryName: 'Pairingmenus', + columns: 'value, category', + filterArray: [LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK)], sort: 'value', storeId: storeId, autoLoad: true, From b250e839717b53b81666642ef7dbb2ed29ab89c7 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 1 Aug 2025 13:15:14 -0700 Subject: [PATCH 030/110] Modified Pairing Observation's drop down listings menus. --- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 7d4c7fa63..7f845aa7e 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -29,7 +29,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { eventtype: { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingStarttype' + defaultSubset: 'divider_change' //Use the category name here }, columnConfig: { width: 200 @@ -53,7 +53,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { endeventType: { editorConfig: { xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'PairingEndtype' + defaultSubset: 'pairing_endtype' }, columnConfig: { width: 200 From e3e00258bbf493cea63c24667d12c9c4b7621ae6 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:10:14 -0700 Subject: [PATCH 031/110] Modified Pairing Observation's drop down listings menus. --- onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql b/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql index 44c3ee31e..61752eefa 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql +++ b/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql @@ -12,4 +12,12 @@ select value, category from ehr_lookups.pairingendtypes +Where date_disabled is null + +union + +select value, + category + +from ehr_lookups.pairing_STF_clinical Where date_disabled is null \ No newline at end of file From e7366e1cf790afd56e155d77f5af1c6a954801a4 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 4 Aug 2025 13:46:26 -0700 Subject: [PATCH 032/110] Modified Pairing Observation's drop down listings menus. --- .../form/field/PairedDamEntryField.js | 6 ++--- .../form/field/PairedIDEntryField.js | 17 ++++++++---- ...ntryField.js => PairedInfantEntryField.js} | 27 ++++++++++++------- .../model/sources/Pairing_Properties.js | 5 ++-- .../onprc_ehr/dataentry/PairingFormType.java | 7 +++-- 5 files changed, 41 insertions(+), 21 deletions(-) rename onprc_ehr/resources/web/onprc_ehr/form/field/{InfantEntryField.js => PairedInfantEntryField.js} (67%) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js index c75c535d8..1ff9a1492 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js @@ -23,8 +23,8 @@ Ext4.define('ONPRC_EHR.form.field.PairedDamEntryField', { } - if (!rec || !rec.get('Id')){ - Ext4.Msg.alert('Error', 'No Id Entered'); + if (!rec || !rec.get('other_infant')){ + Ext4.Msg.alert('Error', 'No Infant Entered'); return; } @@ -51,7 +51,7 @@ Ext4.define('ONPRC_EHR.form.field.PairedDamEntryField', { queryName: 'demographicParents', columns: 'Id,dam,fosterMom', filterArray: [ - LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) + LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.CONTAINS) ], failure: LDK.Utils.getErrorCallback(), scope: this, diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js index 117093069..e98edddf8 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js @@ -23,8 +23,12 @@ Ext4.define('ONPRC_EHR.form.field.PairedIDEntryField', { } - if (!rec || !rec.get('Id')){ - Ext4.Msg.alert('Error', 'No Id Entered'); + if (!rec || !rec.get('room')){ + Ext4.Msg.alert('Error', 'No room Entered'); + return; + } + if (!rec || !rec.get('cage')){ + Ext4.Msg.alert('Error', 'No cage Entered'); return; } @@ -41,14 +45,17 @@ Ext4.define('ONPRC_EHR.form.field.PairedIDEntryField', { }, queryValue: function(rec, cb, alwaysUseCallback){ - var id = rec.get('Id'); + var roomt = rec.get('room'); + var caget = rec.get('cage'); LABKEY.Query.selectRows({ schemaName: 'study', queryName: 'CageMateAdults', - columns: 'Id,adultcagemate', + columns: 'adultcagemate', + sort:'Id', filterArray: [ - LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) + LABKEY.Filter.create('room', roomt , LABKEY.Filter.Types.EQUAL), + LABKEY.Filter.create('cage', caget , LABKEY.Filter.Types.EQUAL) ], failure: LDK.Utils.getErrorCallback(), scope: this, diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js similarity index 67% rename from onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js rename to onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js index e14869028..69e602a45 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/InfantEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ -Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { +Ext4.define('ONPRC_EHR.form.field.PairedInfantEntryField', { extend: 'LABKEY.ext4.ComboBox', - alias: 'widget.onprc_ehr-infantentryfield', + alias: 'widget.onprc_ehr-pairedinfantentryfield', trigger1Cls: 'x4-form-search-trigger', @@ -23,32 +23,41 @@ Ext4.define('ONPRC_EHR.form.field.InfantEntryField', { } - if (!rec || !rec.get('Id')){ - Ext4.Msg.alert('Error', 'No Id Entered'); + if (!rec || !rec.get('room')){ + Ext4.Msg.alert('Error', 'No room Entered'); + return; + } + if (!rec || !rec.get('cage')){ + Ext4.Msg.alert('Error', 'No cage Entered'); return; } + Ext4.Msg.wait('Loading...'); this.queryValue(rec, function(ret){ Ext4.Msg.hide(); - if (ret && ret.InfantCageMate){ - this.setValue(ret.InfantCageMate); + if (ret && ret.infantcagemate){ + this.setValue(ret.infantcagemate); } }, true); }, queryValue: function(rec, cb, alwaysUseCallback){ - var id = rec.get('Id'); + var roomt = rec.get('room'); + var caget = rec.get('cage'); + LABKEY.Query.selectRows({ schemaName: 'study', queryName: 'CageMateInfant', - columns: 'Id,InfantCageMate', + columns: 'infantcagemate', + sort:'Id', filterArray: [ - LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.EQUAL) + LABKEY.Filter.create('room', roomt , LABKEY.Filter.Types.EQUAL), + LABKEY.Filter.create('cage', caget , LABKEY.Filter.Types.EQUAL) ], failure: LDK.Utils.getErrorCallback(), scope: this, diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 7f845aa7e..949f3a08c 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -96,7 +96,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_IDs: { xtype: 'onprc_ehr-paireddamdentryfield', - header:'Other ID', + header:'Other Infant', // should display the infant's dam columnConfig: { width: 200 } @@ -128,7 +128,8 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, other_infant: { - xtype: 'onprc_ehr-infantentryfield', + xtype: 'onprc_ehr-pairedinfantentryfield', + header: 'Infant ID', // should display the infant columnConfig: { width: 160 } diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index 24b28077e..272b439e3 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -55,15 +55,18 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairingsCombo.js")); //Added 6-25-2025 R.Blasa - addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/InfantEntryField.js")); + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedInfantEntryField.js")); //Added 6-25-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/DurationEntryField.js")); - //Added 7-1-2026 R.Blasa + //Added 7-1-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedIDEntryField.js")); + //Added 8-5-2025 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedDamEntryField.js")); + From fc8f22f32f13efc06f84128ef72e371d58d8f1ce Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:14:29 -0700 Subject: [PATCH 033/110] Modified Pairing Observation's drop down listings menus. --- .../queries/study/CageMateAdults.sql | 26 ++++++++++--------- .../queries/study/CageMateAdults/.qview.xml | 5 ++++ .../queries/study/CageMateInfant.sql | 19 +++++++------- .../form/field/PairedDamEntryField.js | 4 +-- 4 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 onprc_ehr/resources/queries/study/CageMateAdults/.qview.xml diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 324f52569..1269ccde4 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -16,18 +16,20 @@ SELECT - h1.Id, - group_concat(h2.Id, '; ') as adultcagemate + group_concat(h1.Id, '; ') as adultcagemate, -FROM study.demographicsCurrentLocation h1 -JOIN study.demographicsCurrentLocation h2 ON ( - h1.room = h2.room AND - h1.cage = h2.cage AND - h1.Id != h2.Id -) + group_Concat(distinct h1.room) as room, + group_concat(distinct h1.Id.curLocation.cage) as cage + + +FROM study.demographicspaired h1 + + +where + + h1.room.housingType.value = 'Cage Location' + + +group by h1.room, h1.Id.curLocation.cage -WHERE - h1.room.housingType.value = 'Cage Location' AND - h2.Id.age.ageInyears >= 1 -GROUP BY h1.Id diff --git a/onprc_ehr/resources/queries/study/CageMateAdults/.qview.xml b/onprc_ehr/resources/queries/study/CageMateAdults/.qview.xml new file mode 100644 index 000000000..0f45185ae --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateAdults/.qview.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 3ceff8d9f..c88c6bf7f 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -16,18 +16,17 @@ SELECT - h1.Id, - group_concat(h2.Id) as InfantCageMate + group_concat(h1.Id, '; ') as infantcagemate, -FROM study.demographicsCurrentLocation h1 -JOIN study.demographicsCurrentLocation h2 ON ( - h1.room = h2.room AND - h1.cage = h2.cage AND - h1.Id != h2.Id -) + group_Concat(distinct h1.room) as room, + group_concat(distinct h1.Id.curLocation.cage) as cage + +FROM study.demographicspaired h1 WHERE h1.room.housingType.value = 'Cage Location' AND - h2.Id.age.ageInyears < 1 + h1.Id.age.ageInyears < 1 + +group by h1.room, h1.Id.curLocation.cage + -GROUP BY h1.Id diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js index 1ff9a1492..075f8a9b7 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js @@ -48,10 +48,10 @@ Ext4.define('ONPRC_EHR.form.field.PairedDamEntryField', { LABKEY.Query.selectRows({ schemaName: 'study', - queryName: 'demographicParents', + queryName: 'demographicsParents', columns: 'Id,dam,fosterMom', filterArray: [ - LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.CONTAINS) + LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.CONTAINS_ONE_OF) ], failure: LDK.Utils.getErrorCallback(), scope: this, From 9b482a036312632e7cc540273f216edd4adaf317 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:19:35 -0700 Subject: [PATCH 034/110] Modified Pairing Observation's drop down listings menus. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 2 +- .../resources/web/onprc_ehr/model/sources/Pairing_Properties.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index fa42871e7..f7a937ea9 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -26,7 +26,7 @@ false - Other ID + Other IDs false diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 949f3a08c..2a376c2db 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -96,7 +96,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_IDs: { xtype: 'onprc_ehr-paireddamdentryfield', - header:'Other Infant', // should display the infant's dam + header:'Other IDs', // should display the infant's dam columnConfig: { width: 200 } From 8d835d08137495a2da1abdd7fe298d2e417fd656 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 4 Aug 2025 15:37:46 -0700 Subject: [PATCH 035/110] Modified Pairing Observation's drop down listings menus. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 2 +- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index f7a937ea9..8b0fb0964 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -10,7 +10,7 @@ - + false Infant ID diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 2a376c2db..473f36456 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -24,7 +24,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { ] } }, - + Id: { + allowBlank: false, + columnConfig: { + width: 100 + } + }, eventtype: { editorConfig: { From cee9d870ef534e2dd5ac1f3c2b5dbf9c55c03fe6 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 5 Aug 2025 18:26:30 -0700 Subject: [PATCH 036/110] Modified Pairing Observation's drop down listings menus. --- onprc_ehr/resources/queries/study/CageMateAdults.sql | 4 ++-- onprc_ehr/resources/queries/study/CageMateInfant.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 1269ccde4..859da2d40 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -15,7 +15,7 @@ */ SELECT - + h1.Id, group_concat(h1.Id, '; ') as adultcagemate, group_Concat(distinct h1.room) as room, @@ -30,6 +30,6 @@ where h1.room.housingType.value = 'Cage Location' -group by h1.room, h1.Id.curLocation.cage +group by h1.room, h1.Id.curLocation.cage, h1.Id diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index c88c6bf7f..023421eb5 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -15,7 +15,7 @@ */ SELECT - + h1.Id, group_concat(h1.Id, '; ') as infantcagemate, group_Concat(distinct h1.room) as room, @@ -27,6 +27,6 @@ WHERE h1.room.housingType.value = 'Cage Location' AND h1.Id.age.ageInyears < 1 -group by h1.room, h1.Id.curLocation.cage +group by h1.room, h1.Id.curLocation.cage, h1.Id From 7ed0c195c69e4c1ff629835ebc8ff1b2486ccd62 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:29:52 -0700 Subject: [PATCH 037/110] Modified BSU Rounds input form to include case information. --- .../queries/study/CageMateAdults.sql | 18 +++++----- .../queries/study/CageMateInfant.sql | 35 ++++++------------- 2 files changed, 19 insertions(+), 34 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 859da2d40..3f47acd0a 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -15,21 +15,21 @@ */ SELECT - h1.Id, - group_concat(h1.Id, '; ') as adultcagemate, - - group_Concat(distinct h1.room) as room, - group_concat(distinct h1.Id.curLocation.cage) as cage + h1.Id, + group_concat(h2.Id) as adultcagemate -FROM study.demographicspaired h1 - +FROM study.demographicsCurrentLocation h1 + JOIN study.demographicsCurrentLocation h2 ON ( + h1.room = h2.room AND + h1.cage = h2.cage -where + ) +WHERE h1.room.housingType.value = 'Cage Location' -group by h1.room, h1.Id.curLocation.cage, h1.Id +GROUP BY h1.Id diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 023421eb5..3a4be6b0a 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,32 +1,17 @@ -/* - * Copyright (c) 2017 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - SELECT + h1.Id, - group_concat(h1.Id, '; ') as infantcagemate, + group_concat(h2.Id) as InfantCageMate - group_Concat(distinct h1.room) as room, - group_concat(distinct h1.Id.curLocation.cage) as cage +FROM study.demographicsCurrentLocation h1 + JOIN study.demographicsCurrentLocation h2 ON ( + h1.room = h2.room AND + h1.cage = h2.cage -FROM study.demographicspaired h1 + ) WHERE - h1.room.housingType.value = 'Cage Location' AND - h1.Id.age.ageInyears < 1 - -group by h1.room, h1.Id.curLocation.cage, h1.Id - + h1.room.housingType.value = 'Cage Location' AND + h2.Id.age.ageInyears < 1 +GROUP BY h1.Id \ No newline at end of file From 83c728b68d4d8ad2e6bf097d8e3766a9fc9da8a2 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:36:50 -0700 Subject: [PATCH 038/110] Modified BSU Rounds input form to include case information. --- onprc_ehr/resources/queries/study/CageMateInfant.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 3a4be6b0a..0a79b272d 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,7 +1,7 @@ SELECT h1.Id, - group_concat(h2.Id) as InfantCageMate + group_concat(h2.Id) as infantcagemate FROM study.demographicsCurrentLocation h1 JOIN study.demographicsCurrentLocation h2 ON ( From a6e96e5ac8eb5297c7432649faa7e9f6d054da83 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 6 Aug 2025 07:48:44 -0700 Subject: [PATCH 039/110] Modified BSU Rounds input form to include case information. --- onprc_ehr/resources/queries/study/CageMateAdults.sql | 4 +++- onprc_ehr/resources/queries/study/CageMateInfant.sql | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 3f47acd0a..2b7300089 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -17,7 +17,9 @@ SELECT h1.Id, - group_concat(h2.Id) as adultcagemate + group_concat(h2.Id) as adultcagemate, + group_Concat(distinct h2.room) as room, + group_concat(distinct h1.cage) as cage FROM study.demographicsCurrentLocation h1 JOIN study.demographicsCurrentLocation h2 ON ( diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 0a79b272d..9866f7507 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,7 +1,9 @@ SELECT h1.Id, - group_concat(h2.Id) as infantcagemate + group_concat(h2.Id) as infantcagemate, + group_Concat(distinct h2.room) as room, + group_concat(distinct h1.cage) as cage FROM study.demographicsCurrentLocation h1 JOIN study.demographicsCurrentLocation h2 ON ( From 92e4fe73863b3d0b0114f823169911d5a2d34f74 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 19 Aug 2025 12:43:46 -0700 Subject: [PATCH 040/110] MOdified pairing observation input form to include Other infant id label. --- .../resources/web/onprc_ehr/model/sources/Pairing_Properties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 473f36456..126380147 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -134,7 +134,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_infant: { xtype: 'onprc_ehr-pairedinfantentryfield', - header: 'Infant ID', // should display the infant + header: 'Other Infant ID', // should display the infant columnConfig: { width: 160 } From d0643e5f85efcaa4cbd18f4cc9d9ebdee50c205b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:19:01 -0700 Subject: [PATCH 041/110] MOdified Pairing obsrevation input forms to include category input fields. --- .../resources/queries/study/Pairings.query.xml | 18 ++++++++++++++++++ .../model/sources/Pairing_Properties.js | 15 +++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 8b0fb0964..ba5fb532f 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -35,6 +35,15 @@ Start Date + + false + Category + + ehr + observation_types + value + + Start Type @@ -126,6 +135,15 @@ true + + false + Category + + ehr + observation_types + value + + diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 126380147..6160355e7 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -132,6 +132,21 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, + + category: { + allowBlank: false, + editorConfig: { + plugins: [Ext4.create('LDK.plugin.UserEditableCombo', { + allowChooseOther: false + })] + }, + lookup: { + columns: 'value,description' + }, + columnConfig: { + width: 200 + } + }, other_infant: { xtype: 'onprc_ehr-pairedinfantentryfield', header: 'Other Infant ID', // should display the infant From 8719d971d543c25b1873204394c48da2fbb443eb Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 20 Aug 2025 18:37:12 -0700 Subject: [PATCH 042/110] MOdified Pairing obsrevation input forms to include category input fields. --- .../resources/queries/study/Pairings.query.xml | 2 +- .../sqlserver/onprc_ehr-24.012-24.013.sql | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index ba5fb532f..df642ff97 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -39,7 +39,7 @@ false Category - ehr + onprc_ehr observation_types value diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql new file mode 100644 index 000000000..042e876b6 --- /dev/null +++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql @@ -0,0 +1,18 @@ +CREATE TABLE onprc_ehr.observation_types ( + rowid [int] IDENTITY(100,1) NOT NULL, + value nvarchar(200), + category nvarchar(200), + editorconfig NVARCHAR(MAX), + schemaname nvarchar(200), + queryname nvarchar(200), + valuecolumn nvarchar(200), + Created datetime, + CreatedBy USERID, + Modified datetime, + ModifiedBy USERID, + Container entityId NOT NULL, + + CONSTRAINT PK_ONPRC_EHR_OBSERVATION_TYPES PRIMARY KEY (rowid), + +); +GO From f83cffa5547563fa4a110a2b97abc3ecaddb14b6 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 20 Aug 2025 23:04:02 -0700 Subject: [PATCH 043/110] MOdified Pairing obsrevation input forms to include category input fields. --- .../model/sources/Pairing_Properties.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 6160355e7..48cde5cdd 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -31,15 +31,15 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - eventtype: { - editorConfig: { - xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'divider_change' //Use the category name here - }, - columnConfig: { - width: 200 - } - }, + // eventtype: { + // editorConfig: { + // xtype: 'onprc_ehr-pairingcombo', + // defaultSubset: 'divider_change' //Use the category name here + // }, + // columnConfig: { + // width: 200 + // } + // }, goal: { From 9c629b20bdc627ff9e5aa278d37b43ba8f758a72 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:22:51 -0700 Subject: [PATCH 044/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/resources/queries/study/Pairings.js | 26 +- .../queries/study/Pairings.query.xml | 20 +- onprc_ehr/resources/web/onprc_ehr/Utils.js | 15 +- .../web/onprc_ehr/form/field/PairingsCombo.js | 255 ------------------ .../model/sources/Pairing_Properties.js | 14 +- .../panel/PairingObservationGridPanel.js | 28 ++ .../plugin/PairinglObservationsCellEditing.js | 76 ++++++ 7 files changed, 128 insertions(+), 306 deletions(-) delete mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js create mode 100644 onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js create mode 100644 onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js diff --git a/onprc_ehr/resources/queries/study/Pairings.js b/onprc_ehr/resources/queries/study/Pairings.js index b780181c6..20a136677 100644 --- a/onprc_ehr/resources/queries/study/Pairings.js +++ b/onprc_ehr/resources/queries/study/Pairings.js @@ -6,33 +6,9 @@ require("ehr/triggers").initScript(this); -var ONPRC_triggerHelper = new org.labkey.onprc_ehr.query.ONPRC_EHRTriggerHelper(LABKEY.Security.currentUser.id, LABKEY.Security.currentContainer.id); - -function onInit(event, helper) { +function onInit(event, helper){ helper.setScriptOptions({ errorSeverityForImproperHousing: 'INFO' }); - } -function onComplete(event, errors, triggerHelper){ - if (!triggerHelper.isETL() && !triggerHelper.isValidateOnly()){ - var studyRows = triggerHelper.getRows(); - var idsToClose = []; - if (studyRows){ - for (var i=0;i + Start Type - - onprc_ehr - PairingStartType - value - @@ -92,8 +88,8 @@ End Type - onprc_ehr - PairingEndType + ehr_lookkups + pairingEndType value @@ -135,15 +131,7 @@ true - - false - Category - - ehr - observation_types - value - - + diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index ee302dc87..591cecc00 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -49,7 +49,20 @@ ONPRC.Utils = new function(){ return ONPRC_EHR._pairingStore; }, - preloadSession: function() { + getpairingObservationTypesStore: function() { + if (ONPRC_EHR._pairingobservationTypesStore) + return ONPRC_EHR._pairingobservationTypesStore; + + EHR._observationTypesStore = Ext4.create('LABKEY.ext4.data.Store', { + type: 'labkey-store', + schemaName: 'onprc_ehr', + queryName: 'observation_types', + columns: 'value,editorconfig', + autoLoad: true + }); + }, + + preloadSession: function() { LABKEY.Ajax.request({ url: LABKEY.ActionURL.buildURL('onprc_ehr', 'getSessionId'), method: 'POST', diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js deleted file mode 100644 index be6554a78..000000000 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairingsCombo.js +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright (c) 2013-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ -/** - * This creates a combobox suitable to display SNOMED results. It is a 2-part field, where the top combo allows you to - * select the 'snomed subset'. When a subset is picked, the bottom combo loads that subset of codes. This is designed as - * a mechanism to support more managable sets of allowable values for SNOMED entry. It is heavily tied to ehr_lookups.snomed_subsets - * and ehr_lookups.snomed_subset_codes. - * @param {object} config The configuation object. - * @param {string} [config.defaultSubset] The default SNOMED subset to load - * - */ - - - -Ext4.define('ONPRC_EHR.form.field.pairingCombo', { - extend: 'Ext.form.field.ComboBox', - alias: 'widget.onprc_ehr-pairingcombo', - - activeSubset: null, - - initComponent: function(){ - this.getpairingStore(); - this.activeSubset = this.defaultSubset; - - Ext4.apply(this, { - trigger2Cls: Ext4.form.field.ComboBox.prototype.triggerCls, - onTrigger2Click: Ext4.form.field.ComboBox.prototype.onTriggerClick, - trigger1Cls: 'x4-form-search-trigger', - xtype: 'labkey-combo', - queryMode: 'local', - name: this.name, - typeAhead: true, - pairingStore: this.pairingStore, - displayField: 'value', - valueField: 'value', - forceSelection: true, - caseSensitive: false, - anyMatch: true, - store: { - type: 'labkey-store', - schemaName: 'onprc_ehr', - storeId: 'pairingStore_' + this.id, - queryName: 'Pairingmenus', - columns: 'value,category', - filterArray: [LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK)], - sort: 'value', - maxRows: 0, - autoLoad: true, - listeners: { - scope: this, - delay: 100, - load: function(s){ - if (this.activeSubset) - this.applyFilter(this.activeSubset); - } - } - } - }); - - this.callParent(arguments); - - this.on('render', function(field){ - Ext4.QuickTips.register({ - target: field.triggerEl.elements[0], - text: 'Click to change the pairings event type' - }); - }, this); - }, - - //used to prevent combo/editor from closing when toggling pairing subsets - validateBlur: function(){ - return !this.window; - }, - - onTrigger1Click: function(){ - var cfg = this.getFilterComboCfg(); - cfg.value = this.activeSubset || cfg.value; - - this.window = Ext4.create('Ext.window.Window', { - title: 'Choose the Event Type Category', - modal: true, - closeAction: 'destroy', - width: 410, - bodyStyle: 'padding: 5px;', - items: [{ - html: ' The field below can be used to change which category to be displayed, or you can choose all catgories. Please note that the event type field should narrow down the list of event types as you begin typing.', - border: false, - style: 'padding-bottom: 10px;' - }, cfg], - buttons: [{ - text: 'Submit', - scope: this, - handler: function(btn){ - var win = btn.up('window'); - var val = win.down('#filterCombo').getValue(); - if (!val){ - Ext4.Msg.alert('Error', 'Must choose a event type category'); - return; - } - - win.close(); - this.window = null; - this.applyFilter(val); - } - },{ - text: 'Close', - scope: this, - handler: function(btn){ - var win = btn.up('window'); - win.close(); - this.window = null; - } - }] - - }).show(); - }, - - ensureRecord: function(val){ - if (this.isDestroyed){ - return; - } - - if (!this.store){ - LDK.Assert.assertNotEmpty('this.store is null in pairingCombo.ensureRecord()', this.store); - } - - var recIdx = this.store.findExact('value', val); - if (recIdx == -1){ - recIdx = this.pairingStore.findExact('value', val); - - if (recIdx != -1){ - if (this.store.isLoading()){ - var me = this; - this.store.on('load', function(){ - me.ensureRecord(val); - }, me, {single: true}); - } - else { - this.store.add(this.pairingStore.getAt(recIdx)); - } - } - else if (this.pairingStore.isLoading()){ - var me = this; - me.pairingStore.on('load', function(){ - me.ensureRecord(val); - //NOTE: if the value becomes NULL, it is likely because a user clicked on the combo prior to pairing store loading. - if (!me.getValue()) { - me.setValue(val); - } - }, me, {single: true}); - } - } - }, - - getpairingStore: function(){ - if (this.pairingStore) - return this.pairingStore; - - this.pairingStore = ONPRC.Utils.getpairingStore(); - - if (!this.pairingStore.loading){ - if (this.activeSubset) - this.applyFilter(this.activeSubset); - } - - this.mon(this.pairingStore, 'load', function(){ - if (this.activeSubset) - this.applyFilter(this.activeSubset); - }, this); - - return this.pairingStore; - }, - - setValue: function(val){ - if (Ext4.isString(val)) { - this.ensureRecord(val); - } - else if (Ext4.isArray(val) && val.length == 1 && val[0].isModel) { - this.ensureRecord(val[0].get('value')); - } - else if (Ext4.isObject(val) && val.value){ - this.ensureRecord(val.value); - } - - this.callOverridden(arguments); - }, - - getFilterComboCfg: function(){ - return { - xtype: 'combo', - itemId: 'filterCombo', - emptyText: 'Pick event type category...', - typeAhead: true, - isFormField: false, - fieldLabel: 'Choose a category', - labelWidth: 120, - width: 380, - valueField: 'value', - displayField: 'title', - queryMode: 'local', - initialValue: this.activeSubset, - value: this.activeSubset, - nullCaption: 'All', - store: { - type: 'labkey-store', - schemaName: 'ehr_lookups', - queryName: 'pairing_Subsets', - columns: 'value,title', - sort: 'value', - autoLoad: true, - listeners: { - scope: this, - load: function(s){ - s.add({subset: 'All'}); - } - } - } - }; - }, - - applyFilter: function(subset){ - var value = this.getValue(); - this.activeSubset = subset; - - if (this.pairingStore.loading || this.isDestroyed){ - return; - } - - LDK.Assert.assertNotEmpty('pairingCombo.applyFilter() called w/ a null store', this.store); - if (!this.store){ - return; - } - - this.store.removeAll(); - - var records = []; - if (!subset || subset == 'All'){ - records = this.pairingStore.getRange(); - } - else { - var re = new RegExp('(,|^)' + subset + '(,|$)'); - this.pairingStore.each(function(r){ - if (r.get('category') && r.get('category').match(re)) - records.push(r); - }, this); - } - - this.store.add(records); - if (value) - this.ensureRecord(value); - } -}); diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 48cde5cdd..d1c456fea 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -31,15 +31,11 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - // eventtype: { - // editorConfig: { - // xtype: 'onprc_ehr-pairingcombo', - // defaultSubset: 'divider_change' //Use the category name here - // }, - // columnConfig: { - // width: 200 - // } - // }, + eventtype: { + columnConfig: { + width: 200 + } + }, goal: { diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js b/onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js new file mode 100644 index 000000000..899e3b11c --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * Created to allow a custom row editor plugin and column that summarize observations + */ +Ext4.define('ONPRC_EHR.grid.PairingObservationGridPanel', { + extend: 'EHR.grid.Panel', + alias: 'widget.onprc_ehr-pairingbservationgridpanel', + + initComponent: function(){ + this.pairingobservationTypesStore = ONPRC.Utils.getpaiirngObservationTypesStore(); + + this.callParent(arguments); + }, + + getEditingPlugin: function(){ + LDK.Assert.assertNotEmpty('this.pairingobservationTypesStore is null in PairingObservationsGridPanel', this.pairingobservationTypesStore); + + return Ext4.create('ONPRC_EHR.grid.plugin.pairingObservationsCellEditing', { + pluginId: this.editingPluginId, + clicksToEdit: this.clicksToEdit, + pairingobservationTypesStore: ONPRC.Utils.getpairingObservationTypesStore() + }); + } +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js b/onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js new file mode 100644 index 000000000..8094e5c44 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +Ext4.define('ONPRC_EHR.grid.plugin.PairingObservationsCellEditing', { + extend: 'LDK.grid.plugin.CellEditing', + alias: 'plugin.pairingobservationscellediting', + + constructor: function(config){ + this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); + + this.callParent(arguments); + }, + + getEditor: function(record, column) { + var dataIndex = column ? column.dataIndex : null; + if (dataIndex != 'eventtype'){ + return this.callParent(arguments); + } + + var category = record.get('category'); + if (!category){ + return false; + } + + var store = this.pairingobservationTypesStore; + + //note: we allow the process to proceed even if we cant find the category. this is to support situations where we have saved records using a no-longer supported category + var rec = store.findRecord('value', category); + LDK.Assert.assertNotEmpty('Unable to find observation types record matching category: [' + category + ']. store count: ' + store.getCount() + ', loading: ' + store.isLoading(), rec); + + var me = this, + editors = me.editors, + editorId = column.getItemId() + '||' + category, + editor = editors.getByKey(editorId), + editorOwner = me.grid.ownerLockable || me.grid; + + if (!editor || editor.obsCategory != category){ + var config = rec && rec.get('editorconfig') ? Ext4.decode(rec.get('editorconfig')) : null; + config = config || { + xtype: 'textfield' + }; + + editor = Ext4.create('Ext.grid.CellEditor', { + obsCategory: category, + floating: true, + editorId: editorId, + field: config + }); + + //NOTE: essential for keyboard navigation + if (editor && !editor.hasCellEditOverrides){ + this.applyEditorOverrides(editor); + } + + editorOwner.add(editor); + editor.on({ + scope: me, + specialkey: me.onSpecialKey, + complete: me.onEditComplete, + canceledit: me.cancelEdit + }); + column.on('removed', me.cancelActiveEdit, me); + + me.editors.add(editor); + } + + editor.grid = me.grid; + + // Keep upward pointer correct for each use - editors are shared between locking sides + editor.editingPlugin = me; + + return editor; + } +}); \ No newline at end of file From 1dddca63ae1c0149982de92634fcbde08671885b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:33:06 -0700 Subject: [PATCH 045/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8c924e862..4bad920b0 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.012; + return 24.013; } @Override From 6fa2b6d95826d2462b75afb1bdfa3c73b29e9af5 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 12:28:19 -0700 Subject: [PATCH 046/110] MOdified Pairing observation input forms to include category input fields. --- .../model/sources/Pairing_Properties.js | 15 ++-- .../dataentry/PairingFormSection.java | 16 +++- .../query/ONPRC_EHRTriggerHelper.java | 77 ------------------- 3 files changed, 21 insertions(+), 87 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index d1c456fea..686d17015 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -30,6 +30,13 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, + infant_id: { + xtype: 'onprc_ehr-paireddamdentryfield', + allowBlank: false, + columnConfig: { + width: 200 + } + }, eventtype: { columnConfig: { @@ -52,12 +59,8 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, endeventType: { - editorConfig: { - xtype: 'onprc_ehr-pairingcombo', - defaultSubset: 'pairing_endtype' - }, - columnConfig: { - width: 200 + lookup: { + sort: 'sort_order' } }, diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 8178240c9..37a84c692 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -15,6 +15,7 @@ */ package org.labkey.onprc_ehr.dataentry; +import org.labkey.api.ehr.EHRService; import org.labkey.api.ehr.dataentry.SimpleFormSection; import org.labkey.api.view.template.ClientDependency; @@ -29,10 +30,17 @@ public class PairingFormSection extends SimpleFormSection { public PairingFormSection() { - super("study", "pairings", "Pairing Observations", "ehr-gridpanel"); + super("study", "pairings", "Pairing Observations", "onprc_ehr-pairingobservationgridpanel"); setConfigSources(Collections.singletonList("Task")); - addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); - addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); - setClientStoreClass("EHR.data.PairingClientStore"); + + //Modified: 8-25-2025 R. Blasa No longer being used as search tool +// addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); +// addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); +// setClientStoreClass("EHR.data.PairingClientStore"); + + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); + + } } 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 8ee16c2dd..485bf5f33 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 @@ -2628,83 +2628,6 @@ public void exec(ResultSet object) throws SQLException } } - public void closeActivePairingsRecords(List> records) throws Exception - { - TableInfo housing = getTableInfo("study", "pairings"); - List> toUpdate = new ArrayList<>(); - List> oldKeys = new ArrayList<>(); - - - //sort on date - records = new ArrayList<>(records); - records.sort(new Comparator>() - { - @Override - public int compare(Map o1, Map o2) - { - try - { - Date date = dateTimeFormat.parse(o1.get("date").toString()); - Date date2 = dateTimeFormat.parse(o2.get("date").toString()); - - return date == null ? -1 : date.compareTo(date2); - } - catch (ParseException e) - { - return 0; - } - } - }); - - Set encounteredLsids = new HashSet<>(); - for (Map row : records) - { - Date date = dateTimeFormat.parse(row.get("date").toString()); - if (date.getHours() == 0 && date.getMinutes() == 0) - { - Exception e = new Exception(); - _log.error("Attempting to terminate study details records with a rounded date. This might indicate upstream code is rounding the date: " + dateTimeFormat.format(date), e); - } - - SimpleFilter filter = new SimpleFilter(FieldKey.fromString("Id"), row.get("Id")); - filter.addCondition(FieldKey.fromString("enddate"), null, CompareType.ISBLANK); - - //we want to only close those records starting prior to this record - filter.addCondition(FieldKey.fromString("date"), date, CompareType.LTE); - filter.addCondition(FieldKey.fromString("objectid"), row.get("objectid"), CompareType.NEQ_OR_NULL); - if (!encounteredLsids.isEmpty()) - { - filter.addCondition(FieldKey.fromString("lsid"), encounteredLsids, CompareType.NOT_IN); - } - - TableSelector ts = new TableSelector(housing, Collections.singleton("lsid"), filter, null); - List ret = ts.getArrayList(String.class); - if (!ret.isEmpty()) - { - encounteredLsids.addAll(ret); - for (String lsid : ret) - { - Map r = new CaseInsensitiveHashMap<>(); - r.put("lsid", lsid); - r.put("enddate", date); - toUpdate.add(r); - - Map keyMap = new CaseInsensitiveHashMap<>(); - keyMap.put("lsid", lsid); - oldKeys.add(keyMap); - } - } - } - - if (!toUpdate.isEmpty()) - { - _log.info("closing study pairing records: " + toUpdate.size()); - Map context = getExtraContext(); - context.put("skipAnnounceChangedParticipants", true); - housing.getUpdateService().updateRows(getUser(), getContainer(), toUpdate, oldKeys, null, context); - } - } - public void recalculateAllVetAssignmentRecords() { EHRDemographicsService.get().recalculateForAllIdsInCache(_container, "onprc_ehr", "vet_assignment", true); From e27a082c4d66e8da1adeea99f4efd48f9ce4bb9a Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 14:19:00 -0700 Subject: [PATCH 047/110] MOdified Pairing observation input forms to include category input fields. --- .../queries/study/CageMateAdults.sql | 2 +- .../queries/study/Pairings.query.xml | 25 +++++++------------ .../model/sources/Pairing_Properties.js | 2 +- .../dataentry/PairingFormSection.java | 6 ++--- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 2b7300089..14758b5c7 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id) as adultcagemate, + group_concat(h2.Id, '-') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index ea29634c4..c05bfdf62 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -16,7 +16,7 @@ Pair Id - This is used to identify the lowest cage number of the pair. It is used to determine which animals in the group are considered part of the pair. + Redesigned to generate cagemates Room @@ -35,19 +35,14 @@ Start Date - - false - Category + + Start Type - onprc_ehr - observation_types + ehr_lookups + PairingStartType value - - - - - Start Type + @@ -102,7 +97,6 @@ value - Observation @@ -111,18 +105,17 @@ value - Duration - + Computes the elaspse time between record date and current date + + End Remark 300 - Pair ID true - This field is used to differentiate pairs. By convention is should usually be the lowest cage number in the group; however, it does not need to match this diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 686d17015..7747c2d36 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -93,7 +93,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, lowestcage: { xtype: 'onprc_ehr-pairedidentryfield', - // header:'Other ID', + header:'Pair ID', columnConfig: { width: 200 } diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 37a84c692..ee51ddf87 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -34,9 +34,9 @@ public PairingFormSection() setConfigSources(Collections.singletonList("Task")); //Modified: 8-25-2025 R. Blasa No longer being used as search tool -// addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); -// addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); -// setClientStoreClass("EHR.data.PairingClientStore"); + addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); + addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); + setClientStoreClass("EHR.data.PairingClientStore"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); From fd1a722f69747499aee3db3ce874ea72470e2393 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 16:03:35 -0700 Subject: [PATCH 048/110] MOdified Pairing observation input forms to include category input fields. --- .../onprc_ehr/{panel => grid}/PairingObservationGridPanel.js | 2 +- .../src/org/labkey/onprc_ehr/dataentry/PairingFormType.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) rename onprc_ehr/resources/web/onprc_ehr/{panel => grid}/PairingObservationGridPanel.js (93%) diff --git a/onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js similarity index 93% rename from onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js rename to onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js index 899e3b11c..87c288617 100644 --- a/onprc_ehr/resources/web/onprc_ehr/panel/PairingObservationGridPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js @@ -11,7 +11,7 @@ Ext4.define('ONPRC_EHR.grid.PairingObservationGridPanel', { alias: 'widget.onprc_ehr-pairingbservationgridpanel', initComponent: function(){ - this.pairingobservationTypesStore = ONPRC.Utils.getpaiirngObservationTypesStore(); + this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); this.callParent(arguments); }, diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index 272b439e3..debbb490a 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -51,8 +51,6 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) //Added 6-7-2016 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/model/sources/Pairing_Properties.js")); - //Added 6-9-2025 R.Blasa - addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairingsCombo.js")); //Added 6-25-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedInfantEntryField.js")); From 31061dde2feea583d290c6a9156b53c818366dcc Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 18:11:42 -0700 Subject: [PATCH 049/110] MOdified Pairing observation input forms to include category input fields. --- .../resources/web/onprc_ehr/grid/PairingObservationGridPanel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js index 87c288617..dba4548d0 100644 --- a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js @@ -8,7 +8,7 @@ */ Ext4.define('ONPRC_EHR.grid.PairingObservationGridPanel', { extend: 'EHR.grid.Panel', - alias: 'widget.onprc_ehr-pairingbservationgridpanel', + alias: 'widget.onprc_ehr-pairingobservationgridpanel', initComponent: function(){ this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); From ee929cce708d1f75d101bfba70823b87e13e7cdb Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:35:30 -0700 Subject: [PATCH 050/110] MOdified Pairing observation input forms to include category input fields. --- .../queries/study/CageMateInfant.sql | 2 +- .../queries/study/Pairings.query.xml | 19 +++++++++++-------- onprc_ehr/resources/web/onprc_ehr/Utils.js | 2 +- .../grid/PairingObservationGridPanel.js | 2 +- .../model/sources/Pairing_Properties.js | 9 ++++++--- ...g.js => PairingObservationsCellEditing.js} | 0 .../dataentry/PairingFormSection.java | 6 +++--- 7 files changed, 23 insertions(+), 17 deletions(-) rename onprc_ehr/resources/web/onprc_ehr/plugin/{PairinglObservationsCellEditing.js => PairingObservationsCellEditing.js} (100%) diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 9866f7507..9354c962c 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,7 +1,7 @@ SELECT h1.Id, - group_concat(h2.Id) as infantcagemate, + group_concat(h2.Id, '-') as infantcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index c05bfdf62..58b1b8cd7 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -35,17 +35,20 @@ Start Date - - Start Type + + false + Category - ehr_lookups - PairingStartType + onprc_ehr + observation_types value - + + Start Type + - + false Prior Group Housing @@ -83,8 +86,8 @@ End Type - ehr_lookkups - pairingEndType + ehr_lookups + pairingendtypes value diff --git a/onprc_ehr/resources/web/onprc_ehr/Utils.js b/onprc_ehr/resources/web/onprc_ehr/Utils.js index 591cecc00..d89813870 100644 --- a/onprc_ehr/resources/web/onprc_ehr/Utils.js +++ b/onprc_ehr/resources/web/onprc_ehr/Utils.js @@ -53,7 +53,7 @@ ONPRC.Utils = new function(){ if (ONPRC_EHR._pairingobservationTypesStore) return ONPRC_EHR._pairingobservationTypesStore; - EHR._observationTypesStore = Ext4.create('LABKEY.ext4.data.Store', { + ONPRC_EHR._pairingobservationTypesStore = Ext4.create('LABKEY.ext4.data.Store', { type: 'labkey-store', schemaName: 'onprc_ehr', queryName: 'observation_types', diff --git a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js index dba4548d0..4ff9662d8 100644 --- a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js +++ b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js @@ -19,7 +19,7 @@ Ext4.define('ONPRC_EHR.grid.PairingObservationGridPanel', { getEditingPlugin: function(){ LDK.Assert.assertNotEmpty('this.pairingobservationTypesStore is null in PairingObservationsGridPanel', this.pairingobservationTypesStore); - return Ext4.create('ONPRC_EHR.grid.plugin.pairingObservationsCellEditing', { + return Ext4.create('ONPRC_EHR.grid.plugin.PairingObservationsCellEditing', { pluginId: this.editingPluginId, clicksToEdit: this.clicksToEdit, pairingobservationTypesStore: ONPRC.Utils.getpairingObservationTypesStore() diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 7747c2d36..5701e36f3 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -31,10 +31,10 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, infant_id: { - xtype: 'onprc_ehr-paireddamdentryfield', + xtype: 'onprc_ehr-pairedinfantentryfield', allowBlank: false, columnConfig: { - width: 200 + width: 120 } }, @@ -59,6 +59,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, endeventType: { + columnConfig: { + width: 180 + }, lookup: { sort: 'sort_order' } @@ -83,7 +86,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { observation: { allowBlank: true, columnConfig: { - width: 170 + width: 250 }, lookup: { filterArray: [ diff --git a/onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js b/onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js similarity index 100% rename from onprc_ehr/resources/web/onprc_ehr/plugin/PairinglObservationsCellEditing.js rename to onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index ee51ddf87..37a84c692 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -34,9 +34,9 @@ public PairingFormSection() setConfigSources(Collections.singletonList("Task")); //Modified: 8-25-2025 R. Blasa No longer being used as search tool - addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); - addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); - setClientStoreClass("EHR.data.PairingClientStore"); +// addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); +// addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); +// setClientStoreClass("EHR.data.PairingClientStore"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); From d73e0ca0e970434e49ee5bee5aac5f83d8e0377f Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 25 Aug 2025 20:39:48 -0700 Subject: [PATCH 051/110] MOdified Pairing observation input forms to include category input fields. --- .../labkey/onprc_ehr/dataentry/PairingFormSection.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 37a84c692..ed17cad6b 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -33,10 +33,10 @@ public PairingFormSection() super("study", "pairings", "Pairing Observations", "onprc_ehr-pairingobservationgridpanel"); setConfigSources(Collections.singletonList("Task")); - //Modified: 8-25-2025 R. Blasa No longer being used as search tool -// addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); -// addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); -// setClientStoreClass("EHR.data.PairingClientStore"); + + addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); + addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); + setClientStoreClass("EHR.data.PairingClientStore"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); From 7d93fa61e15e0600cdfe9c89fa5cd10d027c0c01 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 26 Aug 2025 08:36:47 -0700 Subject: [PATCH 052/110] MOdified Pairing observation input forms to include category input fields. --- .../web/onprc_ehr/data/PairingClientStore.js | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js diff --git a/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js b/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js new file mode 100644 index 000000000..2821904b4 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * + */ +Ext4.define('EHR.data.PairingClientStore', { + extend: 'EHR.data.DataEntryClientStore', + + constructor: function(){ + this.callParent(arguments); + this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); + + this.on('add', this.onAddRecord, this); + }, + + onAddRecord: function(store, records){ + Ext4.each(records, function(record){ + this.onRecordUpdate(record, ['lowestcage']); + }, this); + }, + + afterEdit: function(record, modifiedFieldNames){ + this.onRecordUpdate(record, modifiedFieldNames); + + this.callParent(arguments); + }, + + getCageMap: function(toSkip){ + var map = { + lowest: {}, + pairids: {} + }; + this.each(function(r){ + if (r == toSkip){ + return; + } + + var lowest; + if (r.get('lowestcage') && r.get('room')){ + lowest = this.getPairIdString(r); + } + + var pairid = r.get('pairid'); + + if (lowest && pairid){ + pairid = Ext4.String.trim(pairid.toLowerCase()); + lowest = Ext4.String.trim(lowest.toLowerCase()); + + //find discrepancies in either pairIds or lowestCages + if (!map.lowest[lowest]) + map.lowest[lowest] = pairid; + + if (pairid != map.lowest[lowest]){ + LDK.Assert.assertEquality('Mismatched pairIds for cage: ' + lowest, r.get('pairid'), map.lowest[lowest]); + + r.beginEdit(); + r.set('pairid', map.lowest[lowest]); + r.endEdit(true); + } + + if (!map.pairids[pairid]) + map.pairids[pairid] = lowest; + + if (lowest != map.pairids[pairid]){ + LDK.Assert.assertEquality('Mismatched pairIds for cage: ' + lowest, lowest, map.pairids[pairid]); + } + } + }, this); + + return map; + }, + + getPairIdString: function(record){ + return record.get('room') + '||' + record.get('lowestcage'); + }, + + onRecordUpdate: function(record, modifiedFieldNames){ + modifiedFieldNames = modifiedFieldNames || []; + var lowest; + if (record.get('lowestcage') && record.get('room')){ + lowest = this.getPairIdString(record); + } + + var pairid = record.get('pairid'); + if (pairid){ + pairid = Ext4.String.trim(pairid.toLowerCase()); + } + + var params = {}; + if (lowest){ + lowest = Ext4.String.trim(lowest.toLowerCase()); + var map = this.getCageMap(record); + + if (!pairid){ + if (map.lowest[lowest]) + params.pairid = map.lowest[lowest]; + else + params.pairid = LABKEY.Utils.generateUUID(); + } + else { + if (map.lowest[lowest] && map.lowest[lowest] != pairid) { + params.pairid = map.lowest[lowest]; + } + //verify we dont have a duplicate objectid + else if (map.pairids[pairid] && map.pairids[pairid] != pairid) { + //if the cage changed, assume we need to update the pairid + if (modifiedFieldNames.indexOf('lowestcage') > -1 || modifiedFieldNames.indexOf('room') > -1){ + params.pairid = LABKEY.Utils.generateUUID(); + } + } + } + } + else if (pairid && !lowest){ + params.pairid = null; + } + + if (!LABKEY.Utils.isEmptyObj(params)){ + record.beginEdit(); + record.set(params); + record.endEdit(true); + } + } +}); From 6f1a1a744ca3a1321bcd9dbc0dc1d2ea4e635886 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 26 Aug 2025 08:41:02 -0700 Subject: [PATCH 053/110] MOdified Pairing observation input forms to include category input fields. --- .../src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index ed17cad6b..9fc866609 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -35,7 +35,7 @@ public PairingFormSection() addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); - addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/data/PairingClientStore.js")); setClientStoreClass("EHR.data.PairingClientStore"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); From d19375c5e6ddac6559aa51e40c8e2cce3aada40c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 26 Aug 2025 08:42:01 -0700 Subject: [PATCH 054/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js b/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js index 2821904b4..35645f869 100644 --- a/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js +++ b/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js @@ -6,7 +6,7 @@ /** * */ -Ext4.define('EHR.data.PairingClientStore', { +Ext4.define('ONPRC_EHR.data.PairingClientStore', { extend: 'EHR.data.DataEntryClientStore', constructor: function(){ From f011357807c6316f0f2606c4dbebb42c412b7ee2 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 26 Aug 2025 18:14:18 -0700 Subject: [PATCH 055/110] MOdified Pairing observation input forms to include category input fields. --- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 5 +++++ .../org/labkey/onprc_ehr/dataentry/PairingFormSection.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 5701e36f3..fb3d1d4a6 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -39,6 +39,11 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, eventtype: { + lookup: { + filterArray: [ + LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) + ] + }, columnConfig: { width: 200 } diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 9fc866609..f64725e16 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -36,7 +36,7 @@ public PairingFormSection() addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/data/PairingClientStore.js")); - setClientStoreClass("EHR.data.PairingClientStore"); + setClientStoreClass("ONPRC_EHR.data.PairingClientStore"); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); From 64bdef49dec1b802765948321c397f4e44cf8c86 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 26 Aug 2025 23:25:35 -0700 Subject: [PATCH 056/110] MOdified Pairing observation input forms to include category input fields. --- .../queries/onprc_ehr/Pairingmenus.sql | 23 ------------------- .../model/sources/Pairing_Properties.js | 7 +----- .../dataentry/PairingFormSection.java | 1 - 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql diff --git a/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql b/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql deleted file mode 100644 index 61752eefa..000000000 --- a/onprc_ehr/resources/queries/onprc_ehr/Pairingmenus.sql +++ /dev/null @@ -1,23 +0,0 @@ --- Created: 7-29-2025 R.Blasa - -select value, - category - -from ehr_lookups.pairingstarttype -Where date_disabled is null - -union - -select value, - category - -from ehr_lookups.pairingendtypes -Where date_disabled is null - -union - -select value, - category - -from ehr_lookups.pairing_STF_clinical -Where date_disabled is null \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index fb3d1d4a6..0c20bfaf1 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -39,11 +39,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, eventtype: { - lookup: { - filterArray: [ - LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) - ] - }, columnConfig: { width: 200 } @@ -148,7 +143,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { })] }, lookup: { - columns: 'value,description' + columns: 'value' }, columnConfig: { width: 200 diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index f64725e16..a072cb093 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -15,7 +15,6 @@ */ package org.labkey.onprc_ehr.dataentry; -import org.labkey.api.ehr.EHRService; import org.labkey.api.ehr.dataentry.SimpleFormSection; import org.labkey.api.view.template.ClientDependency; From 739f72c05473f7332da40597f7c4ca0beff1644e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 27 Aug 2025 23:44:09 -0700 Subject: [PATCH 057/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 5 +++++ .../web/onprc_ehr/model/sources/Pairing_Properties.js | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 58b1b8cd7..b6ffecc94 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -46,6 +46,11 @@ Start Type + + ehr_lookups + pairingstarttypes + value + diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 0c20bfaf1..0c4a9accb 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -14,7 +14,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { 'study.pairings': { outcome: { - allowBlank: false, + allowBlank: true, columnConfig: { width: 160 }, @@ -32,7 +32,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, infant_id: { xtype: 'onprc_ehr-pairedinfantentryfield', - allowBlank: false, + allowBlank: true, columnConfig: { width: 120 } @@ -46,7 +46,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { goal: { - allowBlank: false, + allowBlank: true, header: 'Divider Goal', columnConfig: { width: 170 @@ -103,6 +103,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_IDs: { xtype: 'onprc_ehr-paireddamdentryfield', + allowBlank: true, header:'Other IDs', // should display the infant's dam columnConfig: { width: 200 @@ -151,6 +152,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, other_infant: { xtype: 'onprc_ehr-pairedinfantentryfield', + allowBlank: true, header: 'Other Infant ID', // should display the infant columnConfig: { width: 160 From 2a627aeef17e9e6b472ef1528cf9a2b749b76ce7 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 00:51:10 -0700 Subject: [PATCH 058/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/resources/queries/study/pairingSummary.sql | 1 + onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 1 + .../queries/study/pairingSummary/Dam Infant Pairing.qview.xml | 2 +- .../study/pairingSummary/Pairing Events with Comments.qview.xml | 1 + .../queries/study/pairingSummary/Pairing Events.qview.xml | 1 + onprc_ehr/resources/queries/study/pairingSummaryComments.sql | 1 + .../resources/queries/study/pairingSummaryComments/.qview.xml | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary.sql b/onprc_ehr/resources/queries/study/pairingSummary.sql index 37d20a178..e6301c832 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.sql +++ b/onprc_ehr/resources/queries/study/pairingSummary.sql @@ -22,6 +22,7 @@ SELECT p.room, p.cage, p.eventType, + (select j.category from ehr_lookups.pairingstarttype where j.value = p.eventype) as category p.goal, p.observation, p.outcome, diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index ed72dc87c..25cfe706c 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -8,6 +8,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index 094b33467..a3b6aff7e 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -7,11 +7,11 @@ + - diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index 2976275e9..91c6d51f5 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -7,6 +7,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index af1f40542..aa2486e84 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -7,6 +7,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql index 4e2204fea..69207c9be 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql @@ -7,6 +7,7 @@ SELECT p.room, p.cage, p.eventType, + (select j.category from ehr_lookups.pairingstarttype where j.value = p.eventype) as category p.goal, p.observation, p.outcome, diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml index f19f9408f..4b3e54330 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml @@ -6,6 +6,7 @@ + From 4e17cc266ee10f40cf6765cbf3529f1ebec73cdd Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 07:19:27 -0700 Subject: [PATCH 059/110] MOdified Pairing observation input forms to include category input fields. --- onprc_ehr/resources/queries/study/pairingSummary.sql | 3 ++- .../study/pairingSummary/Dam Infant Pairing.qview.xml | 2 +- .../pairingSummary/Pairing Events with Comments.qview.xml | 4 ++-- .../queries/study/pairingSummary/Pairing Events.qview.xml | 3 ++- .../resources/queries/study/pairingSummaryComments.sql | 3 ++- .../queries/study/pairingSummaryComments/.qview.xml | 3 ++- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 6 ++++++ 7 files changed, 17 insertions(+), 7 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary.sql b/onprc_ehr/resources/queries/study/pairingSummary.sql index e6301c832..0aa6ea922 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.sql +++ b/onprc_ehr/resources/queries/study/pairingSummary.sql @@ -18,11 +18,12 @@ SELECT (SELECT group_concat(distinct p2.Id, chr(10)) AS Ids FROM study.pairings p2 WHERE p.Id != p2.id AND p.pairId = p2.pairId) as otherIds, p.pairid, p.date, + (Select j.gender from study.demographics j where j.Id = p.Id) as sex, p.lowestCage, p.room, p.cage, p.eventType, - (select j.category from ehr_lookups.pairingstarttype where j.value = p.eventype) as category + p.category, p.goal, p.observation, p.outcome, diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index a3b6aff7e..657057727 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -1,11 +1,11 @@ + - diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index 91c6d51f5..41f258763 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -1,13 +1,13 @@ + - - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index aa2486e84..3acfae9d1 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -1,11 +1,12 @@ + - + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql index 69207c9be..0cd086d0d 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql @@ -3,11 +3,12 @@ SELECT (SELECT group_concat(distinct p2.Id, chr(10)) AS Ids FROM study.pairings p2 WHERE p.Id != p2.id AND p.pairId = p2.pairId) as otherIds, p.pairid, p.date, + (Select j.gender from study.demographics j where j.Id = p.Id) as sex, p.lowestCage, p.room, p.cage, p.eventType, - (select j.category from ehr_lookups.pairingstarttype where j.value = p.eventype) as category + p.category, p.goal, p.observation, p.outcome, diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml index 4b3e54330..e40818d78 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml @@ -1,12 +1,13 @@ + - + diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 0c4a9accb..17b8d6507 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -121,6 +121,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 130 } }, + cage: { + allowBlank: false, + columnConfig: { + width: 100 + } + }, prior_group_housing: { allowBlank: true, columnConfig: { From bcf04c7bc9b182579f5f9f2e4c2550cca476964e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:07:42 -0700 Subject: [PATCH 060/110] MOdified Pairing observation input forms to include category input fields. --- .../queries/study/CageMateAdults.sql | 3 +- .../resources/queries/study/CageMateAll.sql | 37 +++++++++ .../queries/study/CageMateAll/.qview.xml | 5 ++ .../queries/study/Pairings.query.xml | 5 +- .../form/field/PairedAdultsEntryField.js | 77 +++++++++++++++++++ .../form/field/PairedIDEntryField.js | 2 +- .../model/sources/Pairing_Properties.js | 17 ++-- .../onprc_ehr/dataentry/PairingFormType.java | 4 +- 8 files changed, 130 insertions(+), 20 deletions(-) create mode 100644 onprc_ehr/resources/queries/study/CageMateAll.sql create mode 100644 onprc_ehr/resources/queries/study/CageMateAll/.qview.xml create mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 14758b5c7..17ffe1280 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -29,7 +29,8 @@ FROM study.demographicsCurrentLocation h1 ) WHERE - h1.room.housingType.value = 'Cage Location' + h1.room.housingType.value = 'Cage Location' AND + h2.Id.age.ageInyears > 1 GROUP BY h1.Id diff --git a/onprc_ehr/resources/queries/study/CageMateAll.sql b/onprc_ehr/resources/queries/study/CageMateAll.sql new file mode 100644 index 000000000..14758b5c7 --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateAll.sql @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2017 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT + + h1.Id, + group_concat(h2.Id, '-') as adultcagemate, + group_Concat(distinct h2.room) as room, + group_concat(distinct h1.cage) as cage + +FROM study.demographicsCurrentLocation h1 + JOIN study.demographicsCurrentLocation h2 ON ( + h1.room = h2.room AND + h1.cage = h2.cage + + ) + +WHERE + h1.room.housingType.value = 'Cage Location' + + +GROUP BY h1.Id + + diff --git a/onprc_ehr/resources/queries/study/CageMateAll/.qview.xml b/onprc_ehr/resources/queries/study/CageMateAll/.qview.xml new file mode 100644 index 000000000..0f45185ae --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateAll/.qview.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index b6ffecc94..cad82cb79 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -113,10 +113,7 @@ value - - Duration - Computes the elaspse time between record date and current date - + End Remark 300 diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js new file mode 100644 index 000000000..f12a6b584 --- /dev/null +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2013-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ + +Ext4.define('ONPRC_EHR.form.field.PairedAdultsEntryField', { + extend: 'LABKEY.ext4.ComboBox', + alias: 'widget.onprc_ehr-pairedadultentryfield', + + + trigger1Cls: 'x4-form-search-trigger', + + initComponent: function(){ + this.callParent(arguments); + }, + + onTrigger1Click: function(){ + var rec = EHR.DataEntryUtils.getBoundRecord(this); + if (!rec){ + Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); + return; + } + + if (!rec || !rec.get('room')){ + Ext4.Msg.alert('Error', 'No room Entered'); + return; + } + if (!rec || !rec.get('cage')){ + Ext4.Msg.alert('Error', 'No cage Entered'); + return; + } + Ext4.Msg.wait('Loading...'); + + + this.queryValue(rec, function(ret){ + Ext4.Msg.hide(); + + if (ret && ret.adultcagemate){ + this.setValue(ret.adultcagemate); + } + + + }, true); + }, + + queryValue: function(rec, cb, alwaysUseCallback){ + var id = rec.get('other_infant'); + + LABKEY.Query.selectRows({ + schemaName: 'study', + queryName: 'CageMatesAdults', + columns: 'adultcagemate', + sort:'Id', + filterArray: [ + LABKEY.Filter.create('room', roomt , LABKEY.Filter.Types.EQUAL), + LABKEY.Filter.create('cage', caget , LABKEY.Filter.Types.EQUAL) + ], + failure: LDK.Utils.getErrorCallback(), + scope: this, + success: function(results){ + if (!alwaysUseCallback && id != this.pendingIdRequest){ + console.log('more recent request, aborting'); + return; + } + + if (results && results.rows && results.rows.length){ + cb.call(this, results.rows[0], results.rows[0].Id); + } + else { + cb.call(this, null, id); + } + } + }); + } + +}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js index e98edddf8..45099d380 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedIDEntryField.js @@ -50,7 +50,7 @@ Ext4.define('ONPRC_EHR.form.field.PairedIDEntryField', { LABKEY.Query.selectRows({ schemaName: 'study', - queryName: 'CageMateAdults', + queryName: 'CageMateAll', columns: 'adultcagemate', sort:'Id', filterArray: [ diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 17b8d6507..343a92ca4 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -63,7 +63,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 180 }, lookup: { - sort: 'sort_order' + filterArray: [ + LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) + ] } }, @@ -102,9 +104,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, other_IDs: { - xtype: 'onprc_ehr-paireddamdentryfield', + xtype: 'onprc_ehr-pairedadultentryfield', allowBlank: true, - header:'Other IDs', // should display the infant's dam + header:'Other IDs', // should display just adults, and not infants columnConfig: { width: 200 } @@ -133,15 +135,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, - - duration: { - xtype: 'onprc_ehr-durationentryfield', - allowBlank:true, - columnConfig: { - width: 100 - } - }, - category: { allowBlank: false, editorConfig: { diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java index debbb490a..19b877428 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormType.java @@ -62,8 +62,8 @@ public PairingFormType(DataEntryFormContext ctx, Module owner) //Added 7-1-2025 R.Blasa addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedIDEntryField.js")); - //Added 8-5-2025 R.Blasa - addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedDamEntryField.js")); + //Added 8-29-2025 R.Blasa + addClientDependency(ClientDependency.supplierFromPath("/onprc_ehr/form/field/PairedAdultsEntryField.js")); From 8819daae66e4f1f4eb4635e619759d695056718f Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:22:14 -0700 Subject: [PATCH 061/110] MOdified Pairing observation input forms to include category input fields. --- .../web/onprc_ehr/form/field/PairedAdultsEntryField.js | 2 +- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js index f12a6b584..22dcdb378 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js @@ -6,7 +6,7 @@ Ext4.define('ONPRC_EHR.form.field.PairedAdultsEntryField', { extend: 'LABKEY.ext4.ComboBox', - alias: 'widget.onprc_ehr-pairedadultentryfield', + alias: 'widget.onprc_ehr-pairedadultsentryfield', trigger1Cls: 'x4-form-search-trigger', diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 343a92ca4..060524d83 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -100,11 +100,11 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { xtype: 'onprc_ehr-pairedidentryfield', header:'Pair ID', columnConfig: { - width: 200 + width: 250 } }, other_IDs: { - xtype: 'onprc_ehr-pairedadultentryfield', + xtype: 'onprc_ehr-pairedadultsentryfield', allowBlank: true, header:'Other IDs', // should display just adults, and not infants columnConfig: { From e2bf92706b6ada58f5f8deb281e23dde9c61532b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:33:45 -0700 Subject: [PATCH 062/110] MOdified Pairing observation input forms to include category input fields. --- .../web/onprc_ehr/form/field/PairedAdultsEntryField.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js index 22dcdb378..b7d506c24 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js @@ -45,7 +45,8 @@ Ext4.define('ONPRC_EHR.form.field.PairedAdultsEntryField', { }, queryValue: function(rec, cb, alwaysUseCallback){ - var id = rec.get('other_infant'); + var roomt = rec.get('room'); + var caget = rec.get('cage'); LABKEY.Query.selectRows({ schemaName: 'study', From ac5567b679f62c69dac963beb21b1d1bd4cbe56c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 29 Aug 2025 10:39:08 -0700 Subject: [PATCH 063/110] MOdified Pairing observation input forms to include category input fields. --- .../web/onprc_ehr/form/field/PairedAdultsEntryField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js index b7d506c24..ac76c5625 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedAdultsEntryField.js @@ -50,7 +50,7 @@ Ext4.define('ONPRC_EHR.form.field.PairedAdultsEntryField', { LABKEY.Query.selectRows({ schemaName: 'study', - queryName: 'CageMatesAdults', + queryName: 'CageMateAdults', columns: 'adultcagemate', sort:'Id', filterArray: [ From 77f4bcd9890213c7274dd3133f39c303aaf1eb36 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 4 Sep 2025 18:45:37 -0700 Subject: [PATCH 064/110] Modified Pairing Observation to remove referencing files --- .../resources/queries/study/Pairings.query.xml | 10 +++++----- .../model/sources/Pairing_Properties.js | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index cad82cb79..f8d645dd8 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -56,11 +56,11 @@ false Prior Group Housing - - ehr_lookups - pairingpriorgroups - value - + + ehr_lookups + pairingpriorgroups + value + diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 060524d83..7a70a1291 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -39,7 +39,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, eventtype: { - columnConfig: { + columnConfig: { width: 200 } }, @@ -97,12 +97,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, lowestcage: { - xtype: 'onprc_ehr-pairedidentryfield', - header:'Pair ID', - columnConfig: { + xtype: 'onprc_ehr-pairedidentryfield', + header:'Pair ID', + columnConfig: { width: 250 - } - }, + } + }, other_IDs: { xtype: 'onprc_ehr-pairedadultsentryfield', allowBlank: true, @@ -122,7 +122,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { columnConfig: { width: 130 } - }, + }, cage: { allowBlank: false, columnConfig: { @@ -162,9 +162,9 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { columnConfig: { width: 200 } - } + } - } + } } }); \ No newline at end of file From 2f5fa75544197c7bbf31d6b698e380c927c4fba5 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:19:04 -0700 Subject: [PATCH 065/110] Modified Pairing Observation to remove referencing files --- .../queries/ehr_lookups/pairingeventsAll.sql | 49 +++++++++++++++++++ .../model/sources/Pairing_Properties.js | 24 ++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql diff --git a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql new file mode 100644 index 000000000..16c1de2d7 --- /dev/null +++ b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql @@ -0,0 +1,49 @@ +select + value, + category, + sort_order, + date_disabled + +from ehr_lookups.pairingdividerchange + +union all + +select + value, + category, + sort_order, + date_disabled + +from ehr_lookups.pairingEventType + +union all + +select + value, + category, + sort_order, + date_disabled + +from ehr_lookups.pairing_infant_related + +union all + +select + value, + category, + sort_order, + date_disabled + +from ehr_lookups.pairing_STF_Beh + +union all + +select + value, + category, + sort_order, + date_disabled + +from ehr_lookups.pairing_STF_clinical + +order by category, value, sort_order \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 7a70a1291..92c4b2de6 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -40,7 +40,29 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { eventtype: { columnConfig: { - width: 200 + width: 250 + }, + editorConfig: { + caseSensitive: false, + anyMatch: true, + listConfig: { + innerTpl: '{[(values.category ? "" + LABKEY.Utils.encodeHtml(values.category) + ": " : "") + LABKEY.Utils.encodeHtml(values.value)]}', + getInnerTpl: function () { + return this.innerTpl; + } + } + }, + lookup: { + xtype: 'combobox', + schemaName: 'ehr_Lookups', + queryName: 'pairingeventsAll', + columns: 'value,category,sort_order,date_disabled', + keyColumn: 'value', + displayColumn: 'value', + sort: 'category,value,sort_order', + filterArray: [ + LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) + ] } }, From bd88ac15b2ca51e69b12ba7cb66f6273b056ed26 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 4 Sep 2025 19:59:35 -0700 Subject: [PATCH 066/110] Modified Pairing Observation to remove referencing files --- .../onprc_ehr/model/sources/Pairing_Properties.js | 8 -------- .../onprc_ehr/dataentry/PairingFormSection.java | 13 +++---------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 92c4b2de6..c25a6ecea 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -159,14 +159,6 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { }, category: { allowBlank: false, - editorConfig: { - plugins: [Ext4.create('LDK.plugin.UserEditableCombo', { - allowChooseOther: false - })] - }, - lookup: { - columns: 'value' - }, columnConfig: { width: 200 } diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index a072cb093..8178240c9 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -29,17 +29,10 @@ public class PairingFormSection extends SimpleFormSection { public PairingFormSection() { - super("study", "pairings", "Pairing Observations", "onprc_ehr-pairingobservationgridpanel"); + super("study", "pairings", "Pairing Observations", "ehr-gridpanel"); setConfigSources(Collections.singletonList("Task")); - - addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); - addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/data/PairingClientStore.js")); - setClientStoreClass("ONPRC_EHR.data.PairingClientStore"); - - addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/plugin/PairingObservationsCellEditing.js")); - addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/grid/PairingObservationGridPanel.js")); - - + addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); + setClientStoreClass("EHR.data.PairingClientStore"); } } From 64a906bf69c938030d130130bb3057e0dad59fee Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 4 Sep 2025 20:03:18 -0700 Subject: [PATCH 067/110] Modified Pairing Observation to remove referencing files --- .../web/onprc_ehr/data/PairingClientStore.js | 126 ------------------ 1 file changed, 126 deletions(-) delete mode 100644 onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js diff --git a/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js b/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js deleted file mode 100644 index 35645f869..000000000 --- a/onprc_ehr/resources/web/onprc_ehr/data/PairingClientStore.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2013-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ -/** - * - */ -Ext4.define('ONPRC_EHR.data.PairingClientStore', { - extend: 'EHR.data.DataEntryClientStore', - - constructor: function(){ - this.callParent(arguments); - this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); - - this.on('add', this.onAddRecord, this); - }, - - onAddRecord: function(store, records){ - Ext4.each(records, function(record){ - this.onRecordUpdate(record, ['lowestcage']); - }, this); - }, - - afterEdit: function(record, modifiedFieldNames){ - this.onRecordUpdate(record, modifiedFieldNames); - - this.callParent(arguments); - }, - - getCageMap: function(toSkip){ - var map = { - lowest: {}, - pairids: {} - }; - this.each(function(r){ - if (r == toSkip){ - return; - } - - var lowest; - if (r.get('lowestcage') && r.get('room')){ - lowest = this.getPairIdString(r); - } - - var pairid = r.get('pairid'); - - if (lowest && pairid){ - pairid = Ext4.String.trim(pairid.toLowerCase()); - lowest = Ext4.String.trim(lowest.toLowerCase()); - - //find discrepancies in either pairIds or lowestCages - if (!map.lowest[lowest]) - map.lowest[lowest] = pairid; - - if (pairid != map.lowest[lowest]){ - LDK.Assert.assertEquality('Mismatched pairIds for cage: ' + lowest, r.get('pairid'), map.lowest[lowest]); - - r.beginEdit(); - r.set('pairid', map.lowest[lowest]); - r.endEdit(true); - } - - if (!map.pairids[pairid]) - map.pairids[pairid] = lowest; - - if (lowest != map.pairids[pairid]){ - LDK.Assert.assertEquality('Mismatched pairIds for cage: ' + lowest, lowest, map.pairids[pairid]); - } - } - }, this); - - return map; - }, - - getPairIdString: function(record){ - return record.get('room') + '||' + record.get('lowestcage'); - }, - - onRecordUpdate: function(record, modifiedFieldNames){ - modifiedFieldNames = modifiedFieldNames || []; - var lowest; - if (record.get('lowestcage') && record.get('room')){ - lowest = this.getPairIdString(record); - } - - var pairid = record.get('pairid'); - if (pairid){ - pairid = Ext4.String.trim(pairid.toLowerCase()); - } - - var params = {}; - if (lowest){ - lowest = Ext4.String.trim(lowest.toLowerCase()); - var map = this.getCageMap(record); - - if (!pairid){ - if (map.lowest[lowest]) - params.pairid = map.lowest[lowest]; - else - params.pairid = LABKEY.Utils.generateUUID(); - } - else { - if (map.lowest[lowest] && map.lowest[lowest] != pairid) { - params.pairid = map.lowest[lowest]; - } - //verify we dont have a duplicate objectid - else if (map.pairids[pairid] && map.pairids[pairid] != pairid) { - //if the cage changed, assume we need to update the pairid - if (modifiedFieldNames.indexOf('lowestcage') > -1 || modifiedFieldNames.indexOf('room') > -1){ - params.pairid = LABKEY.Utils.generateUUID(); - } - } - } - } - else if (pairid && !lowest){ - params.pairid = null; - } - - if (!LABKEY.Utils.isEmptyObj(params)){ - record.beginEdit(); - record.set(params); - record.endEdit(true); - } - } -}); From 1434a12b349ca3947aa746a440d8d21068ed5526 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 5 Sep 2025 10:27:43 -0700 Subject: [PATCH 068/110] Modified Pairing Observation to remove referencing files --- onprc_ehr/resources/queries/study/CageMateAdults.sql | 2 +- onprc_ehr/resources/queries/study/CageMateAll.sql | 2 +- onprc_ehr/resources/queries/study/CageMateInfant.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 17ffe1280..eb844cc81 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id, '-') as adultcagemate, + group_concat(h2.Id, ' ') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/CageMateAll.sql b/onprc_ehr/resources/queries/study/CageMateAll.sql index 14758b5c7..86c1edd89 100644 --- a/onprc_ehr/resources/queries/study/CageMateAll.sql +++ b/onprc_ehr/resources/queries/study/CageMateAll.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id, '-') as adultcagemate, + group_concat(h2.Id, ' ') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 9354c962c..efac4f73a 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,7 +1,7 @@ SELECT h1.Id, - group_concat(h2.Id, '-') as infantcagemate, + group_concat(h2.Id, ' ') as infantcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage From 94b6acec45ec3e773343728a612172e344abc929 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:57:14 -0700 Subject: [PATCH 069/110] Modified Pairing Observation to remove referencing files --- onprc_ehr/resources/queries/study/CageMateAll.sql | 2 +- onprc_ehr/resources/queries/study/CageMateInfant.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAll.sql b/onprc_ehr/resources/queries/study/CageMateAll.sql index 86c1edd89..14758b5c7 100644 --- a/onprc_ehr/resources/queries/study/CageMateAll.sql +++ b/onprc_ehr/resources/queries/study/CageMateAll.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id, ' ') as adultcagemate, + group_concat(h2.Id, '-') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index efac4f73a..9354c962c 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,7 +1,7 @@ SELECT h1.Id, - group_concat(h2.Id, ' ') as infantcagemate, + group_concat(h2.Id, '-') as infantcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage From f15591b254a78637b228bfd59158d987a8dccbae Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:43:27 -0700 Subject: [PATCH 070/110] Modified Pairing Observation xml definition. --- onprc_ehr/resources/schemas/onprc_ehr.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/onprc_ehr/resources/schemas/onprc_ehr.xml b/onprc_ehr/resources/schemas/onprc_ehr.xml index e229bcf9b..46e226ba0 100644 --- a/onprc_ehr/resources/schemas/onprc_ehr.xml +++ b/onprc_ehr/resources/schemas/onprc_ehr.xml @@ -1454,4 +1454,21 @@ + + + + + + + + + + + + + + + +
+ From 45f653d2eca48f3eed28bbc6cd41b38b9d1f0fa9 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Sat, 6 Sep 2025 09:11:45 -0700 Subject: [PATCH 071/110] Modified Pairing Observation input form to include new input fields. --- .../study/datasets/datasets_metadata.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml index 207115969..b15d94dde 100644 --- a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -2338,6 +2338,18 @@ varchar + + varchar + + + varchar + + + varchar + + + varchar + integer urn:ehr.labkey.org/#Project From 4398c525c3a0c47b850ff2023a42f1f3467b39f4 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 8 Sep 2025 11:11:06 -0700 Subject: [PATCH 072/110] Modified program to allow category to appear on a drop down listings. --- .../ehr_lookups/pairingeventsAll.query.xml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml diff --git a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml new file mode 100644 index 000000000..01c4abbf6 --- /dev/null +++ b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml @@ -0,0 +1,20 @@ + + + + + Procedure Names + + + true + + + + + + + + +
+
+
+
From 746c978b380194432d769e054d4145992d035f40 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:21:17 -0700 Subject: [PATCH 073/110] Modified program to allow category to appear on a drop down listings. --- .../queries/ehr_lookups/pairingeventsAll.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql index 16c1de2d7..06c624132 100644 --- a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql +++ b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql @@ -1,12 +1,12 @@ -select - value, - category, - sort_order, - date_disabled - -from ehr_lookups.pairingdividerchange - -union all +-- select +-- value, +-- category, +-- sort_order, +-- date_disabled +-- +-- from ehr_lookups.pairingdividerchange +-- +-- union all select value, From e32854dbd46fe71c17f8e43106bd8869a795462b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 8 Sep 2025 18:00:17 -0700 Subject: [PATCH 074/110] Modified program to allow category to appear on a drop down listings. --- .../ehr_lookups/pairingeventsAll.query.xml | 20 -------- .../queries/ehr_lookups/pairingeventsAll.sql | 49 ------------------- .../model/sources/Pairing_Properties.js | 2 +- 3 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml delete mode 100644 onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql diff --git a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml deleted file mode 100644 index 01c4abbf6..000000000 --- a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.query.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - Procedure Names - - - true - - - - - - - - -
-
-
-
diff --git a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql b/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql deleted file mode 100644 index 06c624132..000000000 --- a/onprc_ehr/resources/queries/ehr_lookups/pairingeventsAll.sql +++ /dev/null @@ -1,49 +0,0 @@ --- select --- value, --- category, --- sort_order, --- date_disabled --- --- from ehr_lookups.pairingdividerchange --- --- union all - -select - value, - category, - sort_order, - date_disabled - -from ehr_lookups.pairingEventType - -union all - -select - value, - category, - sort_order, - date_disabled - -from ehr_lookups.pairing_infant_related - -union all - -select - value, - category, - sort_order, - date_disabled - -from ehr_lookups.pairing_STF_Beh - -union all - -select - value, - category, - sort_order, - date_disabled - -from ehr_lookups.pairing_STF_clinical - -order by category, value, sort_order \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index c25a6ecea..5f0e6f0b1 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -55,7 +55,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { lookup: { xtype: 'combobox', schemaName: 'ehr_Lookups', - queryName: 'pairingeventsAll', + queryName: 'pairingstarttype', columns: 'value,category,sort_order,date_disabled', keyColumn: 'value', displayColumn: 'value', From bf8b70badaf9d063092044319df78fa4ea6202c2 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:00:15 -0700 Subject: [PATCH 075/110] Modified program to allow category to appear on a drop down listings. --- .../dataentry/BehaviorRoundsObservationsFormSection.java | 4 ++-- .../org/labkey/onprc_ehr/dataentry/PairingFormSection.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java index 399a70462..e082cf1fa 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java @@ -34,14 +34,14 @@ public BehaviorRoundsObservationsFormSection() addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddClinicalCasesWindow.js")); addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddSurgicalCasesWindow.js")); - addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddBehaviorCasesWindow.js")); + addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/AddBehaviorCasesWindow.js")); } @Override public List getTbarButtons() { List defaultButtons = super.getTbarButtons(); - defaultButtons.add(0, "ADDBEHAVIORCASES"); + defaultButtons.add(0, "ADDBEHAVIORCASESAMENDED"); return defaultButtons; } diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 8178240c9..1942c79c8 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -31,8 +31,6 @@ public PairingFormSection() { super("study", "pairings", "Pairing Observations", "ehr-gridpanel"); setConfigSources(Collections.singletonList("Task")); - addClientDependency(ClientDependency.supplierFromPath("ehr/form/field/LowestCageField.js")); - addClientDependency(ClientDependency.supplierFromPath("ehr/data/PairingClientStore.js")); - setClientStoreClass("EHR.data.PairingClientStore"); + } } From 62900f2d9b672eda241565f2ea597ba79cbda573 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:20:33 -0700 Subject: [PATCH 076/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/pairingSummary.sql | 5 ++++- onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 2 ++ .../pairingSummary/Pairing Events with Comments.qview.xml | 2 ++ .../queries/study/pairingSummary/Pairing Events.qview.xml | 2 ++ onprc_ehr/resources/queries/study/pairingSummaryComments.sql | 5 ++++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary.sql b/onprc_ehr/resources/queries/study/pairingSummary.sql index 0aa6ea922..3afae08d8 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.sql +++ b/onprc_ehr/resources/queries/study/pairingSummary.sql @@ -36,7 +36,10 @@ SELECT p.taskid, TIMESTAMPDIFF('SQL_TSI_DAY', p.date, coalesce(p.enddate,curdate())) as duration, p.qcstate, - p.lsid + p.lsid, + p.other_IDs, + p.other_infant, + p.infant_id FROM study.pairings p diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index 25cfe706c..6a0a926fe 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -1,9 +1,11 @@ + + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index 41f258763..ba85265e2 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -2,9 +2,11 @@ + + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index 3acfae9d1..89344a4d0 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -2,9 +2,11 @@ + + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql index 0cd086d0d..2dd563143 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql @@ -21,7 +21,10 @@ SELECT p.taskid, TIMESTAMPDIFF('SQL_TSI_DAY', p.date, coalesce(p.enddate,curdate())) as duration, p.qcstate, - p.lsid + p.lsid, + p.other_IDs, + p.other_infant, + p.infant_id FROM study.pairings p where p.eventtype in ('General Comment', 'Pair monitor') \ No newline at end of file From 2c41199df2f6ac3c9d5065baa611d91961511dc6 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:26:01 -0700 Subject: [PATCH 077/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/CageMateAdults.sql | 2 +- .../queries/study/pairingSummary/Dam Infant Pairing.qview.xml | 3 ++- .../pairingSummary/Pairing Events with Comments.qview.xml | 1 - .../queries/study/pairingSummary/Pairing Events.qview.xml | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index eb844cc81..17ffe1280 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id, ' ') as adultcagemate, + group_concat(h2.Id, '-') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index 657057727..c1a6cbaf1 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -1,10 +1,11 @@ - + + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index ba85265e2..ce4371bfc 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -1,7 +1,6 @@ - diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index 89344a4d0..96cb15ca0 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -1,7 +1,6 @@ - From 08d37f624e40b92034e1b8758f8d5ec8e9e5203e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:44:20 -0700 Subject: [PATCH 078/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 2 +- .../queries/study/pairingSummary/Dam Infant Pairing.qview.xml | 2 +- .../study/pairingSummary/Pairing Events with Comments.qview.xml | 2 +- .../queries/study/pairingSummary/Pairing Events.qview.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index 6a0a926fe..a12f81203 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index c1a6cbaf1..52b7cf976 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index ce4371bfc..03ebfa778 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index 96cb15ca0..b800a66dd 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -4,7 +4,7 @@ - + From 4d2d8f022f09f6c649251ba22ae59f8564e0f0e8 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:52:51 -0700 Subject: [PATCH 079/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/CageMateAdults.sql | 2 +- onprc_ehr/resources/queries/study/pairingSummary.sql | 3 ++- onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 1 + .../queries/study/pairingSummary/Dam Infant Pairing.qview.xml | 1 + .../pairingSummary/Pairing Events with Comments.qview.xml | 1 + onprc_ehr/resources/queries/study/pairingSummaryComments.sql | 3 ++- 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/queries/study/CageMateAdults.sql b/onprc_ehr/resources/queries/study/CageMateAdults.sql index 17ffe1280..eb844cc81 100644 --- a/onprc_ehr/resources/queries/study/CageMateAdults.sql +++ b/onprc_ehr/resources/queries/study/CageMateAdults.sql @@ -17,7 +17,7 @@ SELECT h1.Id, - group_concat(h2.Id, '-') as adultcagemate, + group_concat(h2.Id, ' ') as adultcagemate, group_Concat(distinct h2.room) as room, group_concat(distinct h1.cage) as cage diff --git a/onprc_ehr/resources/queries/study/pairingSummary.sql b/onprc_ehr/resources/queries/study/pairingSummary.sql index 3afae08d8..27e856f10 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.sql +++ b/onprc_ehr/resources/queries/study/pairingSummary.sql @@ -39,7 +39,8 @@ SELECT p.lsid, p.other_IDs, p.other_infant, - p.infant_id + p.infant_id, + p.housingtype FROM study.pairings p diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index a12f81203..f34f02ffa 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -19,6 +19,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index 52b7cf976..e74731496 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -15,6 +15,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index 03ebfa778..ae6eab639 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -15,6 +15,7 @@ + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql index 2dd563143..b919e01a6 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.sql +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.sql @@ -24,7 +24,8 @@ SELECT p.lsid, p.other_IDs, p.other_infant, - p.infant_id + p.infant_id, + p.housingtype FROM study.pairings p where p.eventtype in ('General Comment', 'Pair monitor') \ No newline at end of file From 1ea36cd9a1238caaa2f0d6bfc3ff210cdb2c8821 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 08:58:57 -0700 Subject: [PATCH 080/110] Modified program to allow category to appear on a drop down listings. --- .../queries/study/pairingSummary/Pairing Events.qview.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index b800a66dd..2bcd396c5 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -16,6 +16,7 @@ + From 7dfe83e04165f1823d0df4d89065814d8e42c805 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 09:04:22 -0700 Subject: [PATCH 081/110] Modified program to allow category to appear on a drop down listings. --- .../resources/queries/study/pairingSummary.query.xml | 10 ++++++++-- .../queries/study/pairingSummaryComments.query.xml | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary.query.xml b/onprc_ehr/resources/queries/study/pairingSummary.query.xml index 36e844f38..d54f9c7c6 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.query.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary.query.xml @@ -22,15 +22,21 @@ - - Other Ids + + Other IDs + + + + + + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml index bd47f064e..d01a19404 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml @@ -22,15 +22,21 @@ - - Other Ids + + Other IDs + + + + + + From c46c8b9c19f3af3c19f60a78863c9e9b1b52437a Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 09:28:03 -0700 Subject: [PATCH 082/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/pairingSummary.query.xml | 2 ++ onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 2 +- .../queries/study/pairingSummary/Dam Infant Pairing.qview.xml | 2 +- .../study/pairingSummary/Pairing Events with Comments.qview.xml | 2 +- .../queries/study/pairingSummary/Pairing Events.qview.xml | 2 +- .../resources/queries/study/pairingSummaryComments.query.xml | 2 ++ 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary.query.xml b/onprc_ehr/resources/queries/study/pairingSummary.query.xml index d54f9c7c6..cdc2aa115 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary.query.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary.query.xml @@ -12,6 +12,8 @@ + + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index f34f02ffa..54f8e9bdb 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml index e74731496..ea7a4b92a 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Dam Infant Pairing.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml index ae6eab639..e41aaa7d5 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events with Comments.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml index 2bcd396c5..d4242ae8e 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/Pairing Events.qview.xml @@ -4,7 +4,7 @@ - + diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml index d01a19404..4243a01d8 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments.query.xml @@ -20,6 +20,8 @@ + + From 14b64a253b970e549a631d38b5a5341ccd47952d Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 09:37:44 -0700 Subject: [PATCH 083/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index f8d645dd8..ffec92b53 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -48,7 +48,7 @@ Start Type ehr_lookups - pairingstarttypes + pairingstarttype value From 6c1ca512b679d556e89f165f80bb4dffb38b8925 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 09:52:37 -0700 Subject: [PATCH 084/110] Modified program to allow category to appear on a drop down listings. --- .../resources/web/onprc_ehr/model/sources/Pairing_Properties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index 5f0e6f0b1..ad093f066 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -151,7 +151,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 100 } }, - prior_group_housing: { + housingtype: { allowBlank: true, columnConfig: { width: 100 From 162d67e0a78399b8b34f0e497a41332416d1d986 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:07:05 -0700 Subject: [PATCH 085/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/pairingSummary/.qview.xml | 2 -- .../resources/queries/study/pairingSummaryComments/.qview.xml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml index 54f8e9bdb..c981d488f 100644 --- a/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummary/.qview.xml @@ -15,8 +15,6 @@ - - diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml index e40818d78..5a2c8e82b 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml @@ -1,10 +1,11 @@ - + + @@ -13,7 +14,6 @@ - From 160542df6d53aeb69f0c7a8e0c61526c4a834f70 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:12:20 -0700 Subject: [PATCH 086/110] Modified program to allow category to appear on a drop down listings. --- .../dataentry/BehaviorRoundsObservationsFormSection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java index e082cf1fa..399a70462 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/BehaviorRoundsObservationsFormSection.java @@ -34,14 +34,14 @@ public BehaviorRoundsObservationsFormSection() addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddClinicalCasesWindow.js")); addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddSurgicalCasesWindow.js")); - addClientDependency(ClientDependency.supplierFromPath("onprc_ehr/window/AddBehaviorCasesWindow.js")); + addClientDependency(ClientDependency.supplierFromPath("ehr/window/AddBehaviorCasesWindow.js")); } @Override public List getTbarButtons() { List defaultButtons = super.getTbarButtons(); - defaultButtons.add(0, "ADDBEHAVIORCASESAMENDED"); + defaultButtons.add(0, "ADDBEHAVIORCASES"); return defaultButtons; } From e8b9a72cdc0f65660bbf747568eb6584dc0915bd Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:20:45 -0700 Subject: [PATCH 087/110] Modified program to allow category to appear on a drop down listings. --- .../form/field/PairedDamEntryField.js | 74 ------------------- 1 file changed, 74 deletions(-) delete mode 100644 onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js deleted file mode 100644 index 075f8a9b7..000000000 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedDamEntryField.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ - -Ext4.define('ONPRC_EHR.form.field.PairedDamEntryField', { - extend: 'LABKEY.ext4.ComboBox', - alias: 'widget.onprc_ehr-paireddamdentryfield', - - - trigger1Cls: 'x4-form-search-trigger', - - initComponent: function(){ - this.callParent(arguments); - }, - - onTrigger1Click: function(){ - var rec = EHR.DataEntryUtils.getBoundRecord(this); - if (!rec){ - Ext4.Msg.alert('Error', 'Unable to locate associated animal Id'); - return; - } - - - if (!rec || !rec.get('other_infant')){ - Ext4.Msg.alert('Error', 'No Infant Entered'); - return; - } - - Ext4.Msg.wait('Loading...'); - - - this.queryValue(rec, function(ret){ - Ext4.Msg.hide(); - - if (ret && ret.dam){ - this.setValue(ret.dam); - } - else if (ret && ret.fosterMom){ - this.setValue(ret.fosterMom); - } - }, true); - }, - - queryValue: function(rec, cb, alwaysUseCallback){ - var id = rec.get('other_infant'); - - LABKEY.Query.selectRows({ - schemaName: 'study', - queryName: 'demographicsParents', - columns: 'Id,dam,fosterMom', - filterArray: [ - LABKEY.Filter.create('Id', id , LABKEY.Filter.Types.CONTAINS_ONE_OF) - ], - failure: LDK.Utils.getErrorCallback(), - scope: this, - success: function(results){ - if (!alwaysUseCallback && id != this.pendingIdRequest){ - console.log('more recent request, aborting'); - return; - } - - if (results && results.rows && results.rows.length){ - cb.call(this, results.rows[0], results.rows[0].Id); - } - else { - cb.call(this, null, id); - } - } - }); - } - -}); \ No newline at end of file From 6c3fc7365270d97763166007fd114cb857f7e541 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:25:31 -0700 Subject: [PATCH 088/110] Modified program to allow category to appear on a drop down listings. --- .../resources/queries/study/pairingSummaryComments/.qview.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml index 5a2c8e82b..e56c7ee9a 100644 --- a/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml +++ b/onprc_ehr/resources/queries/study/pairingSummaryComments/.qview.xml @@ -13,7 +13,7 @@ - + From d220c21dea87718588460d7c2f8fc4bbb43bded1 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 10:46:42 -0700 Subject: [PATCH 089/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/queries/study/Pairings.query.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index ffec92b53..df7649e34 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -56,6 +56,7 @@ false Prior Group Housing + 200 ehr_lookups pairingpriorgroups From 77b027de4f0484df2538a209b2987648a026e5dd Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 14:10:04 -0700 Subject: [PATCH 090/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 1 + 1 file changed, 1 insertion(+) diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index 92e287400..da41bd02c 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -15,6 +15,7 @@ pairingGoal Pairing Goal value pairingObservation Pairing Observations value antibioticSensitivityResult Antibiotic Sensitivity Result value pairingSeparationReason Pairing Separation Reason value +pairingstarttype Pairing Start Type value tissue_preparation Tissue Preparation value tissue_condition Tissue Condition value drugReason Drug Reason value From 0ebbea82f120d317099e4e4f6e8a2013f4e90b9c Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 14:15:00 -0700 Subject: [PATCH 091/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/pairingstarttype.tsv | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 onprc_ehr/resources/data/pairingstarttype.tsv diff --git a/onprc_ehr/resources/data/pairingstarttype.tsv b/onprc_ehr/resources/data/pairingstarttype.tsv new file mode 100644 index 000000000..3bf4025df --- /dev/null +++ b/onprc_ehr/resources/data/pairingstarttype.tsv @@ -0,0 +1,47 @@ +value +Bio dam reunite +C-sx reunite +Contact decrease +Contact Increase +Contact increase first attempt +Decrease partners +Extended temporary separation +Feeder Box +General Comment +Increase partners +Increase partners first attempt +Infant socialization +Lactating foster +Non BSU pair +Nonlactating foster +Pair attempt +Pair change +Pair change-decrease +Pair change-increase +Pair monitor +Pair to trio/group +Permanent separation +Porch +remote monitoring +Reunite +Reunite after procedure +Reunite after TO +Same social group pair +Set up +STE +STF +STF DNPC +STF/E +STF/E DNPC +Temporary separation +TMB +TMB pair +TO as GC +trial contact +trial contact first attempt +Sep for Diet +STE. +STF. +STF DNPC. +STF/E. +STF/E DNPC. From 1bc332e227c8ff063707e4a9f5f6b246754e367e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Tue, 9 Sep 2025 18:01:09 -0700 Subject: [PATCH 092/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 2 ++ onprc_ehr/resources/data/pairingendtypes.tsv | 25 +++++++++++++++++++ .../resources/data/pairingpiorgroups.tsv | 3 +++ 3 files changed, 30 insertions(+) create mode 100644 onprc_ehr/resources/data/pairingendtypes.tsv create mode 100644 onprc_ehr/resources/data/pairingpiorgroups.tsv diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index da41bd02c..24718b3b8 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -10,6 +10,8 @@ tb_method TB Test Methods value microbiologyQuantity Microbiology Quantity value blood_sample_type Blood Sample Types value pairingHousingType Pairing Housing Types value +pairingpiorgroups Pairing Prior groups value +pairingendtypes Pairing End Tyoes value pairingOutcome Pairing Outcomes value pairingGoal Pairing Goal value pairingObservation Pairing Observations value diff --git a/onprc_ehr/resources/data/pairingendtypes.tsv b/onprc_ehr/resources/data/pairingendtypes.tsv new file mode 100644 index 000000000..eea46c577 --- /dev/null +++ b/onprc_ehr/resources/data/pairingendtypes.tsv @@ -0,0 +1,25 @@ +value +All to group +Contact decrease +Contact increase +Decrease contact +Decrease partners +End All Contact +End clear +End full contact +End GC +End group +End large mesh +Extended temporary separation. +Increase contact +Increase partners +N/A +Pair change-decrease. +Pair change-increase. +Pair to trio/group. +Permanent Separation. +Reunite from GC +Temporary separation. +TO with GC +Unsuccessful attempt +Unsuccessful set-up diff --git a/onprc_ehr/resources/data/pairingpiorgroups.tsv b/onprc_ehr/resources/data/pairingpiorgroups.tsv new file mode 100644 index 000000000..b96f5c988 --- /dev/null +++ b/onprc_ehr/resources/data/pairingpiorgroups.tsv @@ -0,0 +1,3 @@ +value +Not recent +Recent From 7b03404eb89ab23e077142b4f00c848fb0539f97 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 10 Sep 2025 08:44:32 -0700 Subject: [PATCH 093/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 2 +- .../grid/PairingObservationGridPanel.js | 28 ------- .../plugin/PairingObservationsCellEditing.js | 76 ------------------- 3 files changed, 1 insertion(+), 105 deletions(-) delete mode 100644 onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js delete mode 100644 onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index 24718b3b8..eda8814d2 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -11,7 +11,7 @@ microbiologyQuantity Microbiology Quantity value blood_sample_type Blood Sample Types value pairingHousingType Pairing Housing Types value pairingpiorgroups Pairing Prior groups value -pairingendtypes Pairing End Tyoes value +pairingendtypes Pairing End Types value pairingOutcome Pairing Outcomes value pairingGoal Pairing Goal value pairingObservation Pairing Observations value diff --git a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js b/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js deleted file mode 100644 index 4ff9662d8..000000000 --- a/onprc_ehr/resources/web/onprc_ehr/grid/PairingObservationGridPanel.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ -/** - * Created to allow a custom row editor plugin and column that summarize observations - */ -Ext4.define('ONPRC_EHR.grid.PairingObservationGridPanel', { - extend: 'EHR.grid.Panel', - alias: 'widget.onprc_ehr-pairingobservationgridpanel', - - initComponent: function(){ - this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); - - this.callParent(arguments); - }, - - getEditingPlugin: function(){ - LDK.Assert.assertNotEmpty('this.pairingobservationTypesStore is null in PairingObservationsGridPanel', this.pairingobservationTypesStore); - - return Ext4.create('ONPRC_EHR.grid.plugin.PairingObservationsCellEditing', { - pluginId: this.editingPluginId, - clicksToEdit: this.clicksToEdit, - pairingobservationTypesStore: ONPRC.Utils.getpairingObservationTypesStore() - }); - } -}); \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js b/onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js deleted file mode 100644 index 8094e5c44..000000000 --- a/onprc_ehr/resources/web/onprc_ehr/plugin/PairingObservationsCellEditing.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 - */ -Ext4.define('ONPRC_EHR.grid.plugin.PairingObservationsCellEditing', { - extend: 'LDK.grid.plugin.CellEditing', - alias: 'plugin.pairingobservationscellediting', - - constructor: function(config){ - this.pairingobservationTypesStore = ONPRC.Utils.getpairingObservationTypesStore(); - - this.callParent(arguments); - }, - - getEditor: function(record, column) { - var dataIndex = column ? column.dataIndex : null; - if (dataIndex != 'eventtype'){ - return this.callParent(arguments); - } - - var category = record.get('category'); - if (!category){ - return false; - } - - var store = this.pairingobservationTypesStore; - - //note: we allow the process to proceed even if we cant find the category. this is to support situations where we have saved records using a no-longer supported category - var rec = store.findRecord('value', category); - LDK.Assert.assertNotEmpty('Unable to find observation types record matching category: [' + category + ']. store count: ' + store.getCount() + ', loading: ' + store.isLoading(), rec); - - var me = this, - editors = me.editors, - editorId = column.getItemId() + '||' + category, - editor = editors.getByKey(editorId), - editorOwner = me.grid.ownerLockable || me.grid; - - if (!editor || editor.obsCategory != category){ - var config = rec && rec.get('editorconfig') ? Ext4.decode(rec.get('editorconfig')) : null; - config = config || { - xtype: 'textfield' - }; - - editor = Ext4.create('Ext.grid.CellEditor', { - obsCategory: category, - floating: true, - editorId: editorId, - field: config - }); - - //NOTE: essential for keyboard navigation - if (editor && !editor.hasCellEditOverrides){ - this.applyEditorOverrides(editor); - } - - editorOwner.add(editor); - editor.on({ - scope: me, - specialkey: me.onSpecialKey, - complete: me.onEditComplete, - canceledit: me.cancelEdit - }); - column.on('removed', me.cancelActiveEdit, me); - - me.editors.add(editor); - } - - editor.grid = me.grid; - - // Keep upward pointer correct for each use - editors are shared between locking sides - editor.editingPlugin = me; - - return editor; - } -}); \ No newline at end of file From 44775f435db8cacf5d90126f04887fbf48057979 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 10 Sep 2025 09:47:05 -0700 Subject: [PATCH 094/110] Modified program to allow category to appear on a drop down listings. --- .../web/onprc_ehr/model/sources/Pairing_Properties.js | 2 +- .../org/labkey/onprc_ehr/dataentry/PairingFormSection.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index ad093f066..d2d151938 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -154,7 +154,7 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { housingtype: { allowBlank: true, columnConfig: { - width: 100 + width: 180 } }, category: { diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java index 1942c79c8..3649a9c8c 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PairingFormSection.java @@ -16,6 +16,7 @@ package org.labkey.onprc_ehr.dataentry; import org.labkey.api.ehr.dataentry.SimpleFormSection; +import org.labkey.api.ehr.dataentry.SimpleGridPanel; import org.labkey.api.view.template.ClientDependency; import java.util.Collections; @@ -25,11 +26,11 @@ * Date: 7/7/13 * Time: 10:36 AM */ -public class PairingFormSection extends SimpleFormSection +public class PairingFormSection extends SimpleGridPanel { public PairingFormSection() { - super("study", "pairings", "Pairing Observations", "ehr-gridpanel"); + super("study", "pairings", "Pairing Observations"); setConfigSources(Collections.singletonList("Task")); } From 7e97836e084decbf6a3aea0fe8b9fc0ee352392f Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 10 Sep 2025 13:09:13 -0700 Subject: [PATCH 095/110] Modified program to allow category to appear on a drop down listings. --- .../resources/data/observation_types.tsv | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 onprc_ehr/resources/data/observation_types.tsv diff --git a/onprc_ehr/resources/data/observation_types.tsv b/onprc_ehr/resources/data/observation_types.tsv deleted file mode 100644 index 0de2ce8e1..000000000 --- a/onprc_ehr/resources/data/observation_types.tsv +++ /dev/null @@ -1,26 +0,0 @@ -value category editorconfig schemaName queryName valueColumn -Alopecia Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups alopecia_score value -SIB Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"sib_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups sib_score value -Alopecia Type Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_type","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_type value -Alopecia Regrowth Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_regrowth","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_regrowth value -BCS {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"bcs_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups bcs_score value -CRT {"xtype":"textfield","defaultValue":"1-2"} -MM {"xtype":"textfield","defaultValue":"Pink"} -Turgor {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"turgor_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Pain Score {"xtype":"ldk-numberfield","minValue":0,"maxValue":12} -Other {"xtype":"textfield"} -Menses {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"mens_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Vomit {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"vomit","displayField":"value","sortFields":"sort_order","valueField":"value"} -App {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"app_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Att {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"att_score","displayField":"value","valueField":"value"} -Hyd {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"hyd_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Stool {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"stool_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Incision {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"incision_score","displayField":"value","sortFields":"sort_order","valueField":"value"} -Observations {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"normal_abnormal","displayField":"state","valueField":"state"} -Temp {"xtype":"ldk-numberfield","minValue":0} -Pulse {"xtype":"ldk-numberfield","minValue":0} -Resp {"xtype":"ldk-numberfield","minValue":0} -Vet Attention {"xtype":"textfield","value":"Review Needed"} -Reviewed {"xtype":"textfield"} -Behaviors Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"behavior_types","displayField":"value","valueField":"value"} ehr_lookups behavior_types value -Fecal Smear Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"fecal_smear_score","displayField":"value","valueField":"value"} From bcef8d9270e1961b7cdda349d22b934205ab8f57 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 10 Sep 2025 15:51:38 -0700 Subject: [PATCH 096/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 2 +- .../resources/data/observation_types.tsv | 26 +++++++++++++++++++ ...gpiorgroups.tsv => pairingpriorgroups.tsv} | 0 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 onprc_ehr/resources/data/observation_types.tsv rename onprc_ehr/resources/data/{pairingpiorgroups.tsv => pairingpriorgroups.tsv} (100%) diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index eda8814d2..5a9164f3f 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -10,7 +10,7 @@ tb_method TB Test Methods value microbiologyQuantity Microbiology Quantity value blood_sample_type Blood Sample Types value pairingHousingType Pairing Housing Types value -pairingpiorgroups Pairing Prior groups value +pairingpriorgroups Pairing Prior groups value pairingendtypes Pairing End Types value pairingOutcome Pairing Outcomes value pairingGoal Pairing Goal value diff --git a/onprc_ehr/resources/data/observation_types.tsv b/onprc_ehr/resources/data/observation_types.tsv new file mode 100644 index 000000000..0de2ce8e1 --- /dev/null +++ b/onprc_ehr/resources/data/observation_types.tsv @@ -0,0 +1,26 @@ +value category editorconfig schemaName queryName valueColumn +Alopecia Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups alopecia_score value +SIB Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"sib_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups sib_score value +Alopecia Type Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_type","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_type value +Alopecia Regrowth Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_regrowth","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_regrowth value +BCS {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"bcs_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups bcs_score value +CRT {"xtype":"textfield","defaultValue":"1-2"} +MM {"xtype":"textfield","defaultValue":"Pink"} +Turgor {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"turgor_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Pain Score {"xtype":"ldk-numberfield","minValue":0,"maxValue":12} +Other {"xtype":"textfield"} +Menses {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"mens_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Vomit {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"vomit","displayField":"value","sortFields":"sort_order","valueField":"value"} +App {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"app_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Att {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"att_score","displayField":"value","valueField":"value"} +Hyd {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"hyd_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Stool {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"stool_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Incision {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"incision_score","displayField":"value","sortFields":"sort_order","valueField":"value"} +Observations {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"normal_abnormal","displayField":"state","valueField":"state"} +Temp {"xtype":"ldk-numberfield","minValue":0} +Pulse {"xtype":"ldk-numberfield","minValue":0} +Resp {"xtype":"ldk-numberfield","minValue":0} +Vet Attention {"xtype":"textfield","value":"Review Needed"} +Reviewed {"xtype":"textfield"} +Behaviors Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"behavior_types","displayField":"value","valueField":"value"} ehr_lookups behavior_types value +Fecal Smear Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"fecal_smear_score","displayField":"value","valueField":"value"} diff --git a/onprc_ehr/resources/data/pairingpiorgroups.tsv b/onprc_ehr/resources/data/pairingpriorgroups.tsv similarity index 100% rename from onprc_ehr/resources/data/pairingpiorgroups.tsv rename to onprc_ehr/resources/data/pairingpriorgroups.tsv From 2e0fa0884e0d033f556692c19eacc5451ec979fe Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Wed, 10 Sep 2025 22:51:55 -0700 Subject: [PATCH 097/110] Modified program to allow category to appear on a drop down listings. --- .../queries/study/Pairings.query.xml | 34 +++++++++---------- .../study/datasets/datasets_metadata.xml | 12 +++---- .../model/sources/Pairing_Properties.js | 34 +++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index df7649e34..866480ae8 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -35,15 +35,15 @@ Start Date - - false - Category - - onprc_ehr - observation_types - value - - + + + + + + + + + Start Type @@ -106,14 +106,14 @@ value - - Observation - - ehr_lookups - pairingObservation - value - - + + + + + + + + End Remark diff --git a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml index b15d94dde..a9640dae9 100644 --- a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -2326,9 +2326,9 @@ varchar - - varchar - + + + varchar @@ -2347,9 +2347,9 @@ varchar - - varchar - + + + integer urn:ehr.labkey.org/#Project diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index d2d151938..bdbc7f543 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -107,17 +107,17 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - observation: { - allowBlank: true, - columnConfig: { - width: 250 - }, - lookup: { - filterArray: [ - LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) - ] - } - }, + // observation: { + // allowBlank: true, + // columnConfig: { + // width: 250 + // }, + // lookup: { + // filterArray: [ + // LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) + // ] + // } + // }, lowestcage: { xtype: 'onprc_ehr-pairedidentryfield', header:'Pair ID', @@ -157,12 +157,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 180 } }, - category: { - allowBlank: false, - columnConfig: { - width: 200 - } - }, + // category: { + // allowBlank: false, + // columnConfig: { + // width: 200 + // } + // }, other_infant: { xtype: 'onprc_ehr-pairedinfantentryfield', allowBlank: true, From 04835354c983541d5e0cc104daca8cfde106baed Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 09:38:27 -0700 Subject: [PATCH 098/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 3 +- .../queries/study/Pairings.query.xml | 35 ++++++++++--------- .../study/datasets/datasets_metadata.xml | 12 +++---- onprc_ehr/resources/views/populateData.html | 20 ++++++++++- .../model/sources/Pairing_Properties.js | 34 +++++++++--------- 5 files changed, 61 insertions(+), 43 deletions(-) diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index 5a9164f3f..864680a61 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -9,8 +9,7 @@ pairingEventType Pairing Event Types value tb_method TB Test Methods value microbiologyQuantity Microbiology Quantity value blood_sample_type Blood Sample Types value -pairingHousingType Pairing Housing Types value -pairingpriorgroups Pairing Prior groups value +pairingpriorgroups Pairing Housing Type value pairingendtypes Pairing End Types value pairingOutcome Pairing Outcomes value pairingGoal Pairing Goal value diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 866480ae8..94fa1d92f 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -35,15 +35,15 @@ Start Date - - - - - - - - - + + false + Category + + onprc_ehr + observation_types + value + + Start Type @@ -106,14 +106,14 @@ value - - - - - - - - + + Observation + + ehr_lookups + pairingObservation + value + + End Remark @@ -121,6 +121,7 @@ + Pair ID true diff --git a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml index a9640dae9..b15d94dde 100644 --- a/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/onprc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -2326,9 +2326,9 @@ varchar - - - + + varchar + varchar @@ -2347,9 +2347,9 @@ varchar - - - + + varchar + integer urn:ehr.labkey.org/#Project diff --git a/onprc_ehr/resources/views/populateData.html b/onprc_ehr/resources/views/populateData.html index be85c72de..e29688b6c 100644 --- a/onprc_ehr/resources/views/populateData.html +++ b/onprc_ehr/resources/views/populateData.html @@ -643,7 +643,7 @@ label: 'Pairing Housing Type', populateFn: 'populateFromFile', schemaName: 'ehr_lookups', - queryName: 'pairingHousingType', + queryName: 'pairingpriorgroups', pk: 'rowid' },{ label: 'Pairing Goal', @@ -657,6 +657,24 @@ schemaName: 'ehr_lookups', queryName: 'pairingOutcome', pk: 'rowid' + },{ + label: 'Pairing Category', + populateFn: 'populateFromFile', + schemaName: 'onprc_ehr', + queryName: 'observation_types', + pk: 'rowid' + },{ + label: 'Pairing Start Type', + populateFn: 'populateFromFile', + schemaName: 'ehr_lookups', + queryName: 'pairingstarttype', + pk: 'rowid' + },{ + label: 'Pairing End Type', + populateFn: 'populateFromFile', + schemaName: 'ehr_lookups', + queryName: 'pairingendypes', + pk: 'rowid' },{ label: 'Blood Draw Services', populateFn: 'populateFromFile', diff --git a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js index bdbc7f543..d2d151938 100644 --- a/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js +++ b/onprc_ehr/resources/web/onprc_ehr/model/sources/Pairing_Properties.js @@ -107,17 +107,17 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { } }, - // observation: { - // allowBlank: true, - // columnConfig: { - // width: 250 - // }, - // lookup: { - // filterArray: [ - // LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) - // ] - // } - // }, + observation: { + allowBlank: true, + columnConfig: { + width: 250 + }, + lookup: { + filterArray: [ + LABKEY.Filter.create('date_disabled', null, LABKEY.Filter.Types.ISBLANK) + ] + } + }, lowestcage: { xtype: 'onprc_ehr-pairedidentryfield', header:'Pair ID', @@ -157,12 +157,12 @@ EHR.model.DataModelManager.registerMetadata('Pairing_Properties', { width: 180 } }, - // category: { - // allowBlank: false, - // columnConfig: { - // width: 200 - // } - // }, + category: { + allowBlank: false, + columnConfig: { + width: 200 + } + }, other_infant: { xtype: 'onprc_ehr-pairedinfantentryfield', allowBlank: true, From 960d914e777b076aa5a55f01f9ea399ffeebcefc Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 10:46:31 -0700 Subject: [PATCH 099/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/pairing_observation_types.tsv | 6 ++++++ onprc_ehr/resources/queries/study/Pairings.query.xml | 2 +- .../schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql | 2 +- onprc_ehr/resources/schemas/onprc_ehr.xml | 2 +- onprc_ehr/resources/views/populateData.html | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 onprc_ehr/resources/data/pairing_observation_types.tsv diff --git a/onprc_ehr/resources/data/pairing_observation_types.tsv b/onprc_ehr/resources/data/pairing_observation_types.tsv new file mode 100644 index 000000000..291834aad --- /dev/null +++ b/onprc_ehr/resources/data/pairing_observation_types.tsv @@ -0,0 +1,6 @@ +value +Divider Change +Event +Infant Related +STF Beh +STF Clinical diff --git a/onprc_ehr/resources/queries/study/Pairings.query.xml b/onprc_ehr/resources/queries/study/Pairings.query.xml index 94fa1d92f..cf4e8704d 100644 --- a/onprc_ehr/resources/queries/study/Pairings.query.xml +++ b/onprc_ehr/resources/queries/study/Pairings.query.xml @@ -40,7 +40,7 @@ Category onprc_ehr - observation_types + pairing_observation_types value diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql index 042e876b6..d829a4ae6 100644 --- a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql +++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql @@ -1,4 +1,4 @@ -CREATE TABLE onprc_ehr.observation_types ( +CREATE TABLE onprc_ehr.pairing_observation_types ( rowid [int] IDENTITY(100,1) NOT NULL, value nvarchar(200), category nvarchar(200), diff --git a/onprc_ehr/resources/schemas/onprc_ehr.xml b/onprc_ehr/resources/schemas/onprc_ehr.xml index 46e226ba0..875814163 100644 --- a/onprc_ehr/resources/schemas/onprc_ehr.xml +++ b/onprc_ehr/resources/schemas/onprc_ehr.xml @@ -1454,7 +1454,7 @@ - +
diff --git a/onprc_ehr/resources/views/populateData.html b/onprc_ehr/resources/views/populateData.html index e29688b6c..c52d25bc1 100644 --- a/onprc_ehr/resources/views/populateData.html +++ b/onprc_ehr/resources/views/populateData.html @@ -661,7 +661,7 @@ label: 'Pairing Category', populateFn: 'populateFromFile', schemaName: 'onprc_ehr', - queryName: 'observation_types', + queryName: 'pairing_observation_types', pk: 'rowid' },{ label: 'Pairing Start Type', From 118094411a0e5e70775cde9b3f21d1d650d0cceb Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 10:50:26 -0700 Subject: [PATCH 100/110] Modified program to allow category to appear on a drop down listings. --- .../schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql index d829a4ae6..3fcc21300 100644 --- a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql +++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-24.012-24.013.sql @@ -12,7 +12,7 @@ CREATE TABLE onprc_ehr.pairing_observation_types ( ModifiedBy USERID, Container entityId NOT NULL, - CONSTRAINT PK_ONPRC_EHR_OBSERVATION_TYPES PRIMARY KEY (rowid), + CONSTRAINT PK_ONPRC_EHR_PAIRING_OBSERVATION_TYPES PRIMARY KEY (rowid), ); GO From c0df2b93382584291657c42a554ceb8d907d74d3 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 11:07:56 -0700 Subject: [PATCH 101/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/views/populateData.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/views/populateData.html b/onprc_ehr/resources/views/populateData.html index c52d25bc1..39a9c71fd 100644 --- a/onprc_ehr/resources/views/populateData.html +++ b/onprc_ehr/resources/views/populateData.html @@ -673,7 +673,7 @@ label: 'Pairing End Type', populateFn: 'populateFromFile', schemaName: 'ehr_lookups', - queryName: 'pairingendypes', + queryName: 'pairingendtypes', pk: 'rowid' },{ label: 'Blood Draw Services', From d9a1ca29690cde624bd67168c0125f0b76a16568 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 12:22:47 -0700 Subject: [PATCH 102/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/views/populateData.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/views/populateData.html b/onprc_ehr/resources/views/populateData.html index 39a9c71fd..8f4d4e57f 100644 --- a/onprc_ehr/resources/views/populateData.html +++ b/onprc_ehr/resources/views/populateData.html @@ -670,7 +670,7 @@ queryName: 'pairingstarttype', pk: 'rowid' },{ - label: 'Pairing End Type', + label: 'Pairing End Types', populateFn: 'populateFromFile', schemaName: 'ehr_lookups', queryName: 'pairingendtypes', From e562a4b658514eba268a6fa6d3535f8edebe948b Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 15:21:13 -0700 Subject: [PATCH 103/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 167 ++++++++++++----------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index 864680a61..5ccc25c05 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -1,84 +1,85 @@ setname label keyfield titleColumn -PregnancyConfirm Pregnancy Confirmation Types -housingDefinition Housing Definition -housingTypes Housing Types -AcquistionType Acquistion Types value -RearingType Rearing Types -MatingType Mating Types -pairingEventType Pairing Event Types value -tb_method TB Test Methods value -microbiologyQuantity Microbiology Quantity value -blood_sample_type Blood Sample Types value -pairingpriorgroups Pairing Housing Type value -pairingendtypes Pairing End Types value -pairingOutcome Pairing Outcomes value -pairingGoal Pairing Goal value -pairingObservation Pairing Observations value -antibioticSensitivityResult Antibiotic Sensitivity Result value -pairingSeparationReason Pairing Separation Reason value -pairingstarttype Pairing Start Type value -tissue_preparation Tissue Preparation value -tissue_condition Tissue Condition value -drugReason Drug Reason value -serologyMethod Serology Methods value -TransferReason Transfer Reasons -assignmentReleaseType Assignment Release Types value -animalGroupReleaseType Animal Group Release Types value -observation_areas Observation Areas value -drugOutcome Drug Administration Outcomes value -encounterSummaryCategory Encounter Summary Category value -labworkChargeType Labwork Charge Types value -notes_category DCM Notes Category value -blood_draw_reason Blood Draw Reason value -encounter_roles Encounter Roles value -parentageRelationship Parentage Relationship value -parentageMethod Parentage Determination Methods value -serologyResultQualifier Serology Result Qualifier value -app_score Appetite Score value -att_score Attitude Score value -turgor_score Turgor Score value -hyd_score Hyd Score value -stool_score Stool Score value -sib_score SIB Score value -incision_score Incision Score value -alopecia_type Alopecia Type value -alopecia_score Alopecia Type value -alopecia_regrowth Alopecia Regrowth value -mens_score Mens Score value -vomit Vomit value -tissue_sample_type Tissue Distribution Sample Type value -tissue_distribution_category Tissue Distribution Request Category value -cage_status Cage Status value -project_use_category Center Project Use Categories value -project_type Center Project Types value -procedure_drug_templates Procedure Drug Templates value -behavior_types Behavior Types value -fecal_smear_score Fecal Smear Scores value -problem_list_subcategory Problem List Subcategory value -customer_affiliation Customer Affiliation value -birth_date_type Birth Date Type value -birth_type Birth Type Field Values value -chemistry_method Chemistry Method Field Values value -clinpath_sampletype Clinpath Sample Type Field Values value -clinpath_types Clinpath Type Field Values value -clinremarks_category Clinremarks Category Field Values value -drug_categories Drug Category Field Values value -hematology_method Hematology Method Field Values value -problem_list_category Problem List Category Field Values value -parasitology_method Parasitology Method Field Values value -urinalysis_method Urinalysis Method Field Values value -urinalysis_qualitative_results Urinalysis Qualitative Result Field Values value -bcs_score BCS Score Field Values value -avail_codes Availability Code Field Values value -status_codes Status Code Field Values value -snomed_qualifiers SNOMED Code Qualifiers value -housing_reason Housing Reason Field Values value -housing_condition_codes Housing Condition Field Values value -histology_stain Histology Stain Field Values value -encounter_types Encounter Types value -DeliveryMode Delivery Mode Field Values value -DeliveryType Delivery Type Field Values value -death_manner Death Manner value -death_cause Death Cause value -ConfirmationType Pregnancy Confirmation Type value -clinpath_collection_method Clinpath Collection Method value \ No newline at end of file +PregnancyConfirm Pregnancy Confirmation Types +housingDefinition Housing Definition +housingTypes Housing Types +AcquistionType Acquistion Types value +RearingType Rearing Types +MatingType Mating Types +pairingEventType Pairing Event Types value +tb_method TB Test Methods value +microbiologyQuantity Microbiology Quantity value +blood_sample_type Blood Sample Types value +pairingHousingType Pairing Housing Types value +pairingpiorgroups Pairing Prior groups value +pairingendtypes Pairing End Types value +pairingstarttype Pairing Start Type value +pairingOutcome Pairing Outcomes value +pairingGoal Pairing Goal value +pairingObservation Pairing Observations value +antibioticSensitivityResult Antibiotic Sensitivity Result value +pairingSeparationReason Pairing Separation Reason value +tissue_preparation Tissue Preparation value +tissue_condition Tissue Condition value +drugReason Drug Reason value +serologyMethod Serology Methods value +TransferReason Transfer Reasons +assignmentReleaseType Assignment Release Types value +animalGroupReleaseType Animal Group Release Types value +observation_areas Observation Areas value +drugOutcome Drug Administration Outcomes value +encounterSummaryCategory Encounter Summary Category value +labworkChargeType Labwork Charge Types value +notes_category DCM Notes Category value +blood_draw_reason Blood Draw Reason value +encounter_roles Encounter Roles value +parentageRelationship Parentage Relationship value +parentageMethod Parentage Determination Methods value +serologyResultQualifier Serology Result Qualifier value +app_score Appetite Score value +att_score Attitude Score value +turgor_score Turgor Score value +hyd_score Hyd Score value +stool_score Stool Score value +sib_score SIB Score value +incision_score Incision Score value +alopecia_type Alopecia Type value +alopecia_score Alopecia Type value +alopecia_regrowth Alopecia Regrowth value +mens_score Mens Score value +vomit Vomit value +tissue_sample_type Tissue Distribution Sample Type value +tissue_distribution_category Tissue Distribution Request Category value +cage_status Cage Status value +project_use_category Center Project Use Categories value +project_type Center Project Types value +procedure_drug_templates Procedure Drug Templates value +behavior_types Behavior Types value +fecal_smear_score Fecal Smear Scores value +problem_list_subcategory Problem List Subcategory value +customer_affiliation Customer Affiliation value +birth_date_type Birth Date Type value +birth_type Birth Type Field Values value +chemistry_method Chemistry Method Field Values value +clinpath_sampletype Clinpath Sample Type Field Values value +clinpath_types Clinpath Type Field Values value +clinremarks_category Clinremarks Category Field Values value +drug_categories Drug Category Field Values value +hematology_method Hematology Method Field Values value +problem_list_category Problem List Category Field Values value +parasitology_method Parasitology Method Field Values value +urinalysis_method Urinalysis Method Field Values value +urinalysis_qualitative_results Urinalysis Qualitative Result Field Values value +bcs_score BCS Score Field Values value +avail_codes Availability Code Field Values value +status_codes Status Code Field Values value +snomed_qualifiers SNOMED Code Qualifiers value +housing_reason Housing Reason Field Values value +housing_condition_codes Housing Condition Field Values value +histology_stain Histology Stain Field Values value +encounter_types Encounter Types value +DeliveryMode Delivery Mode Field Values value +DeliveryType Delivery Type Field Values value +death_manner Death Manner value +death_cause Death Cause value +ConfirmationType Pregnancy Confirmation Type value +clinpath_collection_method Clinpath Collection Method value From 7eac6ed9272f8f2200f0d4c8ab3a3759af8975cb Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 16:50:54 -0700 Subject: [PATCH 104/110] Modified program to allow category to appear on a drop down listings. --- onprc_ehr/resources/data/lookup_sets.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/data/lookup_sets.tsv b/onprc_ehr/resources/data/lookup_sets.tsv index 5ccc25c05..546cfbeaf 100644 --- a/onprc_ehr/resources/data/lookup_sets.tsv +++ b/onprc_ehr/resources/data/lookup_sets.tsv @@ -10,7 +10,7 @@ tb_method TB Test Methods value microbiologyQuantity Microbiology Quantity value blood_sample_type Blood Sample Types value pairingHousingType Pairing Housing Types value -pairingpiorgroups Pairing Prior groups value +pairingpriorgroups Pairing Prior groups value pairingendtypes Pairing End Types value pairingstarttype Pairing Start Type value pairingOutcome Pairing Outcomes value From 8d5b382b84c8844ddd09a299e876d911be710489 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 21:03:53 -0700 Subject: [PATCH 105/110] Modified program to allow category to appear on a drop down listings. --- .../src/org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java | 5 +++++ 1 file changed, 5 insertions(+) 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 f460fb88a..3c6f8323e 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 @@ -837,6 +837,11 @@ public void testPairingObservations() throws Exception grid.setGridCell(3, "lowestcage", "A2"); grid.setGridCell(3, "room", ROOMS[0]); grid.setGridCell(3, "cage", "A2"); + grid.setGridCell(3, "date", _df.format(new Date())); + + Ext4ComboRef combo = getFieldInWindow("Category", Ext4ComboRef.class); + Assert.assertEquals("Divider Change", combo.getDisplayValue()); + sleep(100); Assert.assertNotEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(3, "pairid")); From 6242975e87918f9ce6608d523e910dc74431ce42 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Thu, 11 Sep 2025 23:22:49 -0700 Subject: [PATCH 106/110] Modified program to allow category to appear on a drop down listings. --- .../tests/onprc_ehr/AbstractGenericONPRC_EHRTest.java | 1 + .../org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) 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 55daedca3..6a72c96f7 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 @@ -76,6 +76,7 @@ public abstract class AbstractGenericONPRC_EHRTest extends AbstractGenericEHRTes protected static String[] SUBJECTS = {"12345", "23456", "34567", "45678", "56789"}; protected static String[] ROOMS = {"Room1", "Room2", "Room3"}; protected static String[] CAGES = {"A1", "B2", "A3"}; + protected static String[] CATEGORY = {"Divider Change", "Event", "STP_Beh"}; @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 3c6f8323e..26ce136d6 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 @@ -816,6 +816,8 @@ public void testPairingObservations() throws Exception grid.setGridCell(1, "lowestcage", "A1"); grid.setGridCell(1, "room", ROOMS[0]); grid.setGridCell(1, "cage", "A1"); + grid.setGridCell(1, "date", _tf.format(new Date())); + grid.setGridCell(1, "category", CATEGORY[0]); _helper.addRecordToGrid(grid); sleep(200); @@ -823,6 +825,8 @@ public void testPairingObservations() throws Exception grid.setGridCell(2, "lowestcage", "A1"); grid.setGridCell(2, "room", ROOMS[0]); grid.setGridCell(2, "cage", "A1"); + grid.setGridCell(2, "date", _tf.format(new Date())); + grid.setGridCell(2, "category", CATEGORY[0]); Assert.assertEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(2, "pairid")); @@ -837,10 +841,9 @@ public void testPairingObservations() throws Exception grid.setGridCell(3, "lowestcage", "A2"); grid.setGridCell(3, "room", ROOMS[0]); grid.setGridCell(3, "cage", "A2"); - grid.setGridCell(3, "date", _df.format(new Date())); + grid.setGridCell(3, "date", _tf.format(new Date())); + grid.setGridCell(3, "category", CATEGORY[0]); - Ext4ComboRef combo = getFieldInWindow("Category", Ext4ComboRef.class); - Assert.assertEquals("Divider Change", combo.getDisplayValue()); sleep(100); Assert.assertNotEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(3, "pairid")); From 4a52d2e1bac4263d816793ce786f73ce634f9b43 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 12 Sep 2025 07:29:44 -0700 Subject: [PATCH 107/110] Modified program to allow category to appear on a drop down listings. --- .../org/labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 26ce136d6..942a5c951 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 @@ -808,7 +808,7 @@ public void testPairingObservations() throws Exception _helper.goToTaskForm("Pairing Observations"); ensureRoomExists(ROOMS[0]); ensureRoomExists(ROOMS[2]); - + Date today = new Date(); //test whether pairid properly assigned, including when room/cage changed Ext4GridRef grid = _helper.getExt4GridForFormSection("Pairing Observations"); _helper.addRecordToGrid(grid); @@ -816,7 +816,7 @@ public void testPairingObservations() throws Exception grid.setGridCell(1, "lowestcage", "A1"); grid.setGridCell(1, "room", ROOMS[0]); grid.setGridCell(1, "cage", "A1"); - grid.setGridCell(1, "date", _tf.format(new Date())); + grid.setGridCellJS(1, "date", TIME_FORMAT.format(today)); grid.setGridCell(1, "category", CATEGORY[0]); _helper.addRecordToGrid(grid); @@ -825,7 +825,7 @@ public void testPairingObservations() throws Exception grid.setGridCell(2, "lowestcage", "A1"); grid.setGridCell(2, "room", ROOMS[0]); grid.setGridCell(2, "cage", "A1"); - grid.setGridCell(2, "date", _tf.format(new Date())); + grid.setGridCellJS(2, "date", TIME_FORMAT.format(today)); grid.setGridCell(2, "category", CATEGORY[0]); Assert.assertEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(2, "pairid")); @@ -841,7 +841,7 @@ public void testPairingObservations() throws Exception grid.setGridCell(3, "lowestcage", "A2"); grid.setGridCell(3, "room", ROOMS[0]); grid.setGridCell(3, "cage", "A2"); - grid.setGridCell(3, "date", _tf.format(new Date())); + grid.setGridCellJS(3, "date", TIME_FORMAT.format(today)); grid.setGridCell(3, "category", CATEGORY[0]); From 9af4043d2cdb6d6d9cfc269eb5105cf2b980d8ef Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Fri, 12 Sep 2025 10:22:32 -0700 Subject: [PATCH 108/110] Modified program to allow category to appear on a drop down listings. --- .../labkey/test/tests/onprc_ehr/ONPRC_EHRTest2.java | 13 ------------- 1 file changed, 13 deletions(-) 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 942a5c951..1d547ed76 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 @@ -828,12 +828,6 @@ public void testPairingObservations() throws Exception grid.setGridCellJS(2, "date", TIME_FORMAT.format(today)); grid.setGridCell(2, "category", CATEGORY[0]); - Assert.assertEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(2, "pairid")); - - //should update pairId - grid.setGridCell(2, "room", ROOMS[2]); - sleep(200); - Assert.assertNotEquals("Pair ID doesn't match, 1: " + grid.getFieldValue(1, "pairid") + ", 2: " + grid.getFieldValue(2, "pairid"), grid.getFieldValue(1, "pairid"), grid.getFieldValue(2, "pairid")); _helper.addRecordToGrid(grid); sleep(200); @@ -845,13 +839,6 @@ public void testPairingObservations() throws Exception grid.setGridCell(3, "category", CATEGORY[0]); - sleep(100); - Assert.assertNotEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(3, "pairid")); - - grid.setGridCell(3, "lowestcage", "A1"); - sleep(100); - Assert.assertEquals(grid.getFieldValue(1, "pairid"), grid.getFieldValue(3, "pairid")); - sleep(200); _helper.discardForm(); } From 566495ee8a26d174c61d12b1d0601365ac8d4cfe Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:29:33 -0700 Subject: [PATCH 109/110] Modified Pairing Observation input form to modify cageinfantPairing.sql file --- .../queries/study/CageMateInfant.sql | 34 ++++++++++++------ .../queries/study/CageMateInfantpairings.sql | 35 +++++++++++++++++++ .../form/field/PairedInfantEntryField.js | 2 +- 3 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 onprc_ehr/resources/queries/study/CageMateInfantpairings.sql diff --git a/onprc_ehr/resources/queries/study/CageMateInfant.sql b/onprc_ehr/resources/queries/study/CageMateInfant.sql index 9354c962c..3ceff8d9f 100644 --- a/onprc_ehr/resources/queries/study/CageMateInfant.sql +++ b/onprc_ehr/resources/queries/study/CageMateInfant.sql @@ -1,19 +1,33 @@ +/* + * Copyright (c) 2017 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + SELECT h1.Id, - group_concat(h2.Id, '-') as infantcagemate, - group_Concat(distinct h2.room) as room, - group_concat(distinct h1.cage) as cage + group_concat(h2.Id) as InfantCageMate FROM study.demographicsCurrentLocation h1 - JOIN study.demographicsCurrentLocation h2 ON ( +JOIN study.demographicsCurrentLocation h2 ON ( h1.room = h2.room AND - h1.cage = h2.cage - - ) + h1.cage = h2.cage AND + h1.Id != h2.Id +) WHERE - h1.room.housingType.value = 'Cage Location' AND - h2.Id.age.ageInyears < 1 + h1.room.housingType.value = 'Cage Location' AND + h2.Id.age.ageInyears < 1 -GROUP BY h1.Id \ No newline at end of file +GROUP BY h1.Id diff --git a/onprc_ehr/resources/queries/study/CageMateInfantpairings.sql b/onprc_ehr/resources/queries/study/CageMateInfantpairings.sql new file mode 100644 index 000000000..8cb02e73d --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateInfantpairings.sql @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2017 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +SELECT + + h1.Id, + group_concat(h2.Id, '-') as infantcagemate, + group_Concat(distinct h2.room) as room, + group_concat(distinct h1.cage) as cage + +FROM study.demographicsCurrentLocation h1 + JOIN study.demographicsCurrentLocation h2 ON ( + h1.room = h2.room AND + h1.cage = h2.cage + + ) + +WHERE + h1.room.housingType.value = 'Cage Location' AND + h2.Id.age.ageInyears < 1 + +GROUP BY h1.Id \ No newline at end of file diff --git a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js index 69e602a45..613906cec 100644 --- a/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js +++ b/onprc_ehr/resources/web/onprc_ehr/form/field/PairedInfantEntryField.js @@ -52,7 +52,7 @@ Ext4.define('ONPRC_EHR.form.field.PairedInfantEntryField', { LABKEY.Query.selectRows({ schemaName: 'study', - queryName: 'CageMateInfant', + queryName: 'CageMateInfantpairings', columns: 'infantcagemate', sort:'Id', filterArray: [ From 6c89fa0e9094c02e5f92d92dc8e8c9284d204809 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 15 Sep 2025 10:33:26 -0700 Subject: [PATCH 110/110] Modified Pairing Observation input form to modify cageinfantPairing.sql file --- .../queries/study/CageMateInfantpairings/.qview.xml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 onprc_ehr/resources/queries/study/CageMateInfantpairings/.qview.xml diff --git a/onprc_ehr/resources/queries/study/CageMateInfantpairings/.qview.xml b/onprc_ehr/resources/queries/study/CageMateInfantpairings/.qview.xml new file mode 100644 index 000000000..0f45185ae --- /dev/null +++ b/onprc_ehr/resources/queries/study/CageMateInfantpairings/.qview.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file