cqm-validators 4.0.1 → 4.0.2
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/reported_result_extractor.rb +10 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29df45cf99b9918238f8546e963c56c83abe86cbff28f5fb82f5d6ffdc8d8521
|
4
|
+
data.tar.gz: 873a72b950d5e2a98bbffc90748270ae114ef036c8a5b294639cb8ed215326c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3386b218f4d06ffac761dfcb4707cabefc6766d7bceaad1eb16edfab038a0ef6b9f0cdb631e98338bd54c55cda9abca9dbf5f1a7879b170fc5fd5db6a3d6e79d
|
7
|
+
data.tar.gz: 428af9d72635fce454ee01d55c706d7c1b6fdf52a48c782eba7cde889dcbd448c1df79646f9933ed786cf642afbab586030d196f233f8689da698b696157ca89
|
data/.rubocop.yml
CHANGED
@@ -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
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-validators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laura
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|