Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nirc_ehr/resources/data/editable_lookups.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
3 changes: 2 additions & 1 deletion nirc_ehr/resources/data/lookup_sets.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion nirc_ehr/resources/data/lookupsManifest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ volume_units
weight_ranges
wound_score
wound_severity
wound_status
wound_status_behavior
wound_status_clinical
yes_no_order
3 changes: 2 additions & 1 deletion nirc_ehr/resources/data/lookupsManifestTest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@ volume_units
weight_ranges
wound_score
wound_severity
wound_status
wound_status_behavior
wound_status_clinical
yes_no_order
3 changes: 2 additions & 1 deletion nirc_ehr/resources/data/observation_types.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
5 changes: 5 additions & 0 deletions nirc_ehr/resources/data/wound_status_behavior.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
value sort_order
Completely healed 1
Mostly healed 2
Partially healed 3
Not healed 4
18 changes: 14 additions & 4 deletions nirc_ehr/resources/queries/dbo/q_cases.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions nirc_ehr/resources/queries/dbo/q_observations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion nirc_ehr/resources/queries/ehr_lookups/buildings.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<tables xmlns="http://labkey.org/data/xml">
<table tableName="buildings" tableDbType="TABLE">
<tableTitle>Buildings</tableTitle>
<javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this removed for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we display Building's Description column (labeled as 'Building'), there is a fixed width set on Description in DefaultEHRCustomizer, causing the column width to be unusually wide.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our discussion, I've added this back and commented it out with a comment so we know why we are not using DefaultEHRCustomizer since there is a possibility of some work around Buildings.

<!-- Commenting out DefaultEHRCustomizer here because it does a shared customization on the
'Description' (labeled as 'Building' in NIRC for 'buildings' view) and sets a fixed width,
which causes the column to appear unusually wide.
Update when we do Buildings related customizations in the future -->
<!-- <javaCustomizer class="org.labkey.ehr.table.DefaultEHRCustomizer" />-->
<columns>
<column columnName="area">
<columnTitle>Area</columnTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
<column name="openRemark"/>
<column name="plan"/>
<column name="closeRemark"/>
<column name="openDiagnosis"/>
<column name="closeDiagnosis"/>
</columns>
<filters>
<filter column="category" operator="eq" value="Clinical"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<column name="observationRecord"/>
<column name="Id"/>
<column name="Id/Demographics/species"/>
<column name="Id/curLocation/room"/>
<column name="Id/curLocation/room/floor/building"/>
<column name="Id/curLocation/cage"/>
<column name="scheduledDate"/>
<column name="observationList"/>
<column name="observationStatus"/>
</columns>
<sorts>
<sort column="scheduledDate"/>
<sort column="Id/curLocation/room"/>
<sort column="Id/curLocation/room/floor/building"/>
<sort column="Id/curLocation/cage"/>
</sorts>
</customView>
4 changes: 2 additions & 2 deletions nirc_ehr/resources/queries/study/prcSchedule/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<column name="procedureRecord"/>
<column name="Id"/>
<column name="Id/Demographics/species"/>
<column name="Id/curLocation/room"/>
<column name="Id/curLocation/room/floor/building"/>
<column name="Id/curLocation/cage"/>
<column name="date"/>
<column name="procedure"/>
Expand All @@ -17,7 +17,7 @@
</filters>
<sorts>
<sort column="status" descending="false"/>
<sort column="Id/curLocation/room"/>
<sort column="Id/curLocation/room/floor/building"/>
<sort column="Id/curLocation/cage"/>
</sorts>
</customView>
4 changes: 2 additions & 2 deletions nirc_ehr/resources/queries/study/treatmentSchedule/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<column name="treatmentRecord"/>
<column name="Id"/>
<column name="Id/Demographics/species"/>
<column name="Id/curLocation/room"/>
<column name="Id/curLocation/room/floor/building"/>
<column name="Id/curLocation/cage"/>

