diff --git a/api/src/Page/Sample.php b/api/src/Page/Sample.php index 7a79235f0..0c062429b 100644 --- a/api/src/Page/Sample.php +++ b/api/src/Page/Sample.php @@ -43,6 +43,7 @@ class Sample extends Page 'capillaryPhase' => '', 'json' => '', 'dcp' => '\d', + 'pipeline' => '\w+', 'collected_during' => '\w+\d+-\d+', @@ -1174,7 +1175,11 @@ function _samples() $join WHERE $where", $args); $tot = intval($tot[0]['TOT']); - + # Get stats only for a specific processing pipeline + if ($this->has_arg('pipeline')) { + $where .= ' AND (app.processingprograms is null OR app.processingpipelineid is null OR app.processingpipelineid=:' . (sizeof($args) + 1) . ')'; + array_push($args, $this->arg('pipeline')); + } $start = 0; $pp = $this->has_arg('per_page') ? $this->arg('per_page') : 15; diff --git a/client/src/js/modules/shipment/views/containerplate.js b/client/src/js/modules/shipment/views/containerplate.js index fe5cbdb2b..e2fad87fd 100644 --- a/client/src/js/modules/shipment/views/containerplate.js +++ b/client/src/js/modules/shipment/views/containerplate.js @@ -37,6 +37,7 @@ define(['marionette', 'modules/imaging/collections/autoscoreschemas', 'modules/imaging/collections/autoscores', 'collections/users', + 'collections/processingpipelines', 'utils/editable', 'views/table', @@ -74,7 +75,7 @@ define(['marionette', AutoScoreSchemas, AutoScores, Users, - + ProcessingPipelines, Editable, TableView, table, XHRImage, utils, template, templateimage){ @@ -259,6 +260,7 @@ define(['marionette', sampleStatusCurrent: 'input[id=sample_status_current]', param: 'select[name=param]', + pipeline: 'select[name=pipeline]', rank: 'input[name=rank]', sampleStatusAuto: 'input[id=sample_status_auto]', @@ -291,6 +293,7 @@ define(['marionette', 'click @ui.rank': 'setRankStatus', 'change @ui.param': 'setParamValue', + 'change @ui.pipeline': 'setPipeline', 'click @ui.sampleStatusAuto': 'setSampleStatusShown', 'change @ui.class': 'setAutoStatus', @@ -331,6 +334,11 @@ define(['marionette', this.setRankStatus() }, + setPipeline: function() { + this.samples.queryParams.pipeline = this.ui.pipeline.val() + this.samples.fetch({ data: {'sort_by': 'POSITION' } }) + }, + setRankStatus: function() { if (this.ui.rank.is(':checked')) { this.ui.sampleStatusData.prop('checked', true) @@ -629,12 +637,20 @@ define(['marionette', // Assumption all plates are for vmxi, so login => users only this.users.queryParams.login = 1 + this.processing_pipelines = new ProcessingPipelines() + this.processing_pipelines.queryParams.category = 'processing' + this.processing_pipelines.fetch().done(this.updatePipelines.bind(this)) + this.touchstartX = 0; this.touchstartY = 0; Backbone.Validation.bind(this) }, + updatePipelines: function() { + this.ui.pipeline.html(''+this.processing_pipelines.opts()) + }, + updateSchemas: function() { if (this.autoscoreschemas.length === 1) { this.ui.schemaspan.html(this.autoscoreschemas.at(0).get('SCHEMANAME')) diff --git a/client/src/js/templates/shipment/containerplateimage.html b/client/src/js/templates/shipment/containerplateimage.html index 180d26d58..d9d4ea933 100644 --- a/client/src/js/templates/shipment/containerplateimage.html +++ b/client/src/js/templates/shipment/containerplateimage.html @@ -34,13 +34,14 @@