Class: QcMetric
Defined Under Namespace
Modules: QcState
Constant Summary
collapse
- InvalidValue =
Class.new(StandardError)
- QC_DECISION_TRANSITIONS =
{
'passed' => 'manually_passed',
'manually_passed' => 'manually_passed',
'failed' => 'manually_failed',
'manually_failed' => 'manually_failed'
}.freeze
- PROCEED_TRANSLATION =
{ true => 'Y', false => 'N' }.freeze
Instance Method Summary
collapse
alias_association, convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
extended
Instance Method Details
#human_proceed ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'app/models/qc_metric.rb', line 56
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#human_proceed=(h_proceed) ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'app/models/qc_metric.rb', line 60
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#manual_qc_decision=(decision) ⇒ Object
Update the new state as appropriate:
- Don't change the state if we already match
- If we have an automatic state, update to a manual state
- If we already have a manual state, perform some magic to ensure eg.
pass -> manual_fail -> pass BUT
unprocessable -> manual_fail -> manual_pass
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'app/models/qc_metric.rb', line 48
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#original_qc_decision ⇒ Object
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
# File 'app/models/qc_metric.rb', line 88
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#poor_quality_proceed ⇒ Object
The metric indicates that the sample has been progressed despite poor quality
|| false ensures nil gets converted to a boolean
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
# File 'app/models/qc_metric.rb', line 68
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#proceedable? ⇒ Boolean
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
# File 'app/models/qc_metric.rb', line 80
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#qc_automatic? ⇒ Boolean
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# File 'app/models/qc_metric.rb', line 84
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#qc_failed? ⇒ Boolean
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
# File 'app/models/qc_metric.rb', line 76
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|
#qc_passed? ⇒ Boolean
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'app/models/qc_metric.rb', line 72
has_metadata do
include ProjectManager::Associations
include BudgetDivision::Associations
custom_attribute(:project_cost_code, required: true)
custom_attribute(:funding_comments)
custom_attribute(:collaborators)
custom_attribute(:external_funding_source)
custom_attribute(:sequencing_budget_cost_centre)
custom_attribute(:project_funding_model, in: PROJECT_FUNDING_MODELS)
custom_attribute(:gt_committee_tracking_id)
before_validation do |record|
record.project_cost_code = nil if record.project_cost_code.blank?
record.project_funding_model = nil if record.project_funding_model.blank?
end
end
|