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 +10 -19
- data/lib/lis/http_interface.rb +1 -0
- data/lib/lis/version.rb +1 -1
- data/test/test_http_interface.rb +28 -0
- metadata +2 -2
data/.gitignore
CHANGED
@@ -1,24 +1,15 @@
|
|
1
|
-
|
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
|
data/lib/lis/http_interface.rb
CHANGED
data/lib/lis/version.rb
CHANGED
data/test/test_http_interface.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: packet_io
|