lis 0.4.10 → 0.4.11

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,24 +1,15 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
1
+ *.swp
5
2
  *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
3
  *~
10
- \#*
4
+ .DS_Store
11
5
  .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
6
+ .ruby-version
20
7
  .yardoc
21
- doc
22
-
23
- ## PROJECT::SPECIFIC
24
8
  Gemfile.lock
9
+ \#*
10
+ coverage
11
+ doc
12
+ pkg
13
+ rdoc
14
+ tags
15
+ tmtags
@@ -61,6 +61,7 @@ class LIS::HTTPInterface
61
61
  private
62
62
 
63
63
  def uri(device_name, barcode, test_name = nil)
64
+ barcode = barcode.to_s.gsub(/[^a-z0-9_-]/i,'')
64
65
  id = [device_name, barcode].join("-")
65
66
 
66
67
  s = [@endpoint, id, test_name].compact.join("/")
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module LIS
4
- VERSION = "0.4.10"
4
+ VERSION = "0.4.11"
5
5
  end
6
6
 
@@ -34,6 +34,34 @@ class TestHTTPInterface < Test::Unit::TestCase
34
34
  end
35
35
  end
36
36
 
37
+ context "posting a result" do
38
+ setup do
39
+ @order = LIS::Message::Order.from_string("O|1|RV-3/13 A||^^^TSH|R|||||||||||||||||||DPCCIRRUS")
40
+ @string = %q(R|1|^^^TSH|1,14|mIU/L|0,400\0,004^4,00\75,0|N|N|F|||19931011091233|19931011091233|DPCCIRRUS)
41
+ @result = LIS::Message::Result.from_string(@string)
42
+ end
43
+
44
+ should "post correct data to the HTTP endpoint" do
45
+ result_stub = stub_request(:post, "http://localhost/lis/LIS1-RV-313A/TSH").
46
+ with(:body => { "flags"=>"N",
47
+ "result_timestamp"=>"1993-10-11T09:12:33+00:00",
48
+ "status"=>"F",
49
+ "test_name"=>"TSH",
50
+ "unit"=>"mIU/L",
51
+ "value"=>"1,14",
52
+ "raw" => Base64.encode64(@string)
53
+ },
54
+ :headers => { 'Accept' => 'application/json',
55
+ 'Content-Type' => 'application/json' }).
56
+ to_return(:status => 200, :body => "", :headers => {})
57
+
58
+ @interface.send_result(@device_name, @order, @result)
59
+ assert_requested(result_stub)
60
+ end
61
+
62
+ end
63
+
64
+
37
65
  context "requesting test" do
38
66
  setup do
39
67
  @http_result = { "id" => "1234",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-23 00:00:00.000000000 Z
12
+ date: 2013-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: packet_io