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
49 changes: 47 additions & 2 deletions WNPRC_EHR/resources/queries/study/Necropsy Schedule.sql
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,30 @@ SELECT lsid
,shipping_comment AS delivery_comment
,animalid.Demographics.necropsyAbstractNotes.remark AS remark
,CASE
WHEN hasTissuesForAvrl IS NULL
WHEN hasTissuesForAvrl IS NULL
THEN FALSE
ELSE TRUE
END AS has_tissues_for_avrl
,CASE
WHEN hasTissuesForWimr IS NULL
THEN FALSE
ELSE TRUE
END AS has_tissues_for_wimr
,CASE
WHEN hasTissuesForCcourt IS NULL
THEN FALSE
ELSE TRUE
END AS has_tissues_for_ccourt
,CASE
WHEN hasTissuesForBmq IS NULL
THEN FALSE
ELSE TRUE
END AS has_tissues_for_bmq
,CASE
WHEN hasTissuesForElements IS NULL
THEN FALSE
ELSE TRUE
END AS has_tissues_for_elements
,state
FROM (SELECT taskid AS lsid
,taskid.rowid AS taskid
Expand Down Expand Up @@ -53,4 +73,29 @@ SELECT lsid
FROM tissue_samples
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_AVRL') -- 'COURIER_AVRL'
GROUP BY taskid) avrl_tissues
ON necropsy.lsid = avrl_tissues.taskid
ON necropsy.lsid = avrl_tissues.taskid
/* Flag necropsies that have tissues that need to be couriered to WIMR. */
LEFT JOIN (SELECT taskid
,TRUE AS hasTissuesForWimr
FROM tissue_samples
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_WIMR') -- 'COURIER_WIMR'
GROUP BY taskid) wimr_tissues
ON necropsy.lsid = wimr_tissues.taskid
LEFT JOIN (SELECT taskid
,TRUE AS hasTissuesForCcourt
FROM tissue_samples
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_CCOURT') -- 'COURIER_WIMR'
GROUP BY taskid) ccourt_tissues
ON necropsy.lsid = ccourt_tissues.taskid
LEFT JOIN (SELECT taskid
,TRUE AS hasTissuesForBmq
FROM tissue_samples
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_BMQ') -- 'COURIER_WIMR'
GROUP BY taskid) bmq_tissues
ON necropsy.lsid = bmq_tissues.taskid
LEFT JOIN (SELECT taskid
,TRUE AS hasTissuesForElements
FROM tissue_samples
WHERE ship_to = javaConstant('org.labkey.wnprc_ehr.schemas.SqlQueryReferencePoints.COURIER_TO_ELEMENTS') -- 'COURIER_WIMR'
GROUP BY taskid) elements_tissues
ON necropsy.lsid = elements_tissues.taskid
12 changes: 10 additions & 2 deletions WNPRC_EHR/resources/web/wnprc_ehr/model/sources/Necropsy.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
},
location: {
xtype: 'combo',
allowBlank: false,
lookup: {
schemaName: 'wnprc',
queryName: 'necropsy_suite',
Expand All @@ -118,7 +119,7 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
},
performedby: {
xtype: 'combo',
allowBlank: false,
allowBlank: true,
hasOwnTpl: true,
hidden: false,
lookup: {
Expand Down Expand Up @@ -365,7 +366,14 @@ EHR.model.DataModelManager.registerMetadata('Necropsy', {
header: "#",
width: 45
}
}
},
stain: {
defaultValue: null,
editorConfig: {
plugins: ['ldk-usereditablecombo']
},
shownInGrid: false
},
},
'study.histology': {
Id: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,30 @@
This animal has tissue samples that need to be couried to AVRL.
</div>
<!-- /ko -->
<!-- ko if: has_tissues_for_wimr -->
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-alert"></span>
This animal has tissue samples that need to be couried to WIMR.
</div>
<!-- /ko -->
<!-- ko if: has_tissues_for_ccourt -->
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-alert"></span>
This animal has tissue samples that need to be couried to Capitol Court.
</div>
<!-- /ko -->
<!-- ko if: has_tissues_for_bmq -->
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-alert"></span>
This animal has tissue samples that need to be couried to BMQ.
</div>
<!-- /ko -->
<!-- ko if: has_tissues_for_elements -->
<div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-alert"></span>
This animal has tissue samples that need to be couried to Elements.
</div>
<!-- /ko -->


<!-- ko ifnot: taskid() != '' -->
Expand Down Expand Up @@ -431,6 +455,10 @@
who_delivers: ko.observable(),
delivery_comment: ko.observable(),
has_tissues_for_avrl: ko.observable(),
has_tissues_for_wimr: ko.observable(),
has_tissues_for_ccourt: ko.observable(),
has_tissues_for_bmq: ko.observable(),
has_tissues_for_elements: ko.observable(),
project: ko.observable(),
protocol: ko.observable(),
sex: ko.observable(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ public class SqlQueryReferencePoints {
*/
@Queryable
public static final String COURIER_TO_AVRL = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_AVRL.name();
@Queryable
public static final String COURIER_TO_WIMR = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_WIMR.name();
@Queryable
public static final String COURIER_TO_CCOURT = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_CCOURT.name();
@Queryable
public static final String COURIER_TO_BMQ = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_BMQ.name();
@Queryable
public static final String COURIER_TO_ELEMENTS = NecropsySampleDeliveryDestination.SampleDeliveryDestination.COURIER_ELEMENTS.name();
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public enum SampleDeliveryDestination {
PICK_UP ("Pick Up", "", null),
COURIER_AVRL ("Courier to AVRL", "", null),
COURIER_WIMR ("Courier to WIMR", "", null),
COURIER_CCOURT ("Courier to CCourt", "", null),
COURIER_BMQ ("Courier to BMQ", "", null),
COURIER_ELEMENTS ("Courier to Elements", "", null),
FEDEX ("FedEx", "", null),
UPS ("UPS", "", null),
OTHER ("Other", "", null);
Expand Down