From f9506ca8c57b2dd27ca876d720f519797b3f19a0 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Wed, 16 Apr 2025 14:35:14 -0700 Subject: [PATCH 1/9] Update "schedule" views to use Building and remove Room. --- .../resources/queries/study/observationSchedule/.qview.xml | 4 ++-- nirc_ehr/resources/queries/study/prcSchedule/.qview.xml | 4 ++-- nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nirc_ehr/resources/queries/study/observationSchedule/.qview.xml b/nirc_ehr/resources/queries/study/observationSchedule/.qview.xml index 4811d807..5d3d219a 100644 --- a/nirc_ehr/resources/queries/study/observationSchedule/.qview.xml +++ b/nirc_ehr/resources/queries/study/observationSchedule/.qview.xml @@ -3,7 +3,7 @@ - + @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/nirc_ehr/resources/queries/study/prcSchedule/.qview.xml b/nirc_ehr/resources/queries/study/prcSchedule/.qview.xml index f96027d5..2f1a2f17 100644 --- a/nirc_ehr/resources/queries/study/prcSchedule/.qview.xml +++ b/nirc_ehr/resources/queries/study/prcSchedule/.qview.xml @@ -3,7 +3,7 @@ - + @@ -17,7 +17,7 @@ - + \ No newline at end of file diff --git a/nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml b/nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml index 2c883832..ae1cbb85 100644 --- a/nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml +++ b/nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml @@ -3,7 +3,7 @@ - + @@ -22,7 +22,7 @@ - + From 4bf05647b1b3965ebe3ed9600302772fb0c17a9a Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Wed, 16 Apr 2025 14:37:36 -0700 Subject: [PATCH 2/9] Separate wound_status lookup with Behavior and Clinical. Update observation_types. Add 'source' to editable_lookups. --- nirc_ehr/resources/data/editable_lookups.tsv | 4 +++- nirc_ehr/resources/data/lookup_sets.tsv | 3 ++- nirc_ehr/resources/data/lookupsManifest.tsv | 3 ++- nirc_ehr/resources/data/lookupsManifestTest.tsv | 3 ++- nirc_ehr/resources/data/observation_types.tsv | 3 ++- nirc_ehr/resources/data/wound_status_behavior.tsv | 4 ++++ .../data/{wound_status.tsv => wound_status_clinical.tsv} | 0 7 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 nirc_ehr/resources/data/wound_status_behavior.tsv rename nirc_ehr/resources/data/{wound_status.tsv => wound_status_clinical.tsv} (100%) diff --git a/nirc_ehr/resources/data/editable_lookups.tsv b/nirc_ehr/resources/data/editable_lookups.tsv index 2381097e..291e96c3 100644 --- a/nirc_ehr/resources/data/editable_lookups.tsv +++ b/nirc_ehr/resources/data/editable_lookups.tsv @@ -114,6 +114,7 @@ respiratory_observations Clinical Respiratory Observations Used in clinical obse routes Clinical Treatment Routes Used in drug and treatment datasets. sib_score Behavior SIB Score Behavior observation fixed values. skin_problem Clinical Skin Problems Clinical observation fixed values. +source Colony Management Source species Colony Management Species snomed Research Treatments List of animal treatments. species_codes Colony Management Species Codes @@ -133,5 +134,6 @@ volume_units Clinical Volume Units Used in drug and treatment datasets. weight_ranges Clinical Weight Ranges Min/Max allowable weight per species. Used in various weight reports. wound_score Clinical Wound Score Clinical observation fixed values. wound_severity Clinical Wound Severity Clinical observation fixed values. -wound_status Clinical Wound Status Clinical observation fixed values. +wound_status_behavior Behavior Wound Status Behavioral observation fixed values. +wound_status_clinical Clinical Wound Status Clinical observation fixed values. yes_no_order Clinical Yes/No Values in Order Used for yes/no values in various datasets. Includes sort order. \ No newline at end of file diff --git a/nirc_ehr/resources/data/lookup_sets.tsv b/nirc_ehr/resources/data/lookup_sets.tsv index 75a4c580..8fc0fb85 100644 --- a/nirc_ehr/resources/data/lookup_sets.tsv +++ b/nirc_ehr/resources/data/lookup_sets.tsv @@ -112,5 +112,6 @@ vendor_production_location Vendor Production Location value title weight_ranges Weight Ranges value wound_score Wound Score value wound_severity Wound Severity value -wound_status Wound Status value +wound_status_behavior Wound Status Behavior value +wound_status_clinical Wound Status Clinical value yes_no_order Yes/No Values in Order value \ No newline at end of file diff --git a/nirc_ehr/resources/data/lookupsManifest.tsv b/nirc_ehr/resources/data/lookupsManifest.tsv index 651aabb7..300f7645 100644 --- a/nirc_ehr/resources/data/lookupsManifest.tsv +++ b/nirc_ehr/resources/data/lookupsManifest.tsv @@ -123,5 +123,6 @@ volume_units weight_ranges wound_score wound_severity -wound_status +wound_status_behavior +wound_status_clinical yes_no_order \ No newline at end of file diff --git a/nirc_ehr/resources/data/lookupsManifestTest.tsv b/nirc_ehr/resources/data/lookupsManifestTest.tsv index be1be46f..9a509028 100644 --- a/nirc_ehr/resources/data/lookupsManifestTest.tsv +++ b/nirc_ehr/resources/data/lookupsManifestTest.tsv @@ -125,5 +125,6 @@ volume_units weight_ranges wound_score wound_severity -wound_status +wound_status_behavior +wound_status_clinical yes_no_order \ No newline at end of file diff --git a/nirc_ehr/resources/data/observation_types.tsv b/nirc_ehr/resources/data/observation_types.tsv index d79b197c..d6f4a37d 100644 --- a/nirc_ehr/resources/data/observation_types.tsv +++ b/nirc_ehr/resources/data/observation_types.tsv @@ -46,4 +46,5 @@ Temperament Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","quer Vaginal/Uterine Prolapse {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"vaginal_uterine_prolapse","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups vaginal_uterine_prolapse value Verified Id? {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"yes_no_order","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups yes_no_order value Wound Severity Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_severity","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_severity value -Wound Status Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status value \ No newline at end of file +Wound Status Behavior Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_behavior","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_behavior value +Wound Status Clinical Clinical {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_clinical","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_clinical value \ No newline at end of file diff --git a/nirc_ehr/resources/data/wound_status_behavior.tsv b/nirc_ehr/resources/data/wound_status_behavior.tsv new file mode 100644 index 00000000..91514b44 --- /dev/null +++ b/nirc_ehr/resources/data/wound_status_behavior.tsv @@ -0,0 +1,4 @@ +value sort_order +Completely healed 1 +Mostly healed 2 +Not healed 3 \ No newline at end of file diff --git a/nirc_ehr/resources/data/wound_status.tsv b/nirc_ehr/resources/data/wound_status_clinical.tsv similarity index 100% rename from nirc_ehr/resources/data/wound_status.tsv rename to nirc_ehr/resources/data/wound_status_clinical.tsv From e4c4cc1f2f8b08497b8f5d5a9ff96b2a9a3010c2 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Wed, 16 Apr 2025 14:39:28 -0700 Subject: [PATCH 3/9] Update Buildings metadata to remove DefaultEHRCustomizer that has a fixed width on 'Description' column (we don't want that). --- nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml b/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml index 4f5be2da..589c89a9 100644 --- a/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml +++ b/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml @@ -3,7 +3,6 @@ Buildings - Area From f319dbd87d6b5cf4594ab6fc91916663dff2593f Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Thu, 17 Apr 2025 09:43:57 -0700 Subject: [PATCH 4/9] Update ETL with Clinical or Behavior type. --- nirc_ehr/resources/queries/dbo/q_observations.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nirc_ehr/resources/queries/dbo/q_observations.sql b/nirc_ehr/resources/queries/dbo/q_observations.sql index 6f636439..82c5b6ff 100644 --- a/nirc_ehr/resources/queries/dbo/q_observations.sql +++ b/nirc_ehr/resources/queries/dbo/q_observations.sql @@ -6,6 +6,10 @@ SELECT anmEvt.ANIMAL_EVENT_ID ELSE (trim(anmEvt.STAFF_ID.STAFF_FIRST_NAME) || '|' || trim(anmEvt.STAFF_ID.STAFF_LAST_NAME)) END) AS performedby, anmEvt.EVENT_ID.NAME AS category, + (CASE + WHEN evtEvtGrp.EVENT_GROUP_ID = 30 THEN 'Clinical' + WHEN evtEvtGrp.EVENT_GROUP_ID = 40 THEN 'Behavior' + ELSE 'Unknown' END) AS type, (CASE WHEN anmEvt.DIAGNOSIS IS NOT NULL THEN (anmCmt.TEXT || ';' || anmEvt.DIAGNOSIS) ELSE anmCmt.TEXT END) AS remark, From 08aed9c4f3aa8bee506804a162106b7a24372f86 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Fri, 18 Apr 2025 09:22:56 -0700 Subject: [PATCH 5/9] Fix casing issue when adding Animal Ids from Batch on Birth and Arrival forms. --- .../web/nirc_ehr/window/AddAnimalsWindow.js | 41 +++++++++++++++++++ .../dataentry/form/NIRCBirthFormType.java | 1 + .../section/NIRCBirthFormSection.java | 18 ++++++-- .../table/NIRC_EHRSharedDatasetTrigger.java | 2 +- 4 files changed, 58 insertions(+), 4 deletions(-) diff --git a/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js b/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js index 07cea917..25774e3f 100644 --- a/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js +++ b/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js @@ -6,6 +6,47 @@ Ext4.define('NIRC_EHR.window.AddAnimalsWindow', { this.callParent(arguments); }, + addSubjects: function(subjectList){ + if (subjectList.length && this.targetStore){ + var date = this.down('#dateField').getValue(); + var choose = this.down('#chooseValues').getValue(); + + subjectList = Ext4.Array.unique(subjectList); + if (subjectList.length > this.MAX_ANIMALS){ + Ext4.Msg.alert('Error', 'Too many animals were returned: ' + subjectList.length); + return; + } + + var records = []; + Ext4.Array.forEach(subjectList, function(s){ + var model = Ext4.isObject(s) ? s : {Id: s.toUpperCase()}; //This is required if adding Animals via Add Batch functionality. Otherwise it throws an error. + if (date) { + model.date = date; + } + + records.push(this.targetStore.createModel(model)); + }, this); + + if (choose){ + Ext4.create('EHR.window.BulkEditWindow', { + suppressConfirmMsg: true, + records: records, + targetStore: this.targetStore, + formConfig: this.formConfig + }).show(); + this.close(); + } + else { + this.targetStore.add(records); + } + } + + if (Ext4.Msg.isVisible()) + Ext4.Msg.hide(); + + this.close(); + }, + locationHandler: function(){ var form = this.resetFormFields(true); form.add([{ diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java index 7e4279b6..bd170279 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/form/NIRCBirthFormType.java @@ -30,6 +30,7 @@ public NIRCBirthFormType (DataEntryFormContext ctx, Module owner) addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/plugin/RowEditor.js")); addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/model/sources/NIRCDefault.js")); addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/model/sources/Birth.js")); + addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/AddAnimalsWindow.js")); for (FormSection s : getFormSections()) { diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java index 72c680ed..22c741a8 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java @@ -41,9 +41,21 @@ protected List getFieldKeys(TableInfo ti) @Override public List getTbarButtons() { - List defaults = super.getTbarButtons(); - defaults.remove("COPYFROMSECTION"); - return defaults; + List defaultButtons = super.getTbarButtons(); + + int idx = defaultButtons.indexOf("ADDANIMALS"); + if (idx > -1) + { + defaultButtons.remove(idx); + defaultButtons.add(idx, "NIRC_ADDANIMALS"); + } + + idx = defaultButtons.indexOf("COPYFROMSECTION"); + if (idx > -1) + { + defaultButtons.remove(idx); + } + return defaultButtons; } @Override diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/table/NIRC_EHRSharedDatasetTrigger.java b/nirc_ehr/src/org/labkey/nirc_ehr/table/NIRC_EHRSharedDatasetTrigger.java index a7c9c3c9..707796c9 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/table/NIRC_EHRSharedDatasetTrigger.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/table/NIRC_EHRSharedDatasetTrigger.java @@ -16,7 +16,7 @@ public class NIRC_EHRSharedDatasetTrigger implements Trigger { private void transformAnimalIdToUpperCase(Map row) { - if (row != null && row.containsValue("Id")) + if (row != null && row.containsKey("Id")) { row.put("Id", ((String) row.get("Id")).toUpperCase()); } From cc4eab2356c578a3cb6424fdd3f2da25700f78a3 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Fri, 18 Apr 2025 21:24:28 -0700 Subject: [PATCH 6/9] Handle setting Animal Id to uppercase via 'Add Batch' and More Actions > Add From File --- .../web/nirc_ehr/window/AddAnimalsWindow.js | 42 +------------------ .../web/nirc_ehr/window/FormBulkAddWindow.js | 24 +++++++++++ .../dataentry/section/BaseFormSection.java | 5 ++- .../section/NIRCBirthFormSection.java | 4 ++ 4 files changed, 33 insertions(+), 42 deletions(-) create mode 100644 nirc_ehr/resources/web/nirc_ehr/window/FormBulkAddWindow.js diff --git a/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js b/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js index 25774e3f..f0e939fd 100644 --- a/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js +++ b/nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js @@ -1,52 +1,12 @@ Ext4.define('NIRC_EHR.window.AddAnimalsWindow', { extend: 'EHR.window.AddAnimalsWindow', + upperCaseAnimalId: true, initComponent: function(){ this.callParent(arguments); }, - addSubjects: function(subjectList){ - if (subjectList.length && this.targetStore){ - var date = this.down('#dateField').getValue(); - var choose = this.down('#chooseValues').getValue(); - - subjectList = Ext4.Array.unique(subjectList); - if (subjectList.length > this.MAX_ANIMALS){ - Ext4.Msg.alert('Error', 'Too many animals were returned: ' + subjectList.length); - return; - } - - var records = []; - Ext4.Array.forEach(subjectList, function(s){ - var model = Ext4.isObject(s) ? s : {Id: s.toUpperCase()}; //This is required if adding Animals via Add Batch functionality. Otherwise it throws an error. - if (date) { - model.date = date; - } - - records.push(this.targetStore.createModel(model)); - }, this); - - if (choose){ - Ext4.create('EHR.window.BulkEditWindow', { - suppressConfirmMsg: true, - records: records, - targetStore: this.targetStore, - formConfig: this.formConfig - }).show(); - this.close(); - } - else { - this.targetStore.add(records); - } - } - - if (Ext4.Msg.isVisible()) - Ext4.Msg.hide(); - - this.close(); - }, - locationHandler: function(){ var form = this.resetFormFields(true); form.add([{ diff --git a/nirc_ehr/resources/web/nirc_ehr/window/FormBulkAddWindow.js b/nirc_ehr/resources/web/nirc_ehr/window/FormBulkAddWindow.js new file mode 100644 index 00000000..283d80ee --- /dev/null +++ b/nirc_ehr/resources/web/nirc_ehr/window/FormBulkAddWindow.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * @cfg targetStore + */ + +EHR.DataEntryUtils.registerGridButton('NIRC_FORM_BULK_ADD', function(config){ + return Ext4.Object.merge({ + text: 'Add From File', + tooltip: 'Click to bulk import records from an Excel or TSV file.', + handler: function(btn){ + const grid = btn.up('grid'); + LDK.Assert.assertNotEmpty('Unable to find grid in FORM_BULK_ADD button', grid); + + Ext4.create('EHR.window.FormBulkAddWindow', { + targetStore: grid.store, + upperCaseAnimalId: true, + }).show(); + } + }); +}); diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/BaseFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/BaseFormSection.java index 59ff77ad..5c6ea9a5 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/BaseFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/BaseFormSection.java @@ -70,6 +70,9 @@ public BaseFormSection(String schemaName, String queryName, String label, String addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/AddAnimalsWindow.js")); addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/field/LocationField.js")); addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/CopyFromSectionWindow.js")); + addClientDependency(ClientDependency.supplierFromPath("ehr/window/FormBulkAddWindow.js")); + addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/FormBulkAddWindow.js")); + setSupportFormSort(false); } @@ -105,7 +108,7 @@ public List getTbarMoreActionButtons() { List defaultButtons = super.getTbarMoreActionButtons(); defaultButtons.remove("GUESSPROJECT"); -// defaultButtons.add("FORM_BULK_ADD"); + defaultButtons.add("NIRC_FORM_BULK_ADD"); return defaultButtons; } diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java index 22c741a8..b58ce768 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java @@ -5,6 +5,7 @@ import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.forms.NewAnimalFormSection; import org.labkey.api.query.FieldKey; +import org.labkey.api.view.template.ClientDependency; import java.util.List; @@ -13,6 +14,8 @@ public class NIRCBirthFormSection extends NewAnimalFormSection public NIRCBirthFormSection() { super("study", "birth", "Births", false); + addClientDependency(ClientDependency.supplierFromPath("ehr/window/FormBulkAddWindow.js")); + addClientDependency(ClientDependency.supplierFromPath("nirc_ehr/window/FormBulkAddWindow.js")); } @Override @@ -63,6 +66,7 @@ public List getTbarMoreActionButtons() { List defaultButtons = super.getTbarMoreActionButtons(); defaultButtons.remove("GUESSPROJECT"); + defaultButtons.add("NIRC_FORM_BULK_ADD"); return defaultButtons; } } \ No newline at end of file From e162fc4c686384af94c5b975e9fac11d63a317ec Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Tue, 22 Apr 2025 09:43:17 -0700 Subject: [PATCH 7/9] Code review updates --- nirc_ehr/resources/data/observation_types.tsv | 4 ++-- nirc_ehr/resources/data/wound_status_behavior.tsv | 3 ++- .../nirc_ehr/dataentry/section/NIRCBirthFormSection.java | 7 +------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/nirc_ehr/resources/data/observation_types.tsv b/nirc_ehr/resources/data/observation_types.tsv index d6f4a37d..aab145df 100644 --- a/nirc_ehr/resources/data/observation_types.tsv +++ b/nirc_ehr/resources/data/observation_types.tsv @@ -46,5 +46,5 @@ Temperament Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","quer Vaginal/Uterine Prolapse {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"vaginal_uterine_prolapse","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups vaginal_uterine_prolapse value Verified Id? {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"yes_no_order","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups yes_no_order value Wound Severity Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_severity","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_severity value -Wound Status Behavior Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_behavior","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_behavior value -Wound Status Clinical Clinical {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_clinical","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_clinical value \ No newline at end of file +Wound Status Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_behavior","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_behavior value +Clinical Wound Status {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status_clinical","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups wound_status_clinical value \ No newline at end of file diff --git a/nirc_ehr/resources/data/wound_status_behavior.tsv b/nirc_ehr/resources/data/wound_status_behavior.tsv index 91514b44..c3dbc444 100644 --- a/nirc_ehr/resources/data/wound_status_behavior.tsv +++ b/nirc_ehr/resources/data/wound_status_behavior.tsv @@ -1,4 +1,5 @@ value sort_order Completely healed 1 Mostly healed 2 -Not healed 3 \ No newline at end of file +Partially healed 3 +Not healed 4 \ No newline at end of file diff --git a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java index b58ce768..5ebfcd5c 100644 --- a/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java +++ b/nirc_ehr/src/org/labkey/nirc_ehr/dataentry/section/NIRCBirthFormSection.java @@ -52,12 +52,7 @@ public List getTbarButtons() defaultButtons.remove(idx); defaultButtons.add(idx, "NIRC_ADDANIMALS"); } - - idx = defaultButtons.indexOf("COPYFROMSECTION"); - if (idx > -1) - { - defaultButtons.remove(idx); - } + defaultButtons.remove("COPYFROMSECTION"); return defaultButtons; } From ab52e93e6e5ae9a2244b1b28e8f08654e47e9532 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Tue, 22 Apr 2025 10:20:24 -0700 Subject: [PATCH 8/9] Update cases ETL to consolidate openDiagnosis and closeDiagnosis under openRemark and closeRemark respectively; plus related changes. --- nirc_ehr/resources/queries/dbo/q_cases.sql | 18 ++++++++++++++---- .../study/cases/All Clinical Cases.qview.xml | 2 -- .../study/datasets/datasets_metadata.xml | 8 -------- .../nirc_ehr/model/sources/BehavioralCase.js | 6 ------ .../web/nirc_ehr/model/sources/ClinicalCase.js | 6 ------ .../nirc_ehr/model/sources/ClinicalDefaults.js | 6 ------ 6 files changed, 14 insertions(+), 32 deletions(-) diff --git a/nirc_ehr/resources/queries/dbo/q_cases.sql b/nirc_ehr/resources/queries/dbo/q_cases.sql index f9313665..dd5a957f 100644 --- a/nirc_ehr/resources/queries/dbo/q_cases.sql +++ b/nirc_ehr/resources/queries/dbo/q_cases.sql @@ -8,10 +8,20 @@ SELECT * FROM ( THEN 'unknown' ELSE (trim(anmEvt.STAFF_ID.STAFF_FIRST_NAME) || '|' || trim(anmEvt.STAFF_ID.STAFF_LAST_NAME)) END) AS performedby, - (CASE WHEN anmEvt.EVENT_ID = 1580 THEN anmCmt.TEXT ELSE NULL END) AS openRemark, - (CASE WHEN anmEvt.EVENT_ID = 1677 THEN anmCmt.TEXT ELSE NULL END) AS closeRemark, - (CASE WHEN anmEvt.EVENT_ID = 1580 THEN anmEvt.DIAGNOSIS ELSE NULL END) AS openDiagnosis, - (CASE WHEN anmEvt.EVENT_ID = 1677 THEN anmEvt.DIAGNOSIS ELSE NULL END) AS closeDiagnosis, + (CASE + WHEN anmEvt.EVENT_ID = 1580 + THEN 'Open Remark: ' || + (CASE WHEN anmCmt.TEXT IS NULL THEN 'None' ELSE anmCmt.TEXT END) || + '; Open Diagnosis: ' || + (CASE WHEN anmEvt.DIAGNOSIS IS NULL THEN 'None' ELSE anmEvt.DIAGNOSIS END) + END) AS openRemark, + (CASE + WHEN anmEvt.EVENT_ID = 1677 + THEN 'Close Remark: ' || + (CASE WHEN anmCmt.TEXT IS NULL THEN 'None' ELSE anmCmt.TEXT END) || + '; Close Diagnosis: ' || + (CASE WHEN anmEvt.DIAGNOSIS IS NULL THEN 'None' ELSE anmEvt.DIAGNOSIS END) + END) AS closeRemark, COALESCE(dea.deathDate, dep.eventDate) AS enddate, anmEvt.EVENT_ID.NAME AS category, CASE diff --git a/nirc_ehr/resources/queries/study/cases/All Clinical Cases.qview.xml b/nirc_ehr/resources/queries/study/cases/All Clinical Cases.qview.xml index 38e4ed5e..70c5f5bb 100644 --- a/nirc_ehr/resources/queries/study/cases/All Clinical Cases.qview.xml +++ b/nirc_ehr/resources/queries/study/cases/All Clinical Cases.qview.xml @@ -23,8 +23,6 @@ - - diff --git a/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml b/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml index 3c70879e..277987f0 100644 --- a/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml +++ b/nirc_ehr/resources/referenceStudy/study/datasets/datasets_metadata.xml @@ -1127,14 +1127,6 @@ Case category varchar - - Open Diagnosis - varchar - - - Close Diagnosis - varchar - Open Remark varchar diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/BehavioralCase.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/BehavioralCase.js index 948eb813..89a6dce4 100644 --- a/nirc_ehr/resources/web/nirc_ehr/model/sources/BehavioralCase.js +++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/BehavioralCase.js @@ -91,12 +91,6 @@ EHR.model.DataModelManager.registerMetadata('BehavioralCase', { qcstate: { hidden: true }, - openDiagnosis: { - hidden: true - }, - closeDiagnosis: { - hidden: true - }, attachmentFile: { hidden: true }, diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalCase.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalCase.js index 29af7961..44b15645 100644 --- a/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalCase.js +++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalCase.js @@ -91,12 +91,6 @@ EHR.model.DataModelManager.registerMetadata('ClinicalCase', { qcstate: { hidden: true }, - openDiagnosis: { - hidden: true - }, - closeDiagnosis: { - hidden: true - }, attachmentFile: { hidden: true }, diff --git a/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalDefaults.js b/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalDefaults.js index c67457a4..6d9d0043 100644 --- a/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalDefaults.js +++ b/nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalDefaults.js @@ -139,12 +139,6 @@ EHR.model.DataModelManager.registerMetadata('ClinicalDefaults', { qcstate: { hidden: true }, - openDiagnosis: { - hidden: true - }, - closeDiagnosis: { - hidden: true - }, attachmentFile: { hidden: true }, From 3d0a3475dd4e47462f49acb17e93286f58a26b04 Mon Sep 17 00:00:00 2001 From: Binal Patel Date: Tue, 22 Apr 2025 12:37:07 -0700 Subject: [PATCH 9/9] Add a comment explaining why DefaultEHRCustomizer is not used for this view, given that there might be future updates involving Buildings. --- nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml b/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml index 589c89a9..d48f87e4 100644 --- a/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml +++ b/nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml @@ -3,6 +3,11 @@
Buildings + + Area