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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3072faa685de768a4a80ed90fae5da72b0ae2ee1b1d86bea76a9f90fc5a198c6
4
- data.tar.gz: c90de36ea0e134ba07345cc58842682e98c2494ace3f04aeeb65e9aa1511b57b
3
+ metadata.gz: 29df45cf99b9918238f8546e963c56c83abe86cbff28f5fb82f5d6ffdc8d8521
4
+ data.tar.gz: 873a72b950d5e2a98bbffc90748270ae114ef036c8a5b294639cb8ed215326c0
5
5
  SHA512:
6
- metadata.gz: 5358b31884f39aea4f44a48c9a4aee3f548f89646bcfc29d64e124e2992ef0a152aa58d4bca08d0bf0e38682347f89bb6c591077443e565a5c4d01494ef14abc
7
- data.tar.gz: c6aee722e6e323d37a8ef25ed2df495fd3b0eb399b194d30134ded1bd7f591f0692a6b73cb52413151559a314e7f29b33d0c62a6707ee69d68065d39c417639b
6
+ metadata.gz: 3386b218f4d06ffac761dfcb4707cabefc6766d7bceaad1eb16edfab038a0ef6b9f0cdb631e98338bd54c55cda9abca9dbf5f1a7879b170fc5fd5db6a3d6e79d
7
+ data.tar.gz: 428af9d72635fce454ee01d55c706d7c1b6fdf52a48c782eba7cde889dcbd448c1df79646f9933ed786cf642afbab586030d196f233f8689da698b696157ca89
data/.rubocop.yml CHANGED
@@ -58,6 +58,10 @@ Metrics/PerceivedComplexity:
58
58
  Max: 10
59
59
  Exclude:
60
60
  - 'lib/reported_result_extractor.rb'
61
+ Metrics/ParameterLists:
62
+ Max: 5
63
+ Exclude:
64
+ - 'lib/reported_result_extractor.rb'
61
65
  Naming/MethodParameterName:
62
66
  Enabled: false
63
67
  Style/DateTime:
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CqmValidators
4
- VERSION = '4.0.1'
4
+ VERSION = '4.0.2'
5
5
  end
@@ -20,7 +20,10 @@ module CqmValidators
20
20
  end
21
21
 
22
22
  nodes.each do |n|
23
- results = get_measure_components(n, measure.population_sets.where(population_set_id: poulation_set_id).first, stratification_id)
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.empty?
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.first.hqmf_id, hqmf_id, pop_code, stratification)
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.1
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-04-19 00:00:00.000000000 Z
12
+ date: 2022-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri