Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #58 from projecttacoma/negation_oids
Browse files Browse the repository at this point in the history
Bugfix: Patient builder correctly pulls negation OID from source criteria
  • Loading branch information
rdingwell committed Jan 15, 2014
2 parents d821cf3 + c434c1c commit 3c993bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/measures/patient_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def self.rebuild_patient(patient)
end

def self.get_vs_oids(source_data_criteria)
oids = [source_data_criteria['code_list_id']]
oids = [source_data_criteria['code_list_id'], source_data_criteria['negation_code_list_id']]
oids.concat source_data_criteria['field_values'].values.collect {|field| field['code_list_id']} if source_data_criteria['field_values']
oids.concat source_data_criteria['value'].collect {|value| value['code_list_id']} if source_data_criteria['value']
oids.compact.uniq
Expand Down
9 changes: 9 additions & 0 deletions test/unit/patient_builder_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,13 @@ class PatientBuilderTest < ActiveSupport::TestCase
assert_equal({"code_system"=>"CPT", "code"=>"CHACHA2", "title"=>nil}, entry.ordinality, "Should have created an ordinal filed value")
end

test "get value sets" do
vs_oids = Measures::PatientBuilder.get_vs_oids(@coded_source_data_critria)
assert vs_oids.include?('2.16.840.1.113883.3.464.1003.102.12.1011')
assert vs_oids.include?('2.16.840.1.113883.3.464.1003.106.12.1005')
assert vs_oids.include?('2.16.840.1.113883.3.464.1003.102.12.1011')
assert vs_oids.include?('2.16.840.1.113883.3.526.3.1139')
assert vs_oids.include?('2.16.840.1.113883.3.526.3.1492')
end

end

0 comments on commit 3c993bf

Please sign in to comment.