Skip to content

Commit

Permalink
Fixed bug in parsing times in vital signs
Browse files Browse the repository at this point in the history
  • Loading branch information
eedrummer committed Sep 11, 2012
1 parent 3b335ac commit bff5f75
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
35 changes: 17 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: http://github.com/projectcypress/health-data-standards.git
revision: 41354a3fb14530ded02f5a35fdefac2aec3fa665
revision: 6ede32700d131e227187978817be2a5aa049f175
branch: develop
specs:
health-data-standards (1.0.1)
Expand Down Expand Up @@ -71,10 +71,10 @@ GEM
arel (3.0.2)
attr_required (0.0.5)
bcrypt-ruby (3.0.1)
bson (1.6.4)
bson_ext (1.6.4)
bson (~> 1.6.4)
builder (3.0.0)
bson (1.7.0)
bson_ext (1.7.0)
bson (~> 1.7.0)
builder (3.0.3)
capistrano (2.13.3)
highline
net-scp (>= 1.0.0)
Expand Down Expand Up @@ -103,7 +103,7 @@ GEM
railties (~> 3.1)
warden (~> 1.2.1)
erubis (2.7.0)
eventmachine (0.12.10)
eventmachine (1.0.0)
excon (0.16.2)
execjs (1.4.0)
multi_json (~> 1.0)
Expand All @@ -120,7 +120,7 @@ GEM
nokogiri (> 0.0.0)
sax-machine (>= 0.0.12)
hashie (1.2.0)
heroku (2.30.5)
heroku (2.31.2)
heroku-api (~> 0.3.4)
launchy (>= 0.3.2)
netrc (~> 0.7.7)
Expand All @@ -131,9 +131,9 @@ GEM
highline (1.6.14)
hike (1.2.1)
httpclient (2.2.7)
i18n (0.6.0)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.1)
jquery-rails (2.1.2)
railties (>= 3.1.0, < 5.0)
thor (~> 0.14)
json (1.7.5)
Expand All @@ -142,10 +142,9 @@ GEM
i18n
json (>= 1.4.3)
url_safe_base64
kaminari (0.13.0)
kaminari (0.14.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
launchy (2.1.2)
addressable (~> 2.3)
libv8 (3.3.10.4)
Expand All @@ -159,9 +158,9 @@ GEM
treetop (~> 1.4.8)
method_source (0.8)
mime-types (1.19)
minitest (3.3.0)
mongo (1.6.2)
bson (~> 1.6.2)
minitest (3.4.0)
mongo (1.3.1)
bson (>= 1.3.1)
mongoid (2.4.12)
activemodel (~> 3.1)
mongo (<= 1.6.2)
Expand Down Expand Up @@ -245,7 +244,7 @@ GEM
tilt (~> 1.3)
sax-machine (0.1.0)
nokogiri (> 0.0.0)
slop (3.3.2)
slop (3.3.3)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
Expand All @@ -272,9 +271,9 @@ GEM
turn (0.9.6)
ansi
tzinfo (0.3.33)
uglifier (1.2.7)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.3)
multi_json (~> 1.0, >= 1.0.2)
url_safe_base64 (0.2.1)
uuid (2.3.5)
macaddr (~> 1.0)
Expand All @@ -285,7 +284,7 @@ GEM
activemodel (>= 3.0.0)
warden (1.2.1)
rack (>= 1.0)
webmock (1.8.9)
webmock (1.8.10)
addressable (>= 2.2.7)
crack (>= 0.1.7)
yamler (0.1.0)
Expand Down
2 changes: 1 addition & 1 deletion lib/tatrc/vital_signs_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def set_interval(vs, vs_element)
end

def get_time(time_el)
time = time_el.get_attribute("value").try(:value)
time = time_el.get_attribute("value")
return time ? Time.parse(time).to_i : nil
end

Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/sample_vital_signs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<effectiveTime nullFlavor="NI"/>
<vitalSign>
<resultID nullFlavor="NI"/>
<resultDateTime nullFlavor="NI"/>
<resultDateTime value="19810201113600-0800"/>
<resultType code="8480-6" codeSystem="2.16.840.1.113883.6.1"
displayName="Systolic BP"/>
<resultStatus code="completed"/>
Expand Down
1 change: 1 addition & 0 deletions test/unit/vital_signs_importer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def test_import
vs = vital_signs.first
assert_equal "8480-6", vs.codes["LOINC"].first
assert_equal "Systolic BP", vs.description
assert_equal 349904160, vs.time
assert_equal 115.0, vs.values.first.scalar
assert_equal "mm[Hg]", vs.values.first['units']
end
Expand Down

0 comments on commit bff5f75

Please sign in to comment.