health-data-standards 3.2.10 → 3.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGM5OTQwZTgxMjkxY2FhNTYyZGE2YTBiNWI1NWVkZTQ5ZjM5NzQ1NQ==
4
+ ZmQ1ZDk1ZWEwZDBiYjEwZGEzZDNiMjdiNDQzNjdjNTdlOTdmYjM0Mg==
5
5
  data.tar.gz: !binary |-
6
- YTc2MTA2NGE4ODFhY2ZjY2QzZjIxYjk2NTk5ZGExYjA0ZDQ5Nzc2Mw==
6
+ ZTY5ZDk0Y2IwNDM4MDg1ZjFiNDEyOWE4MGVkNTdlNTgyYWJmNjNmYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjhjZTJmM2EwOGU4YzQ5ZWViMmFhZWJkYTNiMzJiYTQzOTgwNTRlM2E3MmI4
10
- MTQ2ZTgzYmY3NDhiMzViNjlkOTk3NmNiZTczOTYwNjA2ZWFiMDJmZmUyMzJm
11
- ZTE3ZDE3M2Q4ZGUyNzE1ZGRjZTUwYTM5ZDcyMGMyNmE0Yjk3ZTA=
9
+ YmNhMTUzM2ZhYzliZDFhODU2NTc5ZTBlM2ZlMDgxYTliNWEyYWM4ZmU1MTFk
10
+ NDkyNzEwNzVkYmI5ZmNiZWJlMDNlZjNlOWU2ODU4Y2FjMmM3YTIwM2JkN2Y3
11
+ NTk0ZjBiNzkzMTIxYzY2M2IzYjExNTRmMmY2MmU1NjM0Y2RkNmI=
12
12
  data.tar.gz: !binary |-
13
- OTUzYTZmMTAxYzI1YmYwMGQ2NTFlODEwNGUxZGU1Y2Q4NzM5ZjliOGI0Njlk
14
- NzU1MThmNTAzNGUzZTUzM2Q2NWM2ODA0ZWIzNzBiNDRjZmJmZTJhYzMxMWU1
15
- MzA4NzY5Yzc2YWYwNDc1NGEyOWRkZGM4Y2Q4ZWMxZTEyYjJkZGE=
13
+ YTgxOGY4MDBlMGY1NmM3MDQ3ZTFmNTc5ZDExOTliNWI1YTVhNzgzZGJjNDEw
14
+ MWU4NmY1OTJlMjBmMGI5MzBlOGUxYWQwOGMwMTc4NWI5N2MyMzRhM2Y0MzQy
15
+ OTVkOWM2MjU3MWUxOTkwZWMwYWI3Yzg4ZDdmYzdjOWFlMmM1MWE=
@@ -92,6 +92,10 @@ module HealthDataStandards
92
92
  entries.concat patient.entries_for_oid('2.16.840.1.113883.3.560.1.63')
93
93
  when '2.16.840.1.113883.3.560.1.63'
94
94
  entries.concat patient.entries_for_oid('2.16.840.1.113883.3.560.1.6')
95
+ when '2.16.840.1.113883.3.560.1.3'
96
+ entries.concat patient.entries_for_oid('2.16.840.1.113883.3.560.1.11')
97
+ when '2.16.840.1.113883.3.560.1.11'
98
+ entries.concat patient.entries_for_oid('2.16.840.1.113883.3.560.1.3')
95
99
  end
96
100
 
97
101
  codes = (value_set_map(patient["bundle_id"])[data_criteria.code_list_id] || [])