<column name="date"/>
Expand All @@ -22,7 +22,7 @@
</columns>
<sorts>
<sort column="date"/>
<sort column="Id/curLocation/room"/>
<sort column="Id/curLocation/room/floor/building"/>
<sort column="Id/curLocation/cage"/>
</sorts>
<filters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1127,14 +1127,6 @@
<columnTitle>Case category</columnTitle>
<datatype>varchar</datatype>
</column>
<column columnName="openDiagnosis">
<columnTitle>Open Diagnosis</columnTitle>
<datatype>varchar</datatype>
</column>
<column columnName="closeDiagnosis">
<columnTitle>Close Diagnosis</columnTitle>
<datatype>varchar</datatype>
</column>
<column columnName="openRemark">
<columnTitle>Open Remark</columnTitle>
<datatype>varchar</datatype>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ EHR.model.DataModelManager.registerMetadata('BehavioralCase', {
qcstate: {
hidden: true
},
openDiagnosis: {
hidden: true
},
closeDiagnosis: {
hidden: true
},
attachmentFile: {
hidden: true
},
Expand Down
6 changes: 0 additions & 6 deletions nirc_ehr/resources/web/nirc_ehr/model/sources/ClinicalCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,6 @@ EHR.model.DataModelManager.registerMetadata('ClinicalCase', {
qcstate: {
hidden: true
},
openDiagnosis: {
hidden: true
},
closeDiagnosis: {
hidden: true
},
attachmentFile: {
hidden: true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@ EHR.model.DataModelManager.registerMetadata('ClinicalDefaults', {
qcstate: {
hidden: true
},
openDiagnosis: {
hidden: true
},
closeDiagnosis: {
hidden: true
},
attachmentFile: {
hidden: true
},
Expand Down
1 change: 1 addition & 0 deletions nirc_ehr/resources/web/nirc_ehr/window/AddAnimalsWindow.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

Ext4.define('NIRC_EHR.window.AddAnimalsWindow', {
extend: 'EHR.window.AddAnimalsWindow',
upperCaseAnimalId: true,

initComponent: function(){
this.callParent(arguments);
Expand Down
24 changes: 24 additions & 0 deletions nirc_ehr/resources/web/nirc_ehr/window/FormBulkAddWindow.js
Original file line number Diff line number Diff line change
@@ -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();
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -105,7 +108,7 @@ public List<String> getTbarMoreActionButtons()
{
List<String> defaultButtons = super.getTbarMoreActionButtons();
defaultButtons.remove("GUESSPROJECT");
// defaultButtons.add("FORM_BULK_ADD");
defaultButtons.add("NIRC_FORM_BULK_ADD");
return defaultButtons;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down Expand Up @@ -41,16 +44,24 @@ protected List<FieldKey> getFieldKeys(TableInfo ti)
@Override
public List<String> getTbarButtons()
{
List<String> defaults = super.getTbarButtons();
defaults.remove("COPYFROMSECTION");
return defaults;
List<String> defaultButtons = super.getTbarButtons();

int idx = defaultButtons.indexOf("ADDANIMALS");
if (idx > -1)
{
defaultButtons.remove(idx);
defaultButtons.add(idx, "NIRC_ADDANIMALS");
}
defaultButtons.remove("COPYFROMSECTION");
return defaultButtons;
}

@Override
public List<String> getTbarMoreActionButtons()
{
List<String> defaultButtons = super.getTbarMoreActionButtons();
defaultButtons.remove("GUESSPROJECT");
defaultButtons.add("NIRC_FORM_BULK_ADD");
return defaultButtons;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class NIRC_EHRSharedDatasetTrigger implements Trigger
{
private void transformAnimalIdToUpperCase(Map<String, Object> row)
{
if (row != null && row.containsValue("Id"))
if (row != null && row.containsKey("Id"))
{
row.put("Id", ((String) row.get("Id")).toUpperCase());
}
Expand Down