cqm-parsers 3.2.0.2 → 4.0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/README.md +1 -14
- data/lib/measure-loader/mat_measure_files.rb +2 -2
- data/lib/measure-loader/source_data_criteria_loader.rb +2 -1
- data/lib/measure-loader/vsac_value_set_loader.rb +2 -3
- data/lib/util/hqmfr2cql_template_oid_map.json +0 -4
- data/lib/util/vsac_api.rb +12 -14
- metadata +13 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d42976fc653ecb9c5a69de2d4ff1cb23a56880bbfc45f53cc7f159f45e7929a4
|
4
|
+
data.tar.gz: 4d66c6e37db1a5a4ad9ea4134eda9388817092031ebe0aa7cec9e1c1b69057ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33eca35212fcfc098812f2959c1390771bc2fb8453161b1b243cca5c59fdb30398a74ca01e285d4799d5978704012cedf581a3e22e62c226f8881804fac66d75
|
7
|
+
data.tar.gz: efcfb1116851ac81d5ec7659821f5f4547e8c93ab9e41e28bf8f9895e99bfd3be2e3a00f93cea238776bd3192b94cca6cbe5d759cbed74e52fbe23adfa81b062
|
data/Gemfile
CHANGED
@@ -2,9 +2,8 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gemspec :development_group => :test
|
4
4
|
|
5
|
-
gem 'mongoid', '~>
|
5
|
+
gem 'mongoid', '~> 6.4.2'
|
6
6
|
|
7
|
-
# gem 'cqm-models', '~> 3.0.0'
|
8
7
|
# gem 'cqm-models', git: 'https://github.com/projecttacoma/cqm-models.git', branch: 'master'
|
9
8
|
# gem 'cqm-models', :path => '../cqm-models'
|
10
9
|
|
data/README.md
CHANGED
@@ -42,22 +42,9 @@ bundle exec rake test
|
|
42
42
|
|
43
43
|
```
|
44
44
|
|
45
|
-
|
46
45
|
## Versioning
|
47
46
|
|
48
|
-
|
49
|
-
|
50
|
-
* **X** maps to a version of the CQL-based HQMF IG. See the table below to see the existing mapping to CQL-based HQMF IG versions.
|
51
|
-
|
52
|
-
| X | CQL-based HQMF IG|
|
53
|
-
| --- | --- |
|
54
|
-
| 2 | R1 STU3 |
|
55
|
-
|
56
|
-
* **Y** indicates major changes (incompatible API changes)
|
57
|
-
|
58
|
-
* **Z** indicates minor changes (added functionality in a backwards-compatible manner) and patch changes (backwards-compatible bug fixes)
|
59
|
-
|
60
|
-
For the versions available, see [tags on this repository](https://github.com/projecttacoma/cqm-parsers/tags).
|
47
|
+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see [tags on this repository](https://github.com/projecttacoma/cqm-parsers/tags).
|
61
48
|
|
62
49
|
## License
|
63
50
|
|
@@ -58,7 +58,7 @@ module Measures
|
|
58
58
|
pn = Pathname(f.name)
|
59
59
|
next if '__MACOSX'.in? pn.each_filename # ignore anything in a __MACOSX folder
|
60
60
|
next unless pn.basename.extname.in? ['.xml','.cql','.json','.html']
|
61
|
-
folders[pn.dirname][:files] << { basename: pn.basename, contents: f.get_input_stream.read }
|
61
|
+
folders[pn.dirname][:files] << { basename: pn.basename, contents: f.get_input_stream.read.force_encoding('UTF-8') }
|
62
62
|
folders[pn.dirname][:depth] = pn.each_filename.count # this is just a count of how many folders are in the path
|
63
63
|
end
|
64
64
|
end
|
@@ -135,4 +135,4 @@ module Measures
|
|
135
135
|
|
136
136
|
end
|
137
137
|
end
|
138
|
-
end
|
138
|
+
end
|
@@ -46,7 +46,8 @@ module Measures
|
|
46
46
|
def extract_fields_from_single_code_reference_data_criteria(criteria)
|
47
47
|
single_code_reference = criteria.at_css('value[codeSystem][code]') || criteria.at_css('code[codeSystem][code]')
|
48
48
|
system_id = "#{single_code_reference['codeSystem']}_#{single_code_reference['codeSystemVersion']}".to_sym
|
49
|
-
concept = @single_code_concepts[system_id][single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
|
49
|
+
# concept = @single_code_concepts[system_id]&[single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
|
50
|
+
concept = @single_code_concepts&.dig(system_id, single_code_reference['code']&.to_sym) || get_concept_from_participation(criteria.at_css('participation'))
|
50
51
|
value_set = concept._parent
|
51
52
|
return {
|
52
53
|
description: concept.display_name,
|
@@ -7,8 +7,7 @@ module Measures
|
|
7
7
|
options.symbolize_keys!
|
8
8
|
@vsac_options = options[:options]
|
9
9
|
@vsac_ticket_granting_ticket = options[:ticket_granting_ticket]
|
10
|
-
@
|
11
|
-
@vsac_password = options[:password]
|
10
|
+
@vsac_api_key = options[:api_key]
|
12
11
|
@vs_model_cache = {}
|
13
12
|
end
|
14
13
|
|
@@ -48,7 +47,7 @@ module Measures
|
|
48
47
|
|
49
48
|
def load_api
|
50
49
|
return @api if @api.present?
|
51
|
-
@api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: @vsac_ticket_granting_ticket,
|
50
|
+
@api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: @vsac_ticket_granting_ticket, api_key: @vsac_api_key)
|
52
51
|
return @api
|
53
52
|
end
|
54
53
|
|
@@ -219,10 +219,6 @@
|
|
219
219
|
"definition":"care_goal",
|
220
220
|
"status":"",
|
221
221
|
"negation":false},
|
222
|
-
"2.16.840.1.113883.10.20.28.4.13":{
|
223
|
-
"definition":"device",
|
224
|
-
"status":"applied",
|
225
|
-
"negation":false},
|
226
222
|
"2.16.840.1.113883.10.20.28.4.11":{
|
227
223
|
"definition":"device_adverse_event",
|
228
224
|
"status":"",
|
data/lib/util/vsac_api.rb
CHANGED
@@ -7,7 +7,7 @@ module Util
|
|
7
7
|
class VSACError < StandardError
|
8
8
|
end
|
9
9
|
|
10
|
-
# Error
|
10
|
+
# Error representing a not found response from the API. Includes OID for reporting to user.
|
11
11
|
class VSNotFoundError < VSACError
|
12
12
|
attr_reader :oid
|
13
13
|
def initialize(oid)
|
@@ -23,7 +23,7 @@ module Util
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
# Error
|
26
|
+
# Error representing a program not found response from the API.
|
27
27
|
class VSACProgramNotFoundError < VSACError
|
28
28
|
attr_reader :oid
|
29
29
|
def initialize(program)
|
@@ -31,7 +31,7 @@ module Util
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
# Error
|
34
|
+
# Error representing a response from the API that had no concepts.
|
35
35
|
class VSEmptyError < VSACError
|
36
36
|
attr_reader :oid
|
37
37
|
def initialize(oid)
|
@@ -50,14 +50,14 @@ module Util
|
|
50
50
|
# Raised when the user credentials were invalid.
|
51
51
|
class VSACInvalidCredentialsError < VSACError
|
52
52
|
def initialize
|
53
|
-
super('VSAC
|
53
|
+
super('VSAC UMLS credentials are invalid.')
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
# Raised when a call requiring auth is attempted when no ticket_granting_ticket or credentials were provided.
|
58
58
|
class VSACNoCredentialsError < VSACError
|
59
59
|
def initialize
|
60
|
-
super('VSAC
|
60
|
+
super('VSAC UMLS credentials were not provided.')
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -93,7 +93,7 @@ module Util
|
|
93
93
|
end
|
94
94
|
|
95
95
|
# if a ticket_granting_ticket was passed in, check it and raise errors if found
|
96
|
-
#
|
96
|
+
# VSAC API Key will be ignored
|
97
97
|
if !options[:ticket_granting_ticket].nil?
|
98
98
|
provided_ticket_granting_ticket = options[:ticket_granting_ticket]
|
99
99
|
if provided_ticket_granting_ticket[:ticket].nil? || provided_ticket_granting_ticket[:expires].nil?
|
@@ -105,9 +105,9 @@ module Util
|
|
105
105
|
@ticket_granting_ticket = { ticket: provided_ticket_granting_ticket[:ticket],
|
106
106
|
expires: provided_ticket_granting_ticket[:expires] }
|
107
107
|
|
108
|
-
|
109
|
-
elsif !options[:
|
110
|
-
@ticket_granting_ticket = get_ticket_granting_ticket(options[:
|
108
|
+
# if api key was provided use it to get a ticket granting ticket
|
109
|
+
elsif !options[:api_key].nil?
|
110
|
+
@ticket_granting_ticket = get_ticket_granting_ticket(options[:api_key])
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
@@ -304,13 +304,11 @@ module Util
|
|
304
304
|
params: { service: TICKET_SERVICE_PARAM})
|
305
305
|
end
|
306
306
|
|
307
|
-
# Use your
|
308
|
-
def get_ticket_granting_ticket(
|
307
|
+
# Use your API Key to retrive a ticket granting ticket from VSAC
|
308
|
+
def get_ticket_granting_ticket(api_key)
|
309
309
|
response = Typhoeus.post(
|
310
310
|
"#{@config[:auth_url]}/Ticket",
|
311
|
-
|
312
|
-
# which vsac cant handle (!?), so encode first
|
313
|
-
body: URI.encode_www_form(username: username, password: password)
|
311
|
+
body: URI.encode_www_form(apikey: api_key)
|
314
312
|
)
|
315
313
|
raise VSACInvalidCredentialsError.new if response.response_code == 401
|
316
314
|
validate_http_status(response.response_code)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-parsers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The MITRE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cqm-models
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 4.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 4.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mustache
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,56 +58,42 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 6.4.2
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 6.4.2
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: mongoid-tree
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 2.1.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 2.1.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: activesupport
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 5.2.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: protected_attributes_continued
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: 1.4.0
|
104
|
-
type: :runtime
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: 1.4.0
|
96
|
+
version: 5.2.1
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: uuid
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -145,7 +131,7 @@ dependencies:
|
|
145
131
|
version: 1.8.5
|
146
132
|
- - "<"
|
147
133
|
- !ruby/object:Gem::Version
|
148
|
-
version: 1.
|
134
|
+
version: 1.13.0
|
149
135
|
type: :runtime
|
150
136
|
prerelease: false
|
151
137
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -155,7 +141,7 @@ dependencies:
|
|
155
141
|
version: 1.8.5
|
156
142
|
- - "<"
|
157
143
|
- !ruby/object:Gem::Version
|
158
|
-
version: 1.
|
144
|
+
version: 1.13.0
|
159
145
|
- !ruby/object:Gem::Dependency
|
160
146
|
name: highline
|
161
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -343,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
343
329
|
- !ruby/object:Gem::Version
|
344
330
|
version: '0'
|
345
331
|
requirements: []
|
346
|
-
rubygems_version: 3.2
|
332
|
+
rubygems_version: 3.0.2
|
347
333
|
signing_key:
|
348
334
|
specification_version: 4
|
349
335
|
summary: A library for parsing HQMF documents.
|