@@ -0,0 +1,46 @@
1
+ # This is a freedom patch that will only be applied when using JRuby
2
+ # Currently, Nokogiri does not properly handle namespace prefixes
3
+ # when they are set on the document root and then used in XPath
4
+ # expressions. We should be able to remove this patch if/when
5
+ # Rob's pull request is accepted:
6
+ # https://github.com/sparklemotion/nokogiri/pull/959
7
+ if RUBY_PLATFORM.include?('java')
8
+ module Nokogiri
9
+ module XML
10
+ NAMESPACES = {'cda' => 'urn:hl7-org:v3',
11
+ 'sdtc' => 'urn:hl7-org:sdtc',
12
+ 'gc32' => 'urn:hl7-org:greencda:c32',
13
+ 'ccr' => 'urn:astm-org:CCR',
14
+ 'vs' => 'urn:ihe:iti:svs:2008',
15
+ 'xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
16
+ 'hrf-md' => 'http://www.hl7.org/schemas/hdata/2009/11/metadata',
17
+ 'nlm' => 'urn:ihe:iti:svs:2008'
18
+ }
19
+ class Node
20
+ alias_method :old_at_xpath, :at_xpath
21
+ alias_method :old_xpath, :xpath
22
+
23
+ def xpath(*args)
24
+ old_xpath(*args, NAMESPACES)
25
+ end
26
+
27
+ def at_xpath(*args)
28
+ old_at_xpath(*args, NAMESPACES)
29
+ end
30
+ end
31
+
32
+ class NodeSet
33
+ alias_method :old_at_xpath, :at_xpath
34
+ alias_method :old_xpath, :xpath
35
+
36
+ def xpath(*args)
37
+ old_xpath(*args, NAMESPACES)
38
+ end
39
+
40
+ def at_xpath(*args)
41
+ old_at_xpath(*args, NAMESPACES)
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -32,7 +32,7 @@ module HealthDataStandards
32
32
  provider = {}
33
33
  entity = performer.xpath(entity_path)
34
34
 
35
- name = entity.xpath("./cda:assignedPerson/cda:name")
35
+ name = entity.at_xpath("./cda:assignedPerson/cda:name")
36
36
  provider[:title] = extract_data(name, "./cda:prefix")
37
37
  provider[:given_name] = extract_data(name, "./cda:given[1]")
38
38
  provider[:family_name] = extract_data(name, "./cda:family")
@@ -51,6 +51,7 @@ module HealthDataStandards
51
51
  provider[:telecoms] = performer.xpath("./cda:assignedEntity/cda:telecom").try(:map) {|te| import_telecom(te)}
52
52
 
53
53
  provider[:npi] = npi if Provider.valid_npi?(npi)
54
+
54
55
  provider
55
56
  end
56
57
 
@@ -61,7 +62,7 @@ module HealthDataStandards
61
62
 
62
63
  # Returns nil if result is an empty string, block allows text munging of result if there is one
63
64
  def extract_data(subject, query)
64
- result = subject.xpath(query).text
65
+ result = subject.try(:xpath,query).try(:text)
65
66
  if result == ""
66
67
  nil
67
68
  else
@@ -3,6 +3,32 @@ require 'health-data-standards'
3
3
  db_name = ENV['DB_NAME'] || 'test'
4
4
 
5
5
  namespace :bundle do
6
+
7
+ desc 'Activate/Inactivate a measure bundle'
8
+ task :activate,[:version,:active] => [:environment] do |task, args|
9
+ bundle = Bundle.where({version: args.version})
10
+ if bundle.count == 0
11
+ puts "Cannot find bundle with version number #{args.version}"
12
+ return
13
+ end
14
+
15
+ bundle.each do |b|
16
+ b.active = (args.active == "true")
17
+ b.save
18
+ puts "Bundle #{b.title} - #{b.version} active: #{b.active}"
19
+ end
20
+
21
+ end
22
+
23
+
24
+ desc 'List bundles'
25
+ task :list => [:environment] do
26
+ Bundle.where({}).each do |b|
27
+ puts "Bundle #{b.title} - #{b.version} active: #{b.active}"
28
+ end
29
+ end
30
+
31
+
6
32
  desc 'Import a quality bundle into the database.'
7
33
  task :import, [:bundle_path, :delete_existing, :update_measures, :type, :create_indexes] => [:environment] do |task, args|
