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
11 changes: 11 additions & 0 deletions nbri_ehr/resources/data/flag_categories.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Category Description Enforce Single Flag Per Animal? Omit When Displaying Default Flags? Highlight Flags of This Category? Date Disabled
Behavioral Behavioral observations, abnormal-behavior designations and enrichment provided to the animal. false false false
Capture Restraint and handling limitations. false false true
Clinical Clinical conditions, procedures and veterinary designations. false false false
Experimental Experimental treatments, inoculations and implants. false false true
Genetics Genetic background, ancestry, inbreeding and genomic characterization. false true false
Hold Animal held or reserved for a specific project, investigator or shipment. false false false
Reproduction Breeding, contraception, pregnancy, fostering and rearing designations. false false false
Socially housed Social rank, pairing, group-formation and social-housing-exemption designations. false false false
Status Administrative status and availability designations. false false true
Training Training program participation and progress. false false false
11 changes: 11 additions & 0 deletions nbri_ehr/resources/data/flag_values.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Category Meaning Description Date Disabled ObjectId
Behavioral Behavioral FLAG 1 Behavioral FLAG 1
Capture Capture FLAG 1 Capture FLAG 1
Clinical Clinical FLAG 1 Clinical FLAG 1
Experimental Experimental FLAG 1 Experimental FLAG 1
Genetics Genetics FLAG 1 Genetics FLAG 1
Hold Hold FLAG 1 Hold FLAG 1
Reproduction Reproduction FLAG 1 Reproduction FLAG 1
Socially housed Socially housed FLAG 1 Socially housed FLAG 1
Status Status FLAG 1 Status FLAG 1
Training Training FLAG 1 Training FLAG 1
2 changes: 2 additions & 0 deletions nbri_ehr/resources/data/lookupsManifest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ expense_class
fecal_score
fecal_smear_score
feed_assess_types
flag_categories
flag_values
gastro_types
gender_codes
general_obs
Expand Down
3 changes: 3 additions & 0 deletions nbri_ehr/resources/data/lookupsManifestTest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ amount_units
app_score
arrival_type
arthritis_types
att_score
bandage_observations
bcs_score
behavior_abnormality
Expand Down Expand Up @@ -53,6 +54,8 @@ expense_class
fecal_score
fecal_smear_score
feed_assess_types
flag_categories
flag_values
gastro_types
gender_codes
general_obs
Expand Down
13 changes: 13 additions & 0 deletions nbri_ehr/resources/queries/ehr_lookups/flag_values.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="flag_values" tableDbType="TABLE">
<columns>
<column columnName="value">
<columnTitle>Value</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
4 changes: 2 additions & 2 deletions nbri_ehr/resources/queries/study/flags.query.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<fk>
<fkDbSchema>ehr_lookups</fkDbSchema>
<fkTable>flag_values</fkTable>
<fkColumnName>objectid</fkColumnName>
<fkDisplayColumnName>value</fkDisplayColumnName>
<fkColumnName>value</fkColumnName>
<fkDisplayColumnName>Description</fkDisplayColumnName>
</fk>
</column>
<column columnName="value">
Expand Down
2 changes: 1 addition & 1 deletion nbri_ehr/resources/queries/study/flags/.qview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<column name="date"/>
<column name="enddate"/>
<column name="flag/category"/>
<column name="flag/value"/>
<column name="flag"/>
<column name="remark"/>
<column name="performedby"/>
<column name="taskid"/>
Expand Down
6 changes: 6 additions & 0 deletions nbri_ehr/resources/scripts/nbri_triggers.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ exports.init = function (EHR) {
});
});

EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.INIT, 'study', 'flags', function(event, helper) {
helper.setScriptOptions({
allowFutureDates: true,
});
});

EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.INIT, 'study', 'treatment_order', function(event, helper) {
helper.setScriptOptions({
allowFutureDates: true,
Expand Down
4 changes: 2 additions & 2 deletions nbri_ehr/resources/web/nbri_ehr/model/sources/NBRIDefault.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ EHR.model.DataModelManager.registerMetadata('Default', {
flag: {
allowBlank: false,
lookup: {
columns: 'objectid,value,category,code',
columns: 'objectid,value,description,category,code',
sort: 'category,code,value',
filterArray: [LABKEY.Filter.create('datedisabled', null, LABKEY.Filter.Types.ISBLANK)]
},
Expand All @@ -341,7 +341,7 @@ EHR.model.DataModelManager.registerMetadata('Default', {
allowChooseOther: false
})],
listConfig: {
innerTpl: '{[(values.category ? ("<b>" + LABKEY.Utils.encodeHtml(values.category) + ":</b> ") : "") + LABKEY.Utils.encodeHtml(values.value)]}',
innerTpl: '{[(values.category ? ("<b>" + LABKEY.Utils.encodeHtml(values.category) + ":</b> ") : "") + LABKEY.Utils.encodeHtml(values.description || values.value)]}',
getInnerTpl: function () {
return this.innerTpl;
}
Expand Down
4 changes: 4 additions & 0 deletions nbri_ehr/resources/web/nbri_ehr/panel/SnapshotPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ Ext4.define('NBRI_EHR.panel.SnapshotPanel', {
toSet['flags'] = values.length ? '<a id="nbriFlagsLink">' + values.join('<br>') + '</div>' : null;
},

getFlagDisplayValue: function(row) {
return row['flag/description'] || row['flag/value'];
},

appendAssignments: function(toSet, results){
toSet['projectAssignment'] = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ protected Set<FieldKey> getFieldKeys()
keys.add(FieldKey.fromString("flag"));
keys.add(FieldKey.fromString("flag/category"));
keys.add(FieldKey.fromString("flag/value"));
keys.add(FieldKey.fromString("flag/description"));
keys.add(FieldKey.fromString("performedby"));
keys.add(FieldKey.fromString("remark"));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
objectId Id date enddate flag QCStateLabel performedby
1 TEST3804589 -2187d -2178d 1 Completed 1004
2 TEST4551032 -2243d -2213d 2 Completed 1004
3 TEST5904521 -2215d -2186d 3 Completed 1004
4 TEST1112911 -2215d 4 Completed 1004
5 TEST1112911 -2215d 5 Completed 1004
6 44444 -1423d -560d 3 Completed 1004
7 44444 -1423d -560d 1 Completed 1004
10 44444 -1208d 3 Completed 1004
8 44446 -1208d 3 Completed 1004
9 TSTCP -1423d -560d 3 Completed 1004
1 TEST3804589 -2187d -2178d Behavioral FLAG 1 Completed 1004
2 TEST4551032 -2243d -2213d Capture FLAG 1 Completed 1004
3 TEST5904521 -2215d -2186d Clinical FLAG 1 Completed 1004
4 TEST1112911 -2215d Experimental FLAG 1 Completed 1004
5 TEST1112911 -2215d Genetics FLAG 1 Completed 1004
6 44444 -1423d -560d Clinical FLAG 1 Completed 1004
7 44444 -1423d -560d Behavioral FLAG 1 Completed 1004
10 44444 -1208d Clinical FLAG 1 Completed 1004
8 44446 -1208d Clinical FLAG 1 Completed 1004
9 TSTCP -1423d -560d Clinical FLAG 1 Completed 1004