cqm-converter 0.3.0 → 0.3.1

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: 76345a43cc42055ae5db8711c0b373c0f7a01ccd
4
- data.tar.gz: e2a4dda482cc7182c30aee90f39e165e89fc4a2c
3
+ metadata.gz: 2013eed018ac0dfe435f6fdc11b204a2e6fc56bb
4
+ data.tar.gz: 122698a2044e38ab28aeb9bdc0debdbcaa2da79e
5
5
  SHA512:
6
- metadata.gz: d530d062dcdf0df986de920768eddd8bd0bd51bf7ab6f152cb798f7989812a558ea06d6f5a7ef6c9cc0ca152c0f81ba4132030577a2526fb364e7120d986ecc9
7
- data.tar.gz: 1e8eec1be90957f362633d556f97898e1c3aeb6e3d99462a669d08bf635faeaa30abfd35044f46cbcae89d00c9adb7cee24c92d3a9a5651c801b0802c6d7581a
6
+ metadata.gz: 477b5f80c86f5abaf7fd317d03fb1fc757fe0408c6477061764f36da3c8e1fad1149b6f763c2ac054642c05e78ecdcf27d71eedd6944d6278e8635779554e3f2
7
+ data.tar.gz: b8078f43329462b1c04ea77fb7fabb5dd96bfd9273d31ec0c51bedfa74f619c804e9df4e3c812f870c2676c72abee66d23d37125313bfaf5b6b8ec254cb1b3d2
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/projecttacoma/cqm-converter.svg?branch=master)](https://travis-ci.org/projecttacoma/cqm-converter)
2
+
1
3
  # HDS <=> QDM Models Converter
2
4
 
3
5
  This repository includes a Ruby Gem that provides a module for converting between the older HDS based models (https://github.com/projectcypress/health-data-standards) and the newer QDM based models (https://github.com/projecttacoma/cqm-models).
@@ -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.0'
6
+ spec.version = '0.3.1'
7
7
  spec.authors = ['aholmes@mitre.org']
8
8
  spec.email = ['aholmes@mitre.org']
9
9
 
@@ -71,7 +71,8 @@ module CQM::Converter
71
71
  # Convert patient characteristic ethnicity.
72
72
  ethnicity = record.ethnicity
73
73
  if ethnicity
74
- code = QDM::Code.new(ethnicity['code'], ethnicity['codeSystem'], ethnicity['name'], Utils.code_system_helper(ethnicity['codeSystem']))
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
76
  patient.dataElements << QDM::PatientCharacteristicEthnicity.new(dataElementCodes: [code])
76
77
  end
77
78
 
@@ -86,14 +87,16 @@ module CQM::Converter
86
87
  # Convert patient characteristic race.
87
88
  race = record.race
88
89
  if race
89
- code = QDM::Code.new(race['code'], race['codeSystem'], race['name'], Utils.code_system_helper(race['codeSystem']))
90
+ # 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')
90
92
  patient.dataElements << QDM::PatientCharacteristicRace.new(dataElementCodes: [code])
91
93
  end
92
94
 
93
95
  # Convert patient characteristic sex.
94
96
  sex = record.gender
95
97
  if sex
96
- code = QDM::Code.new(sex, 'AdministrativeSex', Utils.code_system_helper('AdministrativeSex'))
98
+ # See: https://phinvads.cdc.gov/vads/ViewCodeSystem.action?id=2.16.840.1.113883.5.1
99
+ code = QDM::Code.new(sex, 'AdministrativeGender', sex, '2.16.840.1.113883.5.1')
97
100
  patient.dataElements << QDM::PatientCharacteristicSex.new(dataElementCodes: [code])
98
101
  end
99
102
 
@@ -278,7 +278,7 @@ module CQM::Converter
278
278
  # Convert patient characteristic ethnicity.
279
279
  ethnicity = get_data_elements(patient, 'patient_characteristic', 'ethnicity').first
280
280
  ethnicity_code = ethnicity.dataElementCodes.first.symbolize_keys if ethnicity.dataElementCodes.any?
281
- record.ethnicity = { code: ethnicity_code[:code], name: ethnicity_code[:descriptor], codeSystem: ethnicity_code[:codeSystem] } if ethnicity_code
281
+ record.ethnicity = { code: ethnicity_code[:code], name: ethnicity_code[:descriptor], codeSystem: 'CDC Race' } if ethnicity_code
282
282
 
283
283
  # Convert patient characteristic expired.
284
284
  expired = get_data_elements_by_type(patient, 'QDM::PatientCharacteristicExpired').first
@@ -288,7 +288,7 @@ module CQM::Converter
288
288
  # Convert patient characteristic race.
289
289
  race = get_data_elements(patient, 'patient_characteristic', 'race').first
290
290
  race_code = race.dataElementCodes.first.symbolize_keys if race.dataElementCodes.any?
291
- record.race = { code: race_code[:code], name: race_code[:descriptor], codeSystem: race_code[:codeSystem] } if race_code
291
+ record.race = { code: race_code[:code], name: race_code[:descriptor], codeSystem: 'CDC Race' } if race_code
292
292
 
293
293
  # Convert patient characteristic sex.
294
294
  sex = get_data_elements_by_type(patient, 'QDM::PatientCharacteristicSex').first
@@ -194,9 +194,5 @@ module CQM::Converter
194
194
  category
195
195
  end
196
196
  end
197
-
198
- def self.code_system_helper(code_system)
199
- HealthDataStandards::Util::CodeSystemHelper::CODE_SYSTEMS.key(code_system)
200
- end
201
197
  end
202
198
  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.0
4
+ version: 0.3.1
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-04-24 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport