Class: AnalysisSystematicReview
Overview
A Facade pattern class Shows general statistics for systematic reviews and
for each article
Instance Attribute Summary collapse
Instance Method Summary
collapse
#get_stage_name, #get_stages_ids, #get_stages_names, #get_stages_names_t
#cd_accepted_id, #cd_from_pattern, #cd_id_assigned_by_user, #cd_rejected_id, #cd_screened_id, #cd_without_abstract, #cd_without_allocations, #count_by_pattern, #decisions_by_cd, #decisions_pattern, #get_asrs, #incoming_citations, #outgoing_citations, #resolution_by_cd, #resolution_pattern, #resolutions_f_pattern_decision, #stage_complete?, #user_decisions
Constructor Details
Returns a new instance of AnalysisSystematicReview
54
55
56
57
58
59
|
# File 'lib/analysis_systematic_review.rb', line 54
def initialize(rs)
@rs=rs
process_basic_indicators
process_cite_number
procesar_resolutions
end
|
Instance Attribute Details
#cd_ref_id ⇒ Object
Id for canonical documents associated to references
43
44
45
|
# File 'lib/analysis_systematic_review.rb', line 43
def cd_ref_id
@cd_ref_id
end
|
#cd_reg_id ⇒ Object
Id for canonical documents associated to records
41
42
43
|
# File 'lib/analysis_systematic_review.rb', line 41
def cd_reg_id
@cd_reg_id
end
|
#cd_todos_id ⇒ Object
Id for all canonical documents
45
46
47
|
# File 'lib/analysis_systematic_review.rb', line 45
def cd_todos_id
@cd_todos_id
end
|
#rec ⇒ Object
References between canonical documents
47
48
49
|
# File 'lib/analysis_systematic_review.rb', line 47
def rec
@rec
end
|
#ref_count_entrada ⇒ Object
Hash for canonical documents, with incoming citations
49
50
51
|
# File 'lib/analysis_systematic_review.rb', line 49
def ref_count_entrada
@ref_count_entrada
end
|
#ref_count_salida ⇒ Object
Hash for canonical documents, with out citations
51
52
53
|
# File 'lib/analysis_systematic_review.rb', line 51
def ref_count_salida
@ref_count_salida
end
|
#rs ⇒ Object
Returns the value of attribute rs
39
40
41
|
# File 'lib/analysis_systematic_review.rb', line 39
def rs
@rs
end
|
Instance Method Details
#cd_count_entrada(id) ⇒ Object
63
64
65
|
# File 'lib/analysis_systematic_review.rb', line 63
def cd_count_entrada(id)
@ref_count_entrada[id]
end
|
#cd_count_entrada_rtr(id) ⇒ Object
67
68
69
|
# File 'lib/analysis_systematic_review.rb', line 67
def cd_count_entrada_rtr(id)
@cd_reference_rtr[id]
end
|
#cd_count_ref ⇒ Object
75
76
77
|
# File 'lib/analysis_systematic_review.rb', line 75
def cd_count_ref
@cd_ref_id.length
end
|
#cd_count_reg ⇒ Object
79
80
81
|
# File 'lib/analysis_systematic_review.rb', line 79
def cd_count_reg
@cd_reg_id.length
end
|
#cd_count_salida(id) ⇒ Object
71
72
73
|
# File 'lib/analysis_systematic_review.rb', line 71
def cd_count_salida(id)
@ref_count_salida[id]
end
|
#cd_count_total ⇒ Object
92
93
94
|
# File 'lib/analysis_systematic_review.rb', line 92
def cd_count_total
@cd_todos_id.length
end
|
#cd_en_reference?(id) ⇒ Boolean
Señala si un cd es parte de una reference# Es decir, en algún momento fue
citado por alguien.
89
90
91
|
# File 'lib/analysis_systematic_review.rb', line 89
def cd_en_reference?(id)
@cd_ref_id.include? id
end
|
#cd_en_registro?(id) ⇒ Boolean
Señala si un cd es parte de un registro, es decir, si aparece en alguna de
las searches
85
86
87
|
# File 'lib/analysis_systematic_review.rb', line 85
def cd_en_registro?(id)
@cd_reg_id.include? id
end
|
#cd_hash ⇒ Object
60
61
62
|
# File 'lib/analysis_systematic_review.rb', line 60
def cd_hash
@rs.cd_hash
end
|
#cd_in_resolution_stage?(id, stage) ⇒ Boolean
136
137
138
|
# File 'lib/analysis_systematic_review.rb', line 136
def cd_in_resolution_stage?(id, stage)
@cd_resolutions[stage.to_sym][id].nil? ? false : @cd_resolutions[stage.to_sym][id][:resolution] == 'yes'
end
|
#files_by_cd ⇒ Object
152
153
154
|
# File 'lib/analysis_systematic_review.rb', line 152
def files_by_cd
$db["SELECT a.*,cds.canonical_document_id FROM files a INNER JOIN file_cds cds ON a.id=cds.file_id INNER JOIN file_srs ars ON a.id=ars.file_id WHERE systematic_review_id=? AND (cds.not_consider = ? OR cds.not_consider IS NULL)", @rs.id, 0].to_hash_groups(:canonical_document_id)
end
|
#more_cited(n = 20) ⇒ Object
140
141
142
|
# File 'lib/analysis_systematic_review.rb', line 140
def more_cited(n=20)
@ref_count_entrada.sort_by {|a| a[1]}.reverse[0...n]
end
|
#pattern_from_s(text) ⇒ Object
169
170
171
172
173
174
175
|
# File 'lib/analysis_systematic_review.rb', line 169
def pattern_from_s(text)
text.split("__").inject({}){|ac,v|
key,value=v.split("_")
ac[key]=value.to_i
ac
}
end
|
#pattern_id(a) ⇒ Object
163
164
165
166
167
|
# File 'lib/analysis_systematic_review.rb', line 163
def pattern_id(a)
Decision::N_EST.keys.map {|key|
"#{key}_#{a[key]}"
}.join("__")
end
|
#pattern_name(a) ⇒ Object
157
158
159
160
161
|
# File 'lib/analysis_systematic_review.rb', line 157
def pattern_name(a)
Decision::N_EST.map {|key,name|
"#{::I18n::t(name)}:#{a[key]}"
}.join(";")
end
|
#pattern_order(a) ⇒ Object
147
148
149
|
# File 'lib/analysis_systematic_review.rb', line 147
def pattern_order(a)
- (1000*a["yes"].to_i + 100*a["no"].to_i + 10*a["undecided"].to_i + 1*a["ND"].to_i)
end
|
#with_more_references(n = 20) ⇒ Object
143
144
145
|
# File 'lib/analysis_systematic_review.rb', line 143
def with_more_references(n=20)
@ref_count_salida.sort_by {|a| a[1]}.reverse[0...n]
end
|