Module: HealthDataStandards::Export::Helper::Cat1ViewHelper
- Includes:
- ScoopedViewHelper
- Defined in:
- lib/health-data-standards/export/helper/cat1_view_helper.rb
Constant Summary
ScoopedViewHelper::VS_MAP
Instance Method Summary
collapse
#entries_for_data_criteria, #entry_matches_criteria, #handle_clinical_trial_participant, #handle_patient_expired, #handle_payer_information, #unique_data_criteria, #value_set_map
Instance Method Details
#negation_indicator(entry) ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/health-data-standards/export/helper/cat1_view_helper.rb', line 32
def negation_indicator(entry)
if entry.negation_ind
'negationInd="true"'
else
''
end
end
|
#oid_for_code(codedValue, valueset_oids, bundle_id = nil) ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# File 'lib/health-data-standards/export/helper/cat1_view_helper.rb', line 40
def oid_for_code(codedValue, valueset_oids, bundle_id = nil)
return nil if codedValue.nil?
valueset_oids ||=[]
code = codedValue["code"]
code_system = codedValue["code_set"] || codedValue["code_system"]
vs_map = (value_set_map(bundle_id) || {})
valueset_oids.each do |vs_oid|
oid_list = (vs_map[vs_oid] || [])
oid_map = Hash[oid_list.collect{|x| [x["set"],x["values"]]}]
if (oid_map[code_system] || []).index code
return vs_oid
end
end
return nil
end
|
#render_data_criteria(dc, entries) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/health-data-standards/export/helper/cat1_view_helper.rb', line 7
def render_data_criteria(dc, entries)
html_array = entries.map do |entry|
bundle_id = entry.record ? entry.record["bundle_id"] : nil
vs_map = (value_set_map(bundle_id) || {})[dc['value_set_oid']]
render(:partial => HealthDataStandards::Export::QRDA::EntryTemplateResolver.partial_for(dc['data_criteria_oid'], dc['value_set_oid']), :locals => {:entry => entry,
:data_criteria => dc['data_criteria'],
:value_set_oid => dc['value_set_oid'],
:value_set_map => vs_map,
:result_oids => dc["result_oids"],
:field_oids => dc["field_oids"]})
end
html_array.join("\n")
end
|
#render_patient_data(patient, measures) ⇒ Object
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/health-data-standards/export/helper/cat1_view_helper.rb', line 21
def render_patient_data(patient, measures)
HealthDataStandards.logger.warn("Generating CAT I for #{patient.first} #{patient.last}")
udcs = unique_data_criteria(measures)
data_criteria_html = udcs.map do |udc|
entries = entries_for_data_criteria(udc['data_criteria'], patient)
render_data_criteria(udc, entries)
end
data_criteria_html.compact.join("\n")
end
|