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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4b3550d88f1c01983c38cda3feff6d04e5653da
4
- data.tar.gz: 8553e2f135b2682dda45008155b9656f9bba5ee7
3
+ metadata.gz: 877c904445ba40b62519fdcddb7509a4e440c2d1
4
+ data.tar.gz: ac4b3fda4196682999230c07ff66b02b9144ba0b
5
5
  SHA512:
6
- metadata.gz: 140eefd62dcb19a17058d65448966096754397e40f8f76bd74e35f298a39c2312efaf72df9e91248a563819f665eea590ada994a103b8c87967a96333bda1a18
7
- data.tar.gz: 6c19e8490ad2c9aa9f37ec515173938761e3a81d5713a80f1ea57d90d6a134fc41b33f00adca3ee02ce7ce887a79d49e50aeaa5f7df0065d7c5fa9b907b43bb2
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: 'adam_taco'
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
@@ -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.4'
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.7.2'
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.3'
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
@@ -9,6 +9,7 @@ module CQM
9
9
  end
10
10
  end
11
11
 
12
+ require_relative '../ext/mongoid'
12
13
  require_relative 'converter/utils'
13
14
  require_relative 'converter/hds_record'
14
15
  require_relative 'converter/qdm_patient'
@@ -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
- code = QDM::Code.new(ethnicity['code'], 'cdcrec', ethnicity['name'], '2.16.840.1.113883.6.238')
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'], 'cdcrec', race['name'], '2.16.840.1.113883.6.238')
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.from_json(dc_fixed_keys.to_json)
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)
@@ -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
  });
@@ -0,0 +1,12 @@
1
+ module BSON
2
+ # Monkey patch BSON::ObjectId to just return the string for to_json. This is done to match operation in bonnie.
3
+ class ObjectId
4
+ def to_json(*args)
5
+ to_s.to_json
6
+ end
7
+
8
+ def as_json(*args)
9
+ to_s.as_json
10
+ end
11
+ end
12
+ end
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
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-06-22 00:00:00.000000000 Z
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.7.2
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.7.2
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.3
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.3
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.11
227
+ rubygems_version: 2.6.14
227
228
  signing_key:
228
229
  specification_version: 4
229
230
  summary: HDS <=> QDM Model Converter