lis 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/features/step_definitions/lis_steps.rb +0 -3
- data/features/support/env.rb +1 -1
- data/lib/lis.rb +2 -0
- data/lib/lis/http_interface.rb +9 -5
- data/lib/lis/messages/result.rb +1 -1
- data/lib/lis/transfer/astm_e1394.rb +4 -4
- data/lib/lis/version.rb +1 -1
- data/test/helper.rb +2 -0
- data/test/test_http_interface.rb +4 -1
- data/vendor/lis.service +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzJkNjFkOTYxYWNlY2RiMzhkOGI5OThiOGMyYmQxZDFhNmFhNTBjZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGQxMjljYWQ1ZmE4MzAzZTIyYjczOWYxNjFjNTVjZGI4ZGZmZWViNw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTZlM2E4ZTcwMTE4M2EwMTY3ZjZkZDg5OWI4NTQwNDRjNGRiMGZkYTY1YTYz
|
10
|
+
MGMyZWU3MzQ3ZDU3MWJlMjkwMWI4M2FmMDY2MDZhYTEzMmYzMDJkZTU3OWIz
|
11
|
+
MmYwOGEzMTk1NDFjZTE2OTJkOTI5Y2VjM2Q3MDQxMjA4NDQyMjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTQ5MTQxMjgwN2E2N2M2NjczM2FhMGY0MTljNjA2Mjc3ODViMDFhODAxZWIx
|
14
|
+
MmNiYjM1MDA3N2NlOTBkMWU4NTAxOGM5NjUzOTZkM2IyNTY3NjM0Y2QxMTAz
|
15
|
+
N2QxYzY0NTNmOGZjNGVjYjg1MTZmNTMwNzFkYjc1NWUxMzZhMTI=
|
data/features/support/env.rb
CHANGED
data/lib/lis.rb
CHANGED
data/lib/lis/http_interface.rb
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
require 'httparty'
|
4
4
|
|
5
5
|
class LIS::HTTPInterface
|
6
|
+
class HTTP
|
7
|
+
include HTTParty
|
8
|
+
format :json
|
9
|
+
headers 'Accept' => 'application/json', 'Content-Type' => 'application/json'
|
10
|
+
end
|
11
|
+
|
12
|
+
|
6
13
|
def initialize(endpoint)
|
7
14
|
@endpoint = endpoint
|
8
15
|
end
|
@@ -17,7 +24,7 @@ class LIS::HTTPInterface
|
|
17
24
|
#
|
18
25
|
def load_requests(device_name, barcode)
|
19
26
|
begin
|
20
|
-
result =
|
27
|
+
result = HTTP.get(uri(device_name, barcode))
|
21
28
|
data = LIS::Data::Request.from_yaml(result.body, barcode)
|
22
29
|
rescue Exception => e
|
23
30
|
puts e
|
@@ -25,8 +32,6 @@ class LIS::HTTPInterface
|
|
25
32
|
data = nil
|
26
33
|
end
|
27
34
|
|
28
|
-
warn "data: #{data.inspect}" if $VERBOSE
|
29
|
-
|
30
35
|
data
|
31
36
|
end
|
32
37
|
|
@@ -51,7 +56,7 @@ class LIS::HTTPInterface
|
|
51
56
|
|
52
57
|
# FIXME: WTF: should not just catch everything
|
53
58
|
begin
|
54
|
-
res =
|
59
|
+
res = HTTP.post(uri(device_name, barcode, order.universal_test_id), :body => data.to_json)
|
55
60
|
rescue Exception => e
|
56
61
|
puts "EXCEPTION"
|
57
62
|
p e
|
@@ -65,7 +70,6 @@ class LIS::HTTPInterface
|
|
65
70
|
id = [device_name, barcode].join("-")
|
66
71
|
|
67
72
|
s = [@endpoint, id, test_name].compact.join("/")
|
68
|
-
warn "uri: #{s}" if $VERBOSE
|
69
73
|
|
70
74
|
s
|
71
75
|
end
|
data/lib/lis/messages/result.rb
CHANGED
@@ -16,16 +16,16 @@ module LIS::Transfer
|
|
16
16
|
# - :idle :: when a transmission is finished (after EOT is received)
|
17
17
|
#
|
18
18
|
class ASTM::E1394 < ::PacketIO::Base
|
19
|
+
EOT = "\004"
|
20
|
+
ENQ = "\005"
|
19
21
|
ACK = "\006"
|
20
22
|
NAK = "\025"
|
21
|
-
ENQ = "\005"
|
22
|
-
EOT = "\004"
|
23
23
|
|
24
24
|
# format of a message
|
25
25
|
RX = /(?:
|
26
|
-
\005 | # ENQ - start a transaction
|
27
26
|
\004 | # EOT - ends a transaction
|
28
|
-
\005 | #
|
27
|
+
\005 | # ENQ - start a transaction
|
28
|
+
\006 | # ACK
|
29
29
|
\025 | # NAK
|
30
30
|
(?:\002 (.) (.*?) \015 \003 (.+?) \015 \012) # a message with a checksum
|
31
31
|
# | | `-- checksum
|
data/lib/lis/version.rb
CHANGED
data/test/helper.rb
CHANGED
data/test/test_http_interface.rb
CHANGED
@@ -23,7 +23,10 @@ class TestHTTPInterface < Test::Unit::TestCase
|
|
23
23
|
"test_name"=>"TSTID",
|
24
24
|
"unit"=>"mIU/mL",
|
25
25
|
"value"=>"8.2",
|
26
|
-
"raw"
|
26
|
+
"raw" => Base64.encode64(@string)
|
27
|
+
},
|
28
|
+
:headers => { 'Accept' => 'application/json',
|
29
|
+
'Content-Type' => 'application/json' }).
|
27
30
|
to_return(:status => 200, :body => "", :headers => {})
|
28
31
|
|
29
32
|
@interface.send_result(@device_name, @order, @result)
|
data/vendor/lis.service
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Levin Alexander
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: packet_io
|
@@ -198,6 +198,7 @@ files:
|
|
198
198
|
- test/test_astm_e1394.rb
|
199
199
|
- test/test_http_interface.rb
|
200
200
|
- test/test_messages.rb
|
201
|
+
- vendor/lis.service
|
201
202
|
homepage: http://github.com/levinalex/lis
|
202
203
|
licenses: []
|
203
204
|
metadata: {}
|