Skip to content

Commit

Permalink
Behavior cases feedback (#434)
Browse files Browse the repository at this point in the history
* Alopecia workflow
* SIB workflow
* Auto open/close obs orders with cases
* Additional behavior reports
* Behavior rounds form
* Incomplete observations/treatments
  • Loading branch information
labkey-martyp authored Nov 7, 2024
1 parent 948c7ca commit 5dee102
Show file tree
Hide file tree
Showing 49 changed files with 637 additions and 127 deletions.
31 changes: 6 additions & 25 deletions nirc_ehr/resources/data/alopecia_score.tsv
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
value sort_order description Date Disabled
0% 1
1% 2
9% 3
10% 4
18% 5
19% 6
27% 7
28% 8
36% 9
37% 10
45% 11
46% 12
54% 13
55% 14
63% 15
64% 16
72% 17
73% 18
81% 19
82% 20
90% 21
91% 22
99% 23
100% 24
value title sort_order description Date Disabled
Very good coat condition (1) Very good coat condition (1) 1
1-25% hair loss (2) 1-25% hair loss (2) 2
25-50% hair loss (3) 25-50% hair loss (3) 3
More than 50% (4) More than 50% (4) 4
Completely bald (5) Completely bald (5) 5
18 changes: 9 additions & 9 deletions nirc_ehr/resources/data/bcs_score.tsv
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
value title category description sort_order date_disabled
1 Emaciated
1.5 Very Thin
2 Thin
2.5 Lean
3 Optimum
3.5 Slightly Overweight
4 Heavy
4.5 Obese
5 Grossly Obese
Emaciated (1) 1
Very Thin (1.5) 2
Thin (2) 3
Lean (2.5) 4
Optimum (3) 5
Slightly Overweight (3.5) 6
Heavy (4) 7
Obese (4.5) 8
Grossly Obese (5) 9
4 changes: 4 additions & 0 deletions nirc_ehr/resources/data/behavior_mgmt_codes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
value title sort_order description Date Disabled
No Fleece Tube No Fleece Tube 1
Fleece Tube Fleece Tube 2
Wood Wood 3
13 changes: 13 additions & 0 deletions nirc_ehr/resources/data/daily_enrich_codes.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
value title sort_order description Date Disabled
Cone Cone 1
Cap Feeder Cap Feeder 2
Blind Forager Blind Forager 3
Dried Fruit Dried Fruit 4
Forage on Board Forage on Board 5
Forage Tray Forage Tray 6
Produce Produce 7
Paper Burrito Paper Burrito 8
Puzzle Feeder Puzzle Feeder 9
Paper Paper 10
Fleece Tube Replaced Fleece Tube Replaced 11
Other Other 12
7 changes: 6 additions & 1 deletion nirc_ehr/resources/data/editable_lookups.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ arrival_type Colony Management Arrival Type Types of arrivals.
arthritis_types Clinical Arthritis Types Clinical observation fixed values.
att_score Behavior Attitude Score Behavior observation fixed values.
bcs_score Clinical Body Condition Score Clinical observation fixed values.
behavior_mgmt_codes Behavior Behavior Managment Codes Behavior observation fixed values.
behavior_types Behavior Behavior Types Behavior observation fixed values.
blood_draw_reason Clinical Blood Draw Reason Used in blood draw datasets.
blood_draw_tube_type Clinical Blood Draw Tube Type Used in blood draw datasets.
Expand All @@ -28,6 +29,7 @@ cost_center Colony Management Cost Center
cost_type Colony Management Cost Type
country Colony Management Country
country_category Colony Management Country Category
daily_enrich_codes Behavior Daily enrichment codes.
data_category Clinical Data Categories Used in datasets.
death_reason Colony Management Death Reason
delivery_state Colony Management Delivery State
Expand All @@ -36,6 +38,7 @@ dental_trauma Clinical Dental Trauma Clinical observation fixed values.
digit_amputation Clinical Digit Amputation Clinical observation fixed values.
divider_types Colony Management Divider Type Used in cage details.
dosage_units Clinical Dosage Units Used in drug and treatment datasets.
drug_defaults Clinical Formulary Default values in drug and treatment datasets.
ear_types Clinical Ear Types Clinical observation fixed values.
esig_events Colony Management Esig Events
euthanasia_type Colony Management Euthanasia Type
Expand Down Expand Up @@ -114,4 +117,6 @@ vendor_production_location Colony Management Vendor Production Location
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.
yesno Clinical Yes/No Values Used for yes/no values in various datasets
wound_severity Clinical Wound Severity Clinical observation fixed values.
wound_status 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.
6 changes: 5 additions & 1 deletion nirc_ehr/resources/data/lookup_sets.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ arrival_type Arrival Type value
arthritis_types Arthritis Types value
att_score Attitude Score value
bcs_score BCS Store value title
behavior_mgmt_codes Behavior Management Codes value
behavior_types Behavior Types value
blood_draw_reason Blood Draw Reason value
blood_sample_type Blood Sample Types value
Expand All @@ -22,6 +23,7 @@ cost_center Cost Center value title
cost_type Cost Type value title
country Country value title
country_category Country Category value title
daily_enrich_codes Daily Enrichment Codes value
data_category Data Category Field Values value
death_reason Death Reason value
delivery_state Delivery State value title
Expand Down Expand Up @@ -96,4 +98,6 @@ vendor_approval_code Vendor Approval Code value title
vendor_production_location Vendor Production Location value title
weight_ranges Weight Ranges value
wound_score Wound Score value
yesno Yes/No Values value
wound_severity Wound Severity value
wound_status Wound Status value
yes_no_order Yes/No Values in Order value
6 changes: 5 additions & 1 deletion nirc_ehr/resources/data/lookupsManifest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ arrival_type
arthritis_types
att_score
bcs_score
behavior_mgmt_codes
behavior_types
blood_draw_reason
blood_draw_tube_type
Expand All @@ -25,6 +26,7 @@ conc_units
cost_type
country
country_category
daily_enrich_codes
data_category
death_reason
delivery_state
Expand Down Expand Up @@ -107,4 +109,6 @@ vendor_production_location
volume_units
weight_ranges
wound_score
yesno
wound_severity
wound_status
yes_no_order
6 changes: 5 additions & 1 deletion nirc_ehr/resources/data/lookupsManifestTest.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ app_score
arrival_type
arthritis_types
bcs_score
behavior_mgmt_codes
behavior_types
blood_draw_reason
blood_draw_tube_type
Expand All @@ -24,6 +25,7 @@ congenital_abnormalities
cost_type
country
country_category
daily_enrich_codes
data_category
death_reason
delivery_state
Expand Down Expand Up @@ -109,4 +111,6 @@ vendor_production_location
volume_units
weight_ranges
wound_score
yesno
wound_severity
wound_status
yes_no_order
15 changes: 12 additions & 3 deletions nirc_ehr/resources/data/observation_types.tsv
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
value category editorconfig schemaName queryName valueColumn
Alopecia Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_score","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_score value
Alopecia Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"alopecia_score","forceSelection":true,"displayField":"title","valueField":"value","sortFields":"sort_order"} ehr_lookups alopecia_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
Behavior Managment Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"behavior_mgmt_codes","forceSelection":true,"displayField":"title","valueField":"value","sortFields":"sort_order"} ehr_lookups behavior_mgmt_codes value
Daily Enrichment Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"daily_enrich_codes","forceSelection":true,"displayField":"title","valueField":"value","sortFields":"sort_order"} ehr_lookups daily_enrich_codes value
Self Biting Observed Behavior {"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
New Injury Observed Behavior {"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
Other Stereotopy Behavior {"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
Environmental Change Behavior {"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
Special Enrichment Behavior {"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
Preferences Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"preferences","displayField":"value","valueField":"value"} ehr_lookups preferences value
Temperament Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"temperament","displayField":"value","valueField":"value"} ehr_lookups temperament value
BCS {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"bcs_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups bcs_score value
Expand All @@ -22,7 +29,7 @@ TB TST Score (Day 2) {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","que
TB TST Score (Day 3) {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"tb_obs_score","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups tb_obs_score value
Auscultation {"xtype":"textfield"}
Abdominal Palpation {"xtype":"textfield"}
Pregnant {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"yesno","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups yesno value
Pregnant {"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
Dental Disease {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"dental_disease","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups dental_disease value
Congenital Abnormalities {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"congenital_abnormalities","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups congenital_abnormalities value
Urine {"xtype":"textfield"}
Expand All @@ -31,6 +38,8 @@ Gait/Posture {"xtype":"textfield"}
Digit Amputation {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"digit_amputation","displayField":"value","valueField":"value"}
Dental Trauma {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"dental_trauma","displayField":"value","valueField":"value","sortFields":"sort_order"}
Wound Score {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_score","displayField":"value","valueField":"value","sortFields":"sort_order"}
Wound Status Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_status","displayField":"value","valueField":"value","sortFields":"sort_order"}
Wound Severity Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"wound_severity","displayField":"value","valueField":"value","sortFields":"sort_order"}
Fecal Score {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"fecal_score","displayField":"value","valueField":"value"} ehr_lookups fecal_score value
Trauma: Laceration {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"trauma_size","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups trauma_size value
Trauma: Degloving {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"trauma_size","displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups trauma_size value
Expand All @@ -56,6 +65,6 @@ Respiratory Tract {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryN
Feed Assessment Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"feed_assess_types","displayField":"value","valueField":"value"} ehr_lookups feed_assess_types value
Stool {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"stool_types","displayField":"value","sortFields":"sort_order","valueField":"value"}
Activity Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"activity","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups activity value
Verified Id? {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"yesno","forceSelection":true,"displayField":"value","valueField":"value","sortFields":"sort_order"} ehr_lookups yesno 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
Turgor {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"turgor_score","displayField":"value","sortFields":"sort_order","valueField":"value"}
SIB Score Behavior {"xtype":"ehr-simplecombo","schemaName":"ehr_lookups","queryName":"sib_score","forceSelection":true,"displayField":"value","valueField":"value"} ehr_lookups sib_score value
1 change: 1 addition & 0 deletions nirc_ehr/resources/data/treatment_frequency.tsv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Meaning Sort Order Week of Month Day of Month Day of Week Interval in Days Short Name Active?
Monthly 30 true
Weekly 7 true
Alternating Days 2 true
SID 1 true
QID 1 true
Expand Down
1 change: 1 addition & 0 deletions nirc_ehr/resources/data/treatment_frequency_times.tsv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Frequency Hour of Day Time Description
SID 800 AM
Monthly 800 AM
Weekly 800 AM
Alternating Days 800 AM
TID 800 AM
TID 1200 PM
Expand Down
6 changes: 6 additions & 0 deletions nirc_ehr/resources/data/wound_severity.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
value sort_order
N/A (0) 1
Superficial (1) 2
Partial Thickness (2) 3
Full Thickness (3) 4
Muscle Damage (4) 5
5 changes: 5 additions & 0 deletions nirc_ehr/resources/data/wound_status.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
value sort_order
Completely Healed (0) 1
Mostly Healed (1) 2
Partially Healed (2) 3
Not Healed (4) 4
4 changes: 4 additions & 0 deletions nirc_ehr/resources/data/yes_no_order.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
value sort_order
Yes 1
No 2
N/A 3
4 changes: 0 additions & 4 deletions nirc_ehr/resources/data/yesno.tsv

This file was deleted.

9 changes: 9 additions & 0 deletions nirc_ehr/resources/queries/ehr_lookups/snomed.query.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="snomed" tableDbType="TABLE">
<tableTitle>Treatments</tableTitle>
</table>
</tables>
</metadata>
</query>
2 changes: 1 addition & 1 deletion nirc_ehr/resources/queries/study/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Even
}

var reopen = oldRow && oldRow.enddate && !row.enddate;
if (!helper.isValidateOnly() && (reopen || helper.getEvent() == 'insert') && row.caseid && row.Id && row.performedby && row.taskid) {
if (!helper.isValidateOnly() && (reopen || helper.getEvent() == 'insert') && row.caseid && row.Id && row.performedby && row.taskid && row.category == 'Clinical') {
var qc;
if (row.QCStateLabel) {
qc = EHR.Server.Security.getQCStateByLabel(row.QCStateLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<column name="caseHistory"/>
<column name="Id"/>
<column name="Id/Demographics/species"/>
<column name="Id/curLocation/room/building"/>
<column name="Id/curLocation/room"/>
<column name="Id/curLocation/cage/room/fullRoom"/>
<column name="Id/curLocation/cage"/>
<column name="date"/>
<column name="reviewdate"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="caseCheck"/>
<column name="caseHistory"/>
<column name="Id"/>
<column name="Id/curLocation/cage">
<properties>
Expand All @@ -22,10 +23,9 @@
<column name="openRemark"/>
<column name="plan"/>
<column name="closeRemark"/>
<column name="caseHistory"/>
</columns>
<filters>
<filter column="enddate" operator="isblank"/>
<filter column="isOpen" operator="eq" value="true"/>
<filter column="category" operator="eq" value="Clinical"/>
</filters>
<sorts>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="caseCheck"/>
<column name="caseHistory"/>
<column name="Id"/>
<column name="Id/curLocation/room"/>
<column name="Id/Demographics/species"/>
<column name="Id/curLocation/cage/room/fullRoom"/>
<column name="Id/curLocation/cage"/>
<column name="date"/>
<column name="reviewdate"/>
<column name="enddate"/>
<column name="Id/demographics/mostRecentHx"/>
<column name="problemCategory"/>
<column name="problemSubcategory"/>
<column name="Id/curLocation/daysInRoom"/>
<column name="remark"/>
<column name="plan"/>
<column name="caseHistory"/>
<column name="taskid"/>
<column name="daysSinceLastVetReview"/>
</columns>
<filters>
<filter column="category" operator="eq" value="Behavior"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<columns>
<column name="caseCheck"/>
<column name="caseHistory"/>
<column name="Id"/>
<column name="Id/curLocation/cage">
<properties>
Expand Down
9 changes: 9 additions & 0 deletions nirc_ehr/resources/queries/study/clinical_observations.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ function onUpsert(helper, scriptErrors, row, oldRow) {
EHR.Server.Utils.addError(scriptErrors, 'remark', "You selected 'No' for 'Verified Id?', please enter Remark", "WARN");
}

if (row.category === "Daily Enrichment" && row.observation === "Other" && !row.remark) {
EHR.Server.Utils.addError(scriptErrors, 'remark', "You selected 'Other' for 'Daily Enrichment', please enter Remark", "WARN");
}

var yesRemarkRequired = (row.category === "Self Biting Observed" || row.category === "New Injury Observed" || row.category === "Other Stereotopy" || row.category === "Environmental Change" || row.category === "Special Enrichment");
if (yesRemarkRequired && row.observation === "Yes" && !row.remark) {
EHR.Server.Utils.addError(scriptErrors, 'remark', "You selected 'Yes' for " + row.category + ", please explain in the Remark", "WARN");
}

// Handle scheduled observations
if (!helper.isValidateOnly() && row.scheduledDate) {
var qc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<column name="QCState"/>
</columns>
<filters>
<filter column="category" operator="eq" value="Behavior"/>
<filter column="type" operator="eq" value="Behavior"/>
</filters>
</customView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<customView xmlns="http://labkey.org/data/xml/queryCustomView">
<sorts>
<sort column="date" descending="true"/>
</sorts>
<columns>
<column name="Id"/>
<column name="date"/>
<column name="area"/>
<column name="observation"/>
<column name="remark"/>
<column name="performedBy"/>
<column name="QCState"/>
</columns>
<filters>
<filter column="type" operator="eq" value="Clinical"/>
</filters>
</customView>
Loading

0 comments on commit 5dee102

Please sign in to comment.