lis 0.4.9 → 0.4.10
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.
- data/features/step_definitions/lis_steps.rb +4 -4
- data/lib/lis/transfer/astm_e1394.rb +1 -1
- data/lib/lis/version.rb +1 -1
- data/test/test_astm_e1394.rb +1 -1
- data/test/test_messages.rb +4 -23
- metadata +2 -2
@@ -60,12 +60,12 @@ end
|
|
60
60
|
|
61
61
|
Then /^LIS should have sent test orders to client:$/ do |text|
|
62
62
|
@data = @client.read_all
|
63
|
-
@data.force_encoding("
|
64
|
-
@packets = @data.split("\002").select { |s| s =~ /^\d[A-Z]/
|
63
|
+
@data.force_encoding("utf-8") if @data.respond_to?(:force_encoding)
|
64
|
+
@packets = @data.split("\002").select { |s| s =~ /^\d[A-Z]/ }
|
65
65
|
@packets.zip(text.split(/\n/)) do |actual, expected|
|
66
66
|
@called = true
|
67
|
-
rx = Regexp.new("^" + Regexp.escape(expected.strip
|
68
|
-
assert_match(rx, actual.gsub(/\r\003
|
67
|
+
rx = Regexp.new("^" + Regexp.escape(expected.strip))
|
68
|
+
assert_match(rx, actual.gsub(/\r\003.*$/, "").strip)
|
69
69
|
end
|
70
70
|
assert_equal(true, @called)
|
71
71
|
end
|
data/lib/lis/version.rb
CHANGED
data/test/test_astm_e1394.rb
CHANGED
@@ -74,7 +74,7 @@ class TestPacketizedProtocol < Test::Unit::TestCase
|
|
74
74
|
end
|
75
75
|
|
76
76
|
should "propagate only packet data" do
|
77
|
-
@str = "\0023L|1\r\0033C\r\n"
|
77
|
+
@str = "\0023L|1\r\0033C\r\n"
|
78
78
|
@protocol.receive("\005")
|
79
79
|
@protocol.receive(@str)
|
80
80
|
@protocol.receive("\004")
|
data/test/test_messages.rb
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
1
|
require 'helper'
|
4
2
|
|
5
3
|
class TestMessages < Test::Unit::TestCase
|
6
4
|
|
7
5
|
context "parsing an order message" do
|
8
6
|
setup do
|
9
|
-
@str = "O|1|8780||^^^ATA|R|||||||||||||||||||B0135"
|
7
|
+
@str = "O|1|8780||^^^ATA|R|||||||||||||||||||B0135"
|
10
8
|
@message = LIS::Message::Base.from_string(@str)
|
11
9
|
end
|
12
10
|
|
@@ -26,7 +24,7 @@ class TestMessages < Test::Unit::TestCase
|
|
26
24
|
|
27
25
|
context "parsing a comment message" do
|
28
26
|
setup do
|
29
|
-
@str = "C|1|BAD_QC|"
|
27
|
+
@str = "C|1|BAD_QC|"
|
30
28
|
@message = LIS::Message::Base.from_string(@str)
|
31
29
|
end
|
32
30
|
|
@@ -35,26 +33,9 @@ class TestMessages < Test::Unit::TestCase
|
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
38
|
-
context "parsing a patient message" do
|
39
|
-
setup do
|
40
|
-
@str = "P|1|123||123|Müller^Ulrich Peter||||||||".force_encoding("ASCII-8BIT")
|
41
|
-
@message = LIS::Message::Base.from_string(@str)
|
42
|
-
end
|
43
|
-
|
44
|
-
should "have correct type" do
|
45
|
-
assert_equal LIS::Message::Patient, @message.class
|
46
|
-
assert_equal "P", @message.type_id
|
47
|
-
end
|
48
|
-
|
49
|
-
should "have correct name" do
|
50
|
-
assert_equal "Müller^Ulrich Peter".force_encoding("ASCII-8BIT"), @message.name # FIXME, this should be utf8
|
51
|
-
end
|
52
|
-
|
53
|
-
end
|
54
|
-
|
55
36
|
context "parsing a result message" do
|
56
37
|
setup do
|
57
|
-
@str = "R|1|^^^TSH|0.902|mIU/L|0.400\\0.004^4.00\\75.0|N|N|R|||20100115105636|20100115120641|B0135"
|
38
|
+
@str = "R|1|^^^TSH|0.902|mIU/L|0.400\\0.004^4.00\\75.0|N|N|R|||20100115105636|20100115120641|B0135"
|
58
39
|
@message = LIS::Message::Base.from_string(@str)
|
59
40
|
end
|
60
41
|
|
@@ -84,7 +65,7 @@ class TestMessages < Test::Unit::TestCase
|
|
84
65
|
end
|
85
66
|
|
86
67
|
should "parse empty result messages without error" do
|
87
|
-
@message = LIS::Message::Base.from_string("R|1|^^^||||||X|||||LIAISON"
|
68
|
+
@message = LIS::Message::Base.from_string("R|1|^^^||||||X|||||LIAISON")
|
88
69
|
assert_equal LIS::Message::Result, @message.class
|
89
70
|
end
|
90
71
|
end
|
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.10
|
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-
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: packet_io
|