8
34
  raise "The path to the measures zip file must be specified" unless args.bundle_path
@@ -12,6 +12,7 @@ require 'memoist'
12
12
  # Freedom patches
13
13
  require_relative 'health-data-standards/ext/symbol'
14
14
  require_relative 'health-data-standards/ext/string'
15
+ require_relative 'health-data-standards/ext/node'
15
16
 
16
17
  require_relative 'health-data-standards/util/hl7_helper'
17
18
  require_relative 'health-data-standards/util/code_system_helper'
@@ -14,7 +14,7 @@
14
14
  <!-- Attribute: discharge datetime -->
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
- <%== render(:partial => 'ordinality', :locals => {:entry => entry, :reason_oids=>field_oids["ORDINALITY"]}) %>
17
+ <%== render(:partial => 'ordinality', :locals => {:entry => entry, :reason_oids=>field_oids["ORDINAL"]}) %>
18
18
 
19
19
  <%== code_display(entry, {'tag_name' => 'value', 'value_set_map' => value_set_map,'preferred_code_sets' => ['LOINC', 'SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM'],
20
20
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\""}) %>
@@ -15,7 +15,7 @@
15
15
  <!-- Attribute: Stop Datetime -->
16
16
  <high <%= value_or_null_flavor(entry.end_time) %>/>
17
17
  </effectiveTime>
18
- <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINALITY"]}) %>
18
+ <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINAL"]}) %>
19
19
 
20
20
  <%== code_display(entry, 'value_set_map' => value_set_map,'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'LOINC'], 'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
21
21
  <!-- Status -->
@@ -14,7 +14,7 @@
14
14
  <!-- Attribute: Stop Datetime -->
15
15
  <high <%= value_or_null_flavor(entry.end_time) %>/>
16
16
  </effectiveTime>
17
- <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINALITY"]}}) %>
17
+ <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINAL"]}}) %>
18
18
 
19
19
  <%== code_display(entry, 'value_set_map' => value_set_map,'tag_name' => 'value', 'preferred_code_sets' => ['SNOMED-CT', 'ICD-9-CM', 'ICD-10-CM', 'CPT'],
20
20
  'extra_content' => "xsi:type=\"CD\" sdtc:valueSet=\"#{value_set_oid}\"") %>
@@ -12,7 +12,7 @@
12
12
  <low <%= value_or_null_flavor(entry.start_time) %>/>
13
13
  <high <%= value_or_null_flavor(entry.end_time) %>/>
14
14
  </effectiveTime>
15
- <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINALITY"]}) %>
15
+ <%== render(:partial => 'ordinality', :locals => {:entry => entry, :ordinality_oids=>field_oids["ORDINAL"]}) %>
16
16
  <%== render(:partial => 'reason', :locals => {:entry => entry, :reason_oids=>field_oids["REASON"]}) %>
17
17
  <% if entry.respond_to?(:incision_time) && entry.incision_time.present? -%>
18
18
  <entryRelationship typeCode="REFR">
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health-data-standards
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.10
4
+ version: 3.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Gregorowicz
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-08-28 00:00:00.000000000 Z
15
+ date: 2013-09-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rest-client
@@ -180,6 +180,7 @@ files:
180
180
  - lib/health-data-standards/export/rendering_context.rb
181
181
  - lib/health-data-standards/export/template_helper.rb
182
182
  - lib/health-data-standards/export/view_helper.rb
183
+ - lib/health-data-standards/ext/node.rb
183
184
  - lib/health-data-standards/ext/string.rb
184
185
  - lib/health-data-standards/ext/symbol.rb
185
186
  - lib/health-data-standards/import/bundle/importer.rb
@@ -505,7 +506,8 @@ files:
505
506
  - Rakefile
506
507
  - VERSION
507
508
  homepage: https://github.com/projectcypress/health-data-standards
508
- licenses: []
509
+ licenses:
510
+ - APL 2.0
509
511
  metadata: {}
510
512
  post_install_message:
511
513
  rdoc_options: []