cqm-validators 3.0.1 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +36 -0
- data/.overcommit.yml +2 -0
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -1
- data/cqm_validators.gemspec +2 -2
- data/lib/cqm_validators/version.rb +1 -1
- data/lib/performance_rate_validator.rb +3 -0
- data/lib/reported_result_extractor.rb +20 -16
- data/lib/validators.rb +1 -0
- metadata +15 -9
- data/.travis.yml +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d1b58c405d0b4f5749dd5a97f3e8bf6d9d751276b322f7f616ec143273c546a
|
4
|
+
data.tar.gz: 6c569d85fa41bdf80c2ebb2844035a0d3eca2e58d8c065f28dab833370049e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fac7b2669ce06bcf10402fe2e966740eb6f82e5dadd1245e251e49a7d1fcc3f3d0dc6966d235f073279ad844864b30c965101bf630fe1a88560f8b11edcf1bb
|
7
|
+
data.tar.gz: c641e6e185bc0cf57efc448b280441193ce0a3c0143e5d041271a1484a6b1cf6a84d19862cce4e5ec7b1767960bd41bb19b8e2d86d5a4b508bbbfad07e7c5fb4
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: Continuous Integration
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
- cqm_validators_2_x
|
7
|
+
- cqm_validators_3_x
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
ruby-version: [2.6, 2.7.2]
|
17
|
+
mongodb-version: [4.0.18, 4.4]
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v2
|
21
|
+
- name: Use Ruby ${{ matrix.ruby-version }}
|
22
|
+
uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
ruby-version: ${{ matrix.ruby-version }}
|
25
|
+
- name: Install dependencies
|
26
|
+
run: bundle install
|
27
|
+
- name: Start MongoDB
|
28
|
+
uses: supercharge/mongodb-github-action@1.3.0
|
29
|
+
with:
|
30
|
+
mongodb-version: ${{ matrix.mongodb-version }}
|
31
|
+
- name: Run overcommit
|
32
|
+
run: |
|
33
|
+
bundle exec overcommit --sign
|
34
|
+
bundle exec overcommit --run
|
35
|
+
- name: Run tests
|
36
|
+
run: bundle exec rake test
|
data/.overcommit.yml
CHANGED
@@ -7,6 +7,8 @@ PreCommit:
|
|
7
7
|
exclude: ['test/fixtures/**/*', 'lib/schema/**/*', 'lib/schematron/iso-schematron-xslt1/**/*', 'lib/schematron/iso-schematron-xslt2/**/*', 'lib/schematron/qrda/**/*']
|
8
8
|
AuthorName:
|
9
9
|
enabled: false
|
10
|
+
AuthorEmail:
|
11
|
+
enabled: false
|
10
12
|
CommitMsg:
|
11
13
|
RussianNovel:
|
12
14
|
enabled: true
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/cqm_validators.gemspec
CHANGED
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.required_ruby_version = '>= 2.
|
25
|
+
spec.required_ruby_version = '>= 2.4.0'
|
26
26
|
|
27
|
-
spec.add_dependency 'nokogiri', '
|
27
|
+
spec.add_dependency 'nokogiri', '>= 1.8.5', '< 1.14.0'
|
28
28
|
|
29
29
|
spec.add_development_dependency 'bundler'
|
30
30
|
spec.add_development_dependency 'byebug'
|
@@ -35,10 +35,13 @@ module CqmValidators
|
|
35
35
|
denexcep = 0
|
36
36
|
denom = 0
|
37
37
|
numer = 0
|
38
|
+
numex = 0
|
38
39
|
denex = reported_result['DENEX'] unless reported_result['DENEX'].nil?
|
39
40
|
denexcep = reported_result['DENEXCEP'] unless reported_result['DENEXCEP'].nil?
|
40
41
|
denom = reported_result['DENOM'] unless reported_result['DENOM'].nil?
|
41
42
|
numer = reported_result['NUMER'] unless reported_result['NUMER'].nil?
|
43
|
+
numex = reported_result['NUMEX'] unless reported_result['NUMEX'].nil?
|
44
|
+
numer -= numex
|
42
45
|
denom = denom - denex - denexcep
|
43
46
|
pr = if denom.zero?
|
44
47
|
'NA'
|
@@ -8,7 +8,7 @@ module CqmValidators
|
|
8
8
|
# returns nil if nothing matching is found
|
9
9
|
# returns a hash with the values of the populations filled out along with the population_ids added to the result
|
10
10
|
|
11
|
-
ALL_POPULATION_CODES = %w[IPP DENOM NUMER NUMEX DENEX DENEXCEP MSRPOPL MSRPOPLEX
|
11
|
+
ALL_POPULATION_CODES = %w[IPP DENOM NUMER NUMEX DENEX DENEXCEP MSRPOPL MSRPOPLEX].freeze
|
12
12
|
|
13
13
|
def extract_results_by_ids(measure, poulation_set_id, doc, stratification_id = nil)
|
14
14
|
results = nil
|
@@ -36,21 +36,14 @@ module CqmValidators
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def get_measure_components(n, population_set, stratification_id)
|
39
|
-
|
39
|
+
# observations are a hash of population/value. For example {"DENOM"=>108.0, "NUMER"=>2}
|
40
|
+
results = { supplemental_data: {}, observations: {} }
|
40
41
|
stratification = stratification_id ? population_set.stratifications.where(stratification_id: stratification_id).first.hqmf_id : nil
|
41
42
|
ALL_POPULATION_CODES.each do |pop_code|
|
42
|
-
next unless population_set.populations[pop_code]
|
43
|
+
next unless population_set.populations[pop_code]
|
43
44
|
|
44
|
-
|
45
|
-
sup =
|
46
|
-
if pop_code == 'OBSERV'
|
47
|
-
next unless population_set.populations['MSRPOPL']
|
48
|
-
|
49
|
-
msrpopl = population_set.populations['MSRPOPL']['hqmf_id']
|
50
|
-
val, sup = extract_cv_value(n, population_set.observations.first.hqmf_id, msrpopl, stratification)
|
51
|
-
else
|
52
|
-
val, sup, pr = extract_component_value(n, pop_code, population_set.populations[pop_code]['hqmf_id'], stratification)
|
53
|
-
end
|
45
|
+
get_observed_values(results, n, pop_code, population_set, stratification)
|
46
|
+
val, sup, pr = extract_component_value(n, pop_code, population_set.populations[pop_code]['hqmf_id'], stratification)
|
54
47
|
unless val.nil?
|
55
48
|
results[pop_code] = val
|
56
49
|
results[:supplemental_data][pop_code] = sup
|
@@ -60,8 +53,19 @@ module CqmValidators
|
|
60
53
|
results
|
61
54
|
end
|
62
55
|
|
63
|
-
def
|
64
|
-
|
56
|
+
def get_observed_values(results, n, pop_code, population_set, stratification)
|
57
|
+
statement_name = population_set.populations[pop_code]['statement_name']
|
58
|
+
# 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 }
|
60
|
+
# return unless an observation is found
|
61
|
+
unless statement_observation.empty?
|
62
|
+
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)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def extract_cv_value(node, id, msrpopl, pop_code, strata = nil)
|
68
|
+
xpath_observation = %( cda:component/cda:observation[./cda:value[@code = "#{pop_code}"] and ./cda:reference/cda:externalObservation/cda:id[#{translate('@root')}='#{msrpopl.upcase}']])
|
65
69
|
cv = node.at_xpath(xpath_observation)
|
66
70
|
return nil unless cv
|
67
71
|
|
@@ -73,7 +77,7 @@ module CqmValidators
|
|
73
77
|
else
|
74
78
|
val = get_cv_value(cv, id)
|
75
79
|
end
|
76
|
-
|
80
|
+
val
|
77
81
|
end
|
78
82
|
|
79
83
|
def extract_component_value(node, code, id, strata = nil)
|
data/lib/validators.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative 'measure_validator'
|
|
8
8
|
require_relative 'data_validator'
|
9
9
|
require_relative 'performance_rate_validator'
|
10
10
|
require_relative 'qrda_qdm_template_validator'
|
11
|
+
require 'singleton'
|
11
12
|
|
12
13
|
module CqmValidators
|
13
14
|
CDA_SDTC_SCHEMA = 'lib/schema/infrastructure/cda/CDA_SDTC.xsd'
|
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: 3.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laura
|
@@ -9,22 +9,28 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.8.5
|
21
|
+
- - "<"
|
19
22
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
23
|
+
version: 1.14.0
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 1.8.5
|
31
|
+
- - "<"
|
26
32
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
33
|
+
version: 1.14.0
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: bundler
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -146,11 +152,11 @@ extensions: []
|
|
146
152
|
extra_rdoc_files: []
|
147
153
|
files:
|
148
154
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
155
|
+
- ".github/workflows/ci.yml"
|
149
156
|
- ".gitignore"
|
150
157
|
- ".overcommit.yml"
|
151
158
|
- ".rubocop.yml"
|
152
159
|
- ".simplecov"
|
153
|
-
- ".travis.yml"
|
154
160
|
- Gemfile
|
155
161
|
- LICENSE.txt
|
156
162
|
- QRDA_Schematron_License.txt
|
@@ -226,14 +232,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
226
232
|
requirements:
|
227
233
|
- - ">="
|
228
234
|
- !ruby/object:Gem::Version
|
229
|
-
version: 2.
|
235
|
+
version: 2.4.0
|
230
236
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
237
|
requirements:
|
232
238
|
- - ">="
|
233
239
|
- !ruby/object:Gem::Version
|
234
240
|
version: '0'
|
235
241
|
requirements: []
|
236
|
-
rubygems_version: 3.
|
242
|
+
rubygems_version: 3.2.3
|
237
243
|
signing_key:
|
238
244
|
specification_version: 4
|
239
245
|
summary: new cqm validator library
|
data/.travis.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.6
|
4
|
-
- 2.5
|
5
|
-
cache:
|
6
|
-
- bundler
|
7
|
-
sudo: required
|
8
|
-
services:
|
9
|
-
- mongodb
|
10
|
-
branches:
|
11
|
-
only:
|
12
|
-
- master
|
13
|
-
- cqm_validators_2_x
|
14
|
-
before_script:
|
15
|
-
- git config --global user.email "travis@travis.ci"
|
16
|
-
- git config --global user.name "Travis CI"
|
17
|
-
script:
|
18
|
-
- bundle exec overcommit --sign
|
19
|
-
- bundle exec overcommit --run
|
20
|
-
- travis_retry bundle exec rake test
|