cqm-validators 4.0.1 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/lib/cqm_validators/version.rb +1 -1
- data/lib/performance_rate_validator.rb +2 -0
- data/lib/reported_result_extractor.rb +10 -7
- data/lib/schematron/qrda/cat_1_r5_3/HL7 QRDA Category I STU 5.3.sch +3858 -3836
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aba5de67708f22d92bb0f20c31d7173bfc0e8382bd8e536ac571d8fde83116d2
|
4
|
+
data.tar.gz: 339ba96bb7af5bf2b6b9e2ddb8ff448bc1a0456443273083de3fd014fe0d3f13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 187eb234fd776e9935809d756ee9fcf3f258d30bf6cfbe07d4f0a4cd7bf5fad3ef18ce00a0b1e06b02f70b825b14794322b25c7f1a6f0d3c7fc75a8d49c9ac42
|
7
|
+
data.tar.gz: a276379056beb2530eafaea43df030a0fbaff0a52384ab2c4c7d609c91d9a06e08283dff40a51fc8140d97888033abd4e34a27c5533f65348c31a952ed934652
|
data/.rubocop.yml
CHANGED
@@ -17,6 +17,8 @@ module CqmValidators
|
|
17
17
|
measure_ids = document.xpath(measure_selector).map(&:value).map(&:upcase)
|
18
18
|
measure_ids.each do |measure_id|
|
19
19
|
measure = CQM::Measure.where(hqmf_id: measure_id).first
|
20
|
+
next unless measure
|
21
|
+
|
20
22
|
measure.population_sets.each do |population_set|
|
21
23
|
reported_result, = extract_results_by_ids(measure, population_set.population_set_id, document)
|
22
24
|
# only check performace rate when there is one
|
@@ -20,7 +20,10 @@ module CqmValidators
|
|
20
20
|
end
|
21
21
|
|
22
22
|
nodes.each do |n|
|
23
|
-
|
23
|
+
popset_index = measure.population_sets.map(&:population_set_id).find_index do |pop_set|
|
24
|
+
pop_set == poulation_set_id
|
25
|
+
end
|
26
|
+
results = get_measure_components(n, measure.population_sets.where(population_set_id: poulation_set_id).first, stratification_id, popset_index)
|
24
27
|
break if !results.nil? || (!results.nil? && !results.empty?)
|
25
28
|
end
|
26
29
|
return nil if results.nil?
|
@@ -35,14 +38,14 @@ module CqmValidators
|
|
35
38
|
doc.xpath(xpath_measures)
|
36
39
|
end
|
37
40
|
|
38
|
-
def get_measure_components(n, population_set, stratification_id)
|
41
|
+
def get_measure_components(n, population_set, stratification_id, popset_index)
|
39
42
|
# observations are a hash of population/value. For example {"DENOM"=>108.0, "NUMER"=>2}
|
40
43
|
results = { supplemental_data: {}, observations: {} }
|
41
44
|
stratification = stratification_id ? population_set.stratifications.where(stratification_id: stratification_id).first.hqmf_id : nil
|
42
45
|
ALL_POPULATION_CODES.each do |pop_code|
|
43
46
|
next unless population_set.populations[pop_code]
|
44
47
|
|
45
|
-
get_observed_values(results, n, pop_code, population_set, stratification)
|
48
|
+
get_observed_values(results, n, pop_code, population_set, stratification, popset_index)
|
46
49
|
val, sup, pr = extract_component_value(n, pop_code, population_set.populations[pop_code]['hqmf_id'], stratification)
|
47
50
|
unless val.nil?
|
48
51
|
results[pop_code] = val
|
@@ -53,14 +56,14 @@ module CqmValidators
|
|
53
56
|
results
|
54
57
|
end
|
55
58
|
|
56
|
-
def get_observed_values(results, n, pop_code, population_set, stratification)
|
59
|
+
def get_observed_values(results, n, pop_code, population_set, stratification, popset_index)
|
57
60
|
statement_name = population_set.populations[pop_code]['statement_name']
|
58
61
|
# look to see if there is an observation that corresponds to the specific statement_name
|
59
|
-
statement_observation = population_set.observations.select { |obs| obs.observation_parameter.statement_name == statement_name }
|
62
|
+
statement_observation = population_set.observations.select { |obs| obs.observation_parameter.statement_name == statement_name }[popset_index]
|
60
63
|
# return unless an observation is found
|
61
|
-
unless statement_observation.
|
64
|
+
unless statement_observation.nil?
|
62
65
|
hqmf_id = population_set.populations[pop_code]['hqmf_id']
|
63
|
-
results[:observations][pop_code] = extract_cv_value(n, statement_observation.
|
66
|
+
results[:observations][pop_code] = extract_cv_value(n, statement_observation.hqmf_id, hqmf_id, pop_code, stratification)
|
64
67
|
end
|
65
68
|
end
|
66
69
|
|