Skip to content

Commit c4214bc

Browse files
Merge 25.3 to develop
2 parents d8ae33b + 0eddb01 commit c4214bc

5 files changed

Lines changed: 96 additions & 4 deletions

File tree

WNPRC_EHR/resources/queries/study/Necropsy Schedule.sql

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,30 @@ SELECT lsid
2222
,shipping_comment AS delivery_comment
2323
,animalid.Demographics.necropsyAbstractNotes.remark AS remark
2424
,CASE
25-
WHEN hasTissuesForAvrl IS NULL
25+
WHEN hasTissuesForAvrl IS NULL
2626
THEN FALSE
2727
ELSE TRUE
2828
END AS has_tissues_for_avrl
29+
,CASE
30+
WHEN hasTissuesForWimr IS NULL
31+
THEN FALSE
32+
ELSE TRUE
33+
END AS has_tissues_for_wimr
34+
,CASE
35+
WHEN hasTissuesForCcourt IS NULL
36+
THEN FALSE
37+
ELSE TRUE
38+
END AS has_tissues_for_ccourt
39+
,CASE
40+
WHEN hasTissuesForBmq IS NULL
41+
THEN FALSE
42+
ELSE TRUE
43+
END AS has_tissues_for_bmq
44+
,CASE
45+
WHEN hasTissuesForElements IS NULL
46+
THEN FALSE
47+
ELSE TRUE
48+
END AS has_tissues_for_elements
2949
,state
3050
FROM (SELECT taskid AS lsid
3151
,taskid.rowid AS taskid
@@ -53,4 +73,29 @@ SELECT lsid
5373
FROM tissue_samples
5474
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_AVRL') -- 'COURIER_AVRL'
5575
GROUP BY taskid) avrl_tissues
56-
ON necropsy.lsid = avrl_tissues.taskid
76+
ON necropsy.lsid = avrl_tissues.taskid
77+
/* Flag necropsies that have tissues that need to be couriered to WIMR. */
78+
LEFT JOIN (SELECT taskid
79+
,TRUE AS hasTissuesForWimr
80+
FROM tissue_samples
81+
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_WIMR') -- 'COURIER_WIMR'
82+
GROUP BY taskid) wimr_tissues
83+
ON necropsy.lsid = wimr_tissues.taskid
84+
LEFT JOIN (SELECT taskid
85+
,TRUE AS hasTissuesForCcourt
86+
FROM tissue_samples
87+
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_CCOURT') -- 'COURIER_WIMR'
88+
GROUP BY taskid) ccourt_tissues
89+
ON necropsy.lsid = ccourt_tissues.taskid
90+
LEFT JOIN (SELECT taskid
91+
,TRUE AS hasTissuesForBmq
92+
FROM tissue_samples
93+
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_BMQ') -- 'COURIER_WIMR'
94+
GROUP BY taskid) bmq_tissues
95+
ON necropsy.lsid = bmq_tissues.taskid
96+
LEFT JOIN (SELECT taskid
97+
,TRUE AS hasTissuesForElements
98+
FROM tissue_samples
99+
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_ELEMENTS') -- 'COURIER_WIMR'
100+
GROUP BY taskid) elements_tissues
101+
ON necropsy.lsid = elements_tissues.taskid

WNPRC_EHR/resources/web/wnprc_ehr/model/sources/Necropsy.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
9696
},
9797
location: {
9898
xtype: 'combo',
99+
allowBlank: false,
99100
lookup: {
100101
schemaName: 'wnprc',
101102
queryName: 'necropsy_suite',
@@ -118,7 +119,7 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
118119
},
119120
performedby: {
120121
xtype: 'combo',
121-
allowBlank: false,
122+
allowBlank: true,
122123
hasOwnTpl: true,
123124
hidden: false,
124125
lookup: {
@@ -365,7 +366,14 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
365366
header: "#",
366367
width: 45
367368
}
368-
}
369+
},
370+
stain: {
371+
defaultValue: null,
372+
editorConfig: {
373+
plugins: ['ldk-usereditablecombo']
374+
},
375+
shownInGrid: false
376+
},
369377
},
370378
'study.histology': {
371379
Id: {

WNPRC_EHR/src/org/labkey/wnprc_ehr/pages/dataentry/NecropsySchedule.jsp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,30 @@
9090
This animal has tissue samples that need to be couried to AVRL.
9191
</div>
9292
<!-- /ko -->
93+
<!-- ko if: has_tissues_for_wimr -->
94+
<div class="alert alert-warning" role="alert">
95+
<span class="glyphicon glyphicon-alert"></span>
96+
This animal has tissue samples that need to be couried to WIMR.
97+
</div>
98+
<!-- /ko -->
99+
<!-- ko if: has_tissues_for_ccourt -->
100+
<div class="alert alert-warning" role="alert">
101+
<span class="glyphicon glyphicon-alert"></span>
102+
This animal has tissue samples that need to be couried to Capitol Court.
103+
</div>
104+
<!-- /ko -->
105+
<!-- ko if: has_tissues_for_bmq -->
106+
<div class="alert alert-warning" role="alert">
107+
<span class="glyphicon glyphicon-alert"></span>
108+
This animal has tissue samples that need to be couried to BMQ.
109+
</div>
110+
<!-- /ko -->
111+
<!-- ko if: has_tissues_for_elements -->
112+
<div class="alert alert-warning" role="alert">
113+
<span class="glyphicon glyphicon-alert"></span>
114+
This animal has tissue samples that need to be couried to Elements.
115+
</div>
116+
<!-- /ko -->
93117

94118

95119
<!-- ko ifnot: taskid() != '' -->
@@ -431,6 +455,10 @@
431455
who_delivers: ko.observable(),
432456
delivery_comment: ko.observable(),
433457
has_tissues_for_avrl: ko.observable(),
458+
has_tissues_for_wimr: ko.observable(),
459+
has_tissues_for_ccourt: ko.observable(),
460+
has_tissues_for_bmq: ko.observable(),
461+
has_tissues_for_elements: ko.observable(),
434462
project: ko.observable(),
435463
protocol: ko.observable(),
436464
sex: ko.observable(),

WNPRC_EHR/src/org/labkey/wnprc_ehr/schemas/SqlQueryReferencePoints.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@ public class SqlQueryReferencePoints {
2525
*/
2626
@Queryable
2727
public static final String COURIER_TO_AVRL = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_AVRL.name();
28+
@Queryable
29+
public static final String COURIER_TO_WIMR = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_WIMR.name();
30+
@Queryable
31+
public static final String COURIER_TO_CCOURT = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_CCOURT.name();
32+
@Queryable
33+
public static final String COURIER_TO_BMQ = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_BMQ.name();
34+
@Queryable
35+
public static final String COURIER_TO_ELEMENTS = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_ELEMENTS.name();
2836
}

WNPRC_EHR/src/org/labkey/wnprc_ehr/schemas/enum_lookups/NecropsySampleDeliveryDestination.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public enum SampleDeliveryDestination {
5454
PICK_UP ("Pick Up", "", null),
5555
COURIER_AVRL ("Courier to AVRL", "", null),
5656
COURIER_WIMR ("Courier to WIMR", "", null),
57+
COURIER_CCOURT ("Courier to CCourt", "", null),
58+
COURIER_BMQ ("Courier to BMQ", "", null),
59+
COURIER_ELEMENTS ("Courier to Elements", "", null),
5760
FEDEX ("FedEx", "", null),
5861
UPS ("UPS", "", null),
5962
OTHER ("Other", "", null);

0 commit comments

Comments
 (0)