Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4 baseline #160

Merged
merged 38 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0049a1f
Fixed SDC loading to work with newer DRC measures. And cherry-pick wo…
hossenlopp Apr 25, 2019
96c8b30
Port ratio/proportional cv fix from hds and add tests (#48)
Jun 4, 2019
7da58c6
codeListId and hqmfOid are both needed for sdc uniqueness
dczulada Jun 10, 2019
717f2e1
Add descriptive error message if model cannot be found
Jun 26, 2019
173cea2
2019 standards update (#63)
Aug 26, 2019
61a1064
[Security] Update rubyzip requirement from ~> 1.2.2 to >= 1.2.2, < 2.…
dependabot-preview[bot] Oct 1, 2019
c19d602
BONNIE-593 Bonnie Unresponsive Message and Error Loading Measure Pack…
adongare Nov 19, 2019
9261ffd
BONNIE-593 Bonnie Unresponsive Message and Error Loading Measure Pack…
adongare Nov 19, 2019
18f77b4
BONNIE-593 Bonnie Unresponsive Message and Error Loading Measure Pack…
adongare Nov 19, 2019
50d7f75
Bonnie-593(ONCJira) test case fix
adongare Nov 19, 2019
c89f0f2
BONNIE-593 Bonnie Unresponsive Message and Error Loading Measure Pack…
adongare Nov 19, 2019
99924ef
BONNIE-587 Error loading VSAC value sets(ONC jira id)
adongare Nov 22, 2019
fec648a
Updated version of bonnie_version cqm-parser branch (#71)
adongare Nov 25, 2019
15868bf
BONNIEMAT-614 Bonnie only processing one of two measure observations(…
adongare Jan 29, 2020
d1deb51
[Security] Bump nokogiri from 1.10.5 to 1.10.8 (#76)
dependabot-preview[bot] Feb 28, 2020
39de7ff
Merge branch 'bonnie_version' into BONNIEMAT-614
adongare Feb 28, 2020
ba32fdf
[Security] Bump rake from 12.3.1 to 12.3.3 (#77)
dependabot-preview[bot] Mar 10, 2020
f5515db
MAT1385_rails_upgrade_bv (#87)
danmee10 Aug 17, 2020
916f63f
MAT-1308_update_cqm_models (#107)
danmee10 Aug 21, 2020
5b6d682
Mat 1708 (#112)
adongare Sep 10, 2020
b890b31
[MAT-1757] Replacing VSAC Username/Password with API Key in VSAC Call…
jkotanchik-SB Sep 14, 2020
7134769
Checking for nil via safe navigation on single_code_concepts hash be…
jkotanchik-SB Jan 7, 2021
dc64899
Replacing safe nav operator with Hash.dig to better handle the nested…
jkotanchik-SB Jan 8, 2021
c85ed28
pull in cqm-model v3.0.6 version (#129)
adongare Jan 25, 2021
24f8648
MAT-2803 (#143)
adongare Mar 30, 2021
271e231
MAT-2647 Update cqm-parsers to QDM 5.6 (#148)
adongare May 11, 2021
fef235d
Integrate from cqm-models MAT-2993 Failed to initialize Data element …
adongare May 14, 2021
43f48d5
ecurity vulnerabilty nokogiry (#150)
adongare May 20, 2021
047b897
MAT-2837: Using published version of cqm-models (v4.0.0) instead of b…
Jul 7, 2021
d702ce1
bump nokogiri in case of security vulnerability
jkotanchik-SB Sep 28, 2021
67d94ce
Baseline for v4.0.0 release
dczulada Oct 5, 2021
0b8fd64
Merge branch 'master' into v4_baseline
dczulada Oct 5, 2021
207838a
update Gemfile
dczulada Oct 5, 2021
9ad5daa
git ignore Gemfile.lock
dczulada Oct 6, 2021
16c8ff6
move ci workflow and add gitleaks.toml
dczulada Oct 6, 2021
cea37f7
address rubocop concerns
dczulada Oct 6, 2021
b3b0893
revert activesupport to support rails 5
dczulada Oct 8, 2021
4ce41c8
Bring mongoid back to 6
dczulada Oct 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Continuous Integration
on:
pull_request:
branches:
- master
branches: [master, bonnie_version]

jobs:
build:
Expand All @@ -11,7 +10,7 @@ jobs:

strategy:
matrix:
ruby-version: [2.5]
ruby-version: [2.5, 2.7.2]
mongodb-version: [4.0.18, 4.4]

steps:
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/main.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tmp
.idea
.rvmrc
Gemfile.lock

2 changes: 2 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ Lint/UselessAssignment:
# Offense count: 134
Metrics/AbcSize:
Max: 270
Exclude:
- 'test/unit/hqmf/1.0/nqf_0002_test.rb'

# Offense count: 6
# Configuration parameters: CountComments, ExcludedMethods.
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ gemspec :development_group => :test

gem 'mongoid', '~> 7.0.5'

# gem 'cqm-models', '~> 3.0.0'
# gem 'cqm-models', git: 'https://github.com/projecttacoma/cqm-models.git', branch: 'master'
# gem 'cqm-models', :path => '../cqm-models'

Expand Down
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,9 @@ bundle exec rake test

```


## Versioning

Starting with version **2.0.0** released on 6/20/19, cqm-parsers versioning has the format **X.Y.Z**, where:

* **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.

| X | CQL-based HQMF IG|
| --- | --- |
| 2 | R1 STU3 |

* **Y** indicates major changes (incompatible API changes)

* **Z** indicates minor changes (added functionality in a backwards-compatible manner) and patch changes (backwards-compatible bug fixes)

For the versions available, see [tags on this repository](https://github.com/projecttacoma/cqm-parsers/tags).
We use [SemVer](http://semver.org/) for versioning. For the versions available, see [tags on this repository](https://github.com/projecttacoma/cqm-parsers/tags).

## License

Expand Down
7 changes: 3 additions & 4 deletions cqm-parsers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ Gem::Specification.new do |s|
s.authors = ["The MITRE Corporation"]
s.license = 'Apache-2.0'

s.version = '3.2.0.1'
s.version = '4.0.0'

s.add_dependency 'cqm-models', '~> 3.0'
s.add_dependency 'cqm-models', '~> 4.0.0'
s.add_dependency 'mustache'
s.add_dependency 'erubis', '~> 2.7.0'
s.add_dependency 'mongoid', '~> 7.0.5'
s.add_dependency 'mongoid-tree', '~> 2.1'
s.add_dependency 'mongoid-tree', '~> 2.1.0'
s.add_dependency 'activesupport', '~> 6.0'

s.add_dependency 'protected_attributes_continued', '~> 1.4.0'
s.add_dependency 'uuid', '~> 2.3.7'
s.add_dependency 'builder', '~> 3.1'
s.add_dependency 'nokogiri', '>= 1.8.5', '< 1.13.0'
Expand Down
4 changes: 2 additions & 2 deletions lib/measure-loader/mat_measure_files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def unzip_measure_zip_into_hash(zip_file)
pn = Pathname(f.name)
next if '__MACOSX'.in? pn.each_filename # ignore anything in a __MACOSX folder
next unless pn.basename.extname.in? ['.xml','.cql','.json','.html']
folders[pn.dirname][:files] << { basename: pn.basename, contents: f.get_input_stream.read }
folders[pn.dirname][:files] << { basename: pn.basename, contents: f.get_input_stream.read.force_encoding('UTF-8') }
folders[pn.dirname][:depth] = pn.each_filename.count # this is just a count of how many folders are in the path
end
end
Expand Down Expand Up @@ -135,4 +135,4 @@ def verify_library_versions_match_and_get_version(cql, elm, elm_annotation)

end
end
end
end
3 changes: 2 additions & 1 deletion lib/measure-loader/source_data_criteria_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def extract_fields_from_standard_data_criteria(criteria, entry)
def extract_fields_from_single_code_reference_data_criteria(criteria)
single_code_reference = criteria.at_css('value[codeSystem][code]') || criteria.at_css('code[codeSystem][code]')
system_id = "#{single_code_reference['codeSystem']}_#{single_code_reference['codeSystemVersion']}".to_sym
concept = @single_code_concepts[system_id][single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
# concept = @single_code_concepts[system_id]&[single_code_reference['code'].to_sym] || get_concept_from_participation(criteria.at_css('participation'))
concept = @single_code_concepts&.dig(system_id, single_code_reference['code']&.to_sym) || get_concept_from_participation(criteria.at_css('participation'))
value_set = concept._parent
return {
description: concept.display_name,
Expand Down
5 changes: 2 additions & 3 deletions lib/measure-loader/vsac_value_set_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ def initialize(options)
options.symbolize_keys!
@vsac_options = options[:options]
@vsac_ticket_granting_ticket = options[:ticket_granting_ticket]
@vsac_username = options[:username]
@vsac_password = options[:password]
@vsac_api_key = options[:api_key]
@vs_model_cache = {}
end

Expand Down Expand Up @@ -48,7 +47,7 @@ def retrieve_and_modelize_value_sets_from_vsac(value_sets)

def load_api
return @api if @api.present?
@api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: @vsac_ticket_granting_ticket, username: @vsac_username, password: @vsac_password)
@api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: @vsac_ticket_granting_ticket, api_key: @vsac_api_key)
return @api
end

Expand Down
4 changes: 0 additions & 4 deletions lib/util/hqmfr2cql_template_oid_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@
"definition":"care_goal",
"status":"",
"negation":false},
"2.16.840.1.113883.10.20.28.4.13":{
"definition":"device",
"status":"applied",
"negation":false},
"2.16.840.1.113883.10.20.28.4.11":{
"definition":"device_adverse_event",
"status":"",
Expand Down
26 changes: 12 additions & 14 deletions lib/util/vsac_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module VSAC
class VSACError < StandardError
end

# Error represnting a not found response from the API. Includes OID for reporting to user.
# Error representing a not found response from the API. Includes OID for reporting to user.
class VSNotFoundError < VSACError
attr_reader :oid
def initialize(oid)
Expand All @@ -23,15 +23,15 @@ def initialize
end
end

# Error represnting a program not found response from the API.
# Error representing a program not found response from the API.
class VSACProgramNotFoundError < VSACError
attr_reader :oid
def initialize(program)
super("VSAC Program #{program} does not exist.")
end
end

# Error represnting a response from the API that had no concepts.
# Error representing a response from the API that had no concepts.
class VSEmptyError < VSACError
attr_reader :oid
def initialize(oid)
Expand All @@ -50,14 +50,14 @@ def initialize
# Raised when the user credentials were invalid.
class VSACInvalidCredentialsError < VSACError
def initialize
super('VSAC ULMS credentials are invalid.')
super('VSAC UMLS credentials are invalid.')
end
end

# Raised when a call requiring auth is attempted when no ticket_granting_ticket or credentials were provided.
class VSACNoCredentialsError < VSACError
def initialize
super('VSAC ULMS credentials were not provided.')
super('VSAC UMLS credentials were not provided.')
end
end

Expand Down Expand Up @@ -93,7 +93,7 @@ def initialize(options)
end

# if a ticket_granting_ticket was passed in, check it and raise errors if found
# username and password will be ignored
# VSAC API Key will be ignored
if !options[:ticket_granting_ticket].nil?
provided_ticket_granting_ticket = options[:ticket_granting_ticket]
if provided_ticket_granting_ticket[:ticket].nil? || provided_ticket_granting_ticket[:expires].nil?
Expand All @@ -105,9 +105,9 @@ def initialize(options)
@ticket_granting_ticket = { ticket: provided_ticket_granting_ticket[:ticket],
expires: provided_ticket_granting_ticket[:expires] }

# if username and password were provided use them to get a ticket granting ticket
elsif !options[:username].nil? && !options[:password].nil?
@ticket_granting_ticket = get_ticket_granting_ticket(options[:username], options[:password])
# if api key was provided use it to get a ticket granting ticket
elsif !options[:api_key].nil?
@ticket_granting_ticket = get_ticket_granting_ticket(options[:api_key])
end
end

Expand Down Expand Up @@ -304,13 +304,11 @@ def create_service_ticket_request
params: { service: TICKET_SERVICE_PARAM})
end

# Use your username and password to retrive a ticket granting ticket from VSAC
def get_ticket_granting_ticket(username, password)
# Use your API Key to retrive a ticket granting ticket from VSAC
def get_ticket_granting_ticket(api_key)
response = Typhoeus.post(
"#{@config[:auth_url]}/Ticket",
# looks like typheous sometimes switches the order of username/password when encoding
# which vsac cant handle (!?), so encode first
body: URI.encode_www_form(username: username, password: password)
body: URI.encode_www_form(apikey: api_key)
)
raise VSACInvalidCredentialsError.new if response.response_code == 401
validate_http_status(response.response_code)
Expand Down
Binary file removed test/fixtures/measureloading/CMS117v8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ http_interactions:
uri: https://vsac.nlm.nih.gov/vsac/ws/Ticket
body:
encoding: US-ASCII
string: username=<VSAC_USERNAME>&password=<VSAC_PASSWORD>
string: apikey=<VSAC_API_KEY>
headers:
User-Agent:
- Typhoeus - https://github.com/typhoeus/typhoeus
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/fixtures/vcr_cassettes/measure__population_titles.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading