cqm-converter 0.3.4 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -1
- data/Gemfile +3 -1
- data/cqm-converter.gemspec +3 -3
- data/lib/cqm/converter.rb +1 -0
- data/lib/cqm/converter/hds_record.rb +9 -4
- data/lib/cqm/converter/utils.rb +4 -0
- data/lib/ext/mongoid.rb +12 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 877c904445ba40b62519fdcddb7509a4e440c2d1
|
4
|
+
data.tar.gz: ac4b3fda4196682999230c07ff66b02b9144ba0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d105e8e44cb632a0a1cf57d3ed2722d02d72cf2df779e1e5a58d18432cf7c9d3323572c0929fc176f4c0d7bf5804a80ff8b09886176fcbc0ef7a24fe37fde04
|
7
|
+
data.tar.gz: b2ca77ebd8a042ad05c733414c7588fe0f2ae64877e9bc272d96c8f03355ebd69de80110f7358520a20765fe6316cddd559dc0a0b49eb0465bf26e574cb82f91
|
data/.rubocop.yml
CHANGED
@@ -12,6 +12,8 @@ Metrics/LineLength:
|
|
12
12
|
|
13
13
|
Metrics/BlockLength:
|
14
14
|
Max: 50
|
15
|
+
Exclude:
|
16
|
+
- 'spec/**/*_spec.rb'
|
15
17
|
|
16
18
|
Metrics/AbcSize:
|
17
19
|
Max: 130
|
@@ -38,4 +40,8 @@ Metrics/MethodLength:
|
|
38
40
|
Max: 60
|
39
41
|
|
40
42
|
Style/IfUnlessModifier:
|
41
|
-
Enabled: false
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Lint/UnusedMethodArgument:
|
46
|
+
Exclude:
|
47
|
+
- 'lib/ext/mongoid.rb'
|
data/Gemfile
CHANGED
@@ -2,6 +2,8 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
4
|
|
5
|
-
gem 'cql_qdm_patientapi', github: 'projecttacoma/cql_qdm_patientapi', branch: '
|
5
|
+
gem 'cql_qdm_patientapi', github: 'projecttacoma/cql_qdm_patientapi', branch: 'master'
|
6
|
+
|
7
|
+
# gem 'cqm-models', github: 'projecttacoma/cqm-models', branch: 'master'
|
6
8
|
|
7
9
|
gemspec
|
data/cqm-converter.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'cqm-converter'
|
6
|
-
spec.version = '0.3.
|
6
|
+
spec.version = '0.3.6'
|
7
7
|
spec.authors = ['aholmes@mitre.org']
|
8
8
|
spec.email = ['aholmes@mitre.org']
|
9
9
|
|
@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'bundler'
|
23
23
|
spec.add_development_dependency 'byebug'
|
24
24
|
spec.add_runtime_dependency 'coffee-script'
|
25
|
-
spec.add_runtime_dependency 'cqm-models', '>= 0.
|
25
|
+
spec.add_runtime_dependency 'cqm-models', '>= 0.8.4'
|
26
26
|
spec.add_runtime_dependency 'execjs'
|
27
|
-
spec.add_runtime_dependency 'health-data-standards', '>= 4.0
|
27
|
+
spec.add_runtime_dependency 'health-data-standards', '>= 4.1.0'
|
28
28
|
spec.add_runtime_dependency 'momentjs-rails'
|
29
29
|
spec.add_development_dependency 'rake'
|
30
30
|
spec.add_development_dependency 'rspec'
|
data/lib/cqm/converter.rb
CHANGED
@@ -72,7 +72,11 @@ module CQM::Converter
|
|
72
72
|
ethnicity = record.ethnicity
|
73
73
|
if ethnicity
|
74
74
|
# See: https://phinvads.cdc.gov/vads/ViewCodeSystem.action?id=2.16.840.1.113883.6.238
|
75
|
-
|
75
|
+
# Bonnie currently uses 'CDC Race' instead of the correct 'cdcrec'. This incorrect code is here as a temporary
|
76
|
+
# workaround until the larger change of making bonnie use 'cdcrec' can be implemented.
|
77
|
+
# Same change is present in `race` below.
|
78
|
+
code = QDM::Code.new(ethnicity['code'], 'CDC Race', ethnicity['name'], '2.16.840.1.113883.6.238')
|
79
|
+
# code = QDM::Code.new(ethnicity['code'], 'cdcrec', ethnicity['name'], '2.16.840.1.113883.6.238')
|
76
80
|
patient.dataElements << QDM::PatientCharacteristicEthnicity.new(dataElementCodes: [code])
|
77
81
|
end
|
78
82
|
|
@@ -88,7 +92,8 @@ module CQM::Converter
|
|
88
92
|
race = record.race
|
89
93
|
if race
|
90
94
|
# See: https://phinvads.cdc.gov/vads/ViewCodeSystem.action?id=2.16.840.1.113883.6.238
|
91
|
-
code = QDM::Code.new(race['code'], '
|
95
|
+
code = QDM::Code.new(race['code'], 'CDC Race', race['name'], '2.16.840.1.113883.6.238')
|
96
|
+
# code = QDM::Code.new(race['code'], 'cdcrec', race['name'], '2.16.840.1.113883.6.238')
|
92
97
|
patient.dataElements << QDM::PatientCharacteristicRace.new(dataElementCodes: [code])
|
93
98
|
end
|
94
99
|
|
@@ -127,11 +132,11 @@ module CQM::Converter
|
|
127
132
|
end
|
128
133
|
|
129
134
|
def generate_qdm_data_element(dc_fixed_keys, dc_type)
|
130
|
-
data_element = QDM.const_get(dc_type).new
|
135
|
+
data_element = QDM.const_get(dc_type).new(dc_fixed_keys)
|
131
136
|
|
132
137
|
# Any nested QDM types that need initialization should be handled here
|
133
138
|
# when converting from the QDM models to the HDS models.
|
134
|
-
# For now, that should just be FacilityLocation objects
|
139
|
+
# For now, that should just be FacilityLocation objects and Id
|
135
140
|
if data_element.is_a?(QDM::EncounterPerformed)
|
136
141
|
data_element.facilityLocations = data_element.facilityLocations.map do |facility|
|
137
142
|
QDM::FacilityLocation.new.from_json(facility.to_json)
|
data/lib/cqm/converter/utils.rb
CHANGED
@@ -34,6 +34,9 @@ module CQM::Converter
|
|
34
34
|
if QDM.const_get(model).respond_to?('fields')
|
35
35
|
qdm_model_attrs[model.to_s] = QDM.const_get(model).fields.keys.map! { |a| a.camelize(:lower) }
|
36
36
|
end
|
37
|
+
if QDM.const_get(model).respond_to?('embedded_relations')
|
38
|
+
qdm_model_attrs[model.to_s].concat(QDM.const_get(model).embedded_relations.keys.map! { |a| a.camelize(:lower) })
|
39
|
+
end
|
37
40
|
end
|
38
41
|
# TODO: These fields are currently not supported. See:
|
39
42
|
# https://github.com/projecttacoma/cql_qdm_patientapi/search?q=does+not+currently+support
|
@@ -135,6 +138,7 @@ module CQM::Converter
|
|
135
138
|
results['description'] = datatype['entry']['description'];
|
136
139
|
// Add oid to result.
|
137
140
|
results['hqmfOid'] = datatype['entry']['oid'];
|
141
|
+
|
138
142
|
processed_datatypes[key].push(results);
|
139
143
|
});
|
140
144
|
});
|
data/lib/ext/mongoid.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cqm-converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aholmes@mitre.org
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.8.4
|
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: 0.
|
82
|
+
version: 0.8.4
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: execjs
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 4.0
|
103
|
+
version: 4.1.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 4.0
|
110
|
+
version: 4.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: momentjs-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,6 +201,7 @@ files:
|
|
201
201
|
- lib/cqm/converter/hds_record.rb
|
202
202
|
- lib/cqm/converter/qdm_patient.rb
|
203
203
|
- lib/cqm/converter/utils.rb
|
204
|
+
- lib/ext/mongoid.rb
|
204
205
|
- lib/tasks/hds.rake
|
205
206
|
- lib/tasks/qdm.rake
|
206
207
|
homepage: https://github.com/projecttacoma/cqm-converter
|
@@ -223,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
224
|
version: '0'
|
224
225
|
requirements: []
|
225
226
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.6.
|
227
|
+
rubygems_version: 2.6.14
|
227
228
|
signing_key:
|
228
229
|
specification_version: 4
|
229
230
|
summary: HDS <=> QDM Model Converter
|