ruby-hl7 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ # $Id: test_default_segment.rb 20 2007-03-16 04:17:52Z segfault $
2
+ $: << '../lib'
3
+ require 'test/unit'
4
+ require 'ruby-hl7'
5
+
6
+ class MsaSegment < Test::Unit::TestCase
7
+ def setup
8
+ @base_msa = "MSA|AR|ZZ9380 ERR"
9
+ end
10
+
11
+ def test_storing_existing_segment
12
+ seg = HL7::Message::Segment::Default.new( @base_msa )
13
+ assert_equal( @base_msa, seg.to_s )
14
+ end
15
+
16
+ def test_to_s
17
+ seg = HL7::Message::Segment::Default.new( @base_msa )
18
+ assert_equal( @base_msa, seg.to_s )
19
+ assert_equal( seg.to_s, seg.to_hl7 )
20
+ end
21
+
22
+ def test_create_raw_segment
23
+ seg = HL7::Message::Segment::Default.new
24
+ seg.e0 = "NK1"
25
+ seg.e1 = "INFO"
26
+ seg.e2 = "MORE INFO"
27
+ seg.e5 = "LAST INFO"
28
+ assert_equal( "NK1|INFO|MORE INFO|||LAST INFO", seg.to_s )
29
+ end
30
+
31
+ end
@@ -0,0 +1,27 @@
1
+ # $Id: test_msa_segment.rb 18 2007-03-15 01:23:10Z segfault $
2
+ $: << '../lib'
3
+ require 'test/unit'
4
+ require 'ruby-hl7'
5
+
6
+ class MsaSegment < Test::Unit::TestCase
7
+ def setup
8
+ @base_msa = "MSA|AR|ZZ9380 ERR"
9
+ end
10
+
11
+ def test_create_msa
12
+ assert_nothing_raised do
13
+ msa = HL7::Message::Segment::MSA.new( @base_msa )
14
+ assert_not_nil( msa )
15
+ assert_equal( @base_msa, msa.to_s )
16
+ end
17
+ end
18
+
19
+ def test_access_msa
20
+ assert_nothing_raised do
21
+ msa = HL7::Message::Segment::MSA.new( @base_msa )
22
+ assert_equal( "AR", msa.ack_code )
23
+ assert_equal( "ZZ9380 ERR", msa.control_id )
24
+ end
25
+ end
26
+
27
+ end
@@ -0,0 +1,29 @@
1
+ # $Id: test_obr_segment.rb 18 2007-03-15 01:23:10Z segfault $
2
+ $: << '../lib'
3
+ require 'test/unit'
4
+ require 'ruby-hl7'
5
+
6
+ class ObrSegment < Test::Unit::TestCase
7
+ def setup
8
+ @base = "OBR|2|^DMCRES|0000000567^RADIS1|37956^CT ABDOMEN^L|||199405021550|||||||||||||0000763|||||P||||||R/O TUMOR|202300^BAKER^MARK^E|||01^LOCHLEAR, JUDY"
9
+ end
10
+
11
+ def test_read
12
+ obr = HL7::Message::Segment::OBR.new @base
13
+ assert_equal( @base, obr.to_s )
14
+ assert_equal( "2", obr.e1 )
15
+ assert_equal( "2", obr.set_id )
16
+ assert_equal( "^DMCRES", obr.placer_order_number )
17
+ assert_equal( "0000000567^RADIS1", obr.filler_order_number )
18
+ assert_equal( "37956^CT ABDOMEN^L", obr.priority )
19
+ end
20
+
21
+ def test_create
22
+ obr = HL7::Message::Segment::OBR.new
23
+ obr.set_id = 1
24
+ assert_equal( "1", obr.set_id )
25
+ obr.placer_order_number = "^DMCRES"
26
+ assert_equal( "^DMCRES", obr.placer_order_number )
27
+ end
28
+
29
+ end
@@ -0,0 +1,27 @@
1
+ # $Id: test_obx_segment.rb 18 2007-03-15 01:23:10Z segfault $
2
+ $: << '../lib'
3
+ require 'test/unit'
4
+ require 'ruby-hl7'
5
+
6
+ class ObxSegment < Test::Unit::TestCase
7
+ def setup
8
+ @base = "OBX||TX|FIND^FINDINGS^L|1|This is a test on 05/02/94."
9
+ end
10
+
11
+ def test_initial_read
12
+ obx = HL7::Message::Segment::OBX.new @base
13
+ assert_equal( "", obx.set_id )
14
+ assert_equal( "TX", obx.value_type )
15
+ assert_equal( "FIND^FINDINGS^L", obx.observation_id )
16
+ assert_equal( "1", obx.observation_sub_id )
17
+ assert_equal( "This is a test on 05/02/94.", obx.observation_value )
18
+ end
19
+
20
+ def test_creation
21
+ obx = HL7::Message::Segment::OBX.new
22
+ obx.value_type = "TESTIES"
23
+ obx.observation_id = "HR"
24
+ obx.observation_sub_id = "2"
25
+ obx.observation_value = "SOMETHING HAPPENned"
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ # $Id: test_pid_segment.rb 21 2007-03-17 04:49:50Z segfault $
2
+ $: << '../lib'
3
+ require 'test/unit'
4
+ require 'ruby-hl7'
5
+
6
+ class PidSegment < Test::Unit::TestCase
7
+ def setup
8
+ @base = "PID|||333||LastName^FirstName^MiddleInitial^SR^NickName||19760228|F||||||||||555. 55|012345678"
9
+ end
10
+
11
+ def test_admin_sex_limits
12
+ pid = HL7::Message::Segment::PID.new
13
+ assert_nothing_raised do
14
+ vals = %w[F M O U A N] + [ nil ]
15
+ vals.each do |x|
16
+ pid.admin_sex = x
17
+ end
18
+ end
19
+
20
+ assert_raises( HL7::InvalidDataError ) do
21
+ ["TEST", "A", 1, 2].each do |x|
22
+ pid.admin_sex = x
23
+ end
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1 @@
1
+ MSH|^\&|DPS^DPS^GUID||EB^EB||200007250712||ADT^A01|00003|D|2.3|||AL|NE
@@ -0,0 +1 @@
1
+ MSH|^~\&|lightguide|1111-1111-11|bwh-emrs|bwh-emrs|19960116184604||RQI^A04|19960116184604-lightguide-1111-1111-11|P|2.3|||NE|NE|
@@ -0,0 +1 @@
1
+ MSH|^~\&|LAB1||DESTINATION||19910127105114||ORU^R03|LAB1003929
2
 
@@ -0,0 +1,2 @@
1
+ MSH|^~\&|MESA_OP|XYZ_HOSPITAL|MESA_OF|XYZ_RADIOLOGY|||ORM^O01|241104|P|2.3.1||||||||
2
+
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.1
3
+ specification_version: 1
4
+ name: ruby-hl7
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.23
7
+ date: 2007-03-18 00:00:00 -04:00
8
+ summary: Ruby HL7 Library
9
+ require_paths:
10
+ - lib
11
+ email: segfault@hasno.info
12
+ homepage: http://rubyforge.org/ruby-hl7
13
+ rubyforge_project: ruby-hl7
14
+ description: A simple library to parse and generate HL7 2.x messages
15
+ autorequire: ruby-hl7
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Mark Guzman
31
+ files:
32
+ - lib/ruby-hl7.rb
33
+ - lib/segments
34
+ - lib/segments/evn.rb
35
+ - lib/segments/msa.rb
36
+ - lib/segments/msh.rb
37
+ - lib/segments/nte.rb
38
+ - lib/segments/obr.rb
39
+ - lib/segments/obx.rb
40
+ - lib/segments/oru.rb
41
+ - lib/segments/pid.rb
42
+ - lib/segments/pv1.rb
43
+ - lib/segments/pv2.rb
44
+ - lib/segments/qrd.rb
45
+ - lib/segments/qrf.rb
46
+ - test_data/adt_a01.hl7
47
+ - test_data/rqi_r04.hl7
48
+ - test_data/test.hl7
49
+ - test_data/test2.hl7
50
+ - README
51
+ - LICENSE
52
+ test_files:
53
+ - test/test_basic_parsing.rb
54
+ - test/test_default_segment.rb
55
+ - test/test_msa_segment.rb
56
+ - test/test_obr_segment.rb
57
+ - test/test_obx_segment.rb
58
+ - test/test_pid_segment.rb
59
+ rdoc_options: []
60
+
61
+ extra_rdoc_files:
62
+ - README
63
+ - LICENSE
64
+ executables: []
65
+
66
+ extensions: []
67
+
68
+ requirements: []
69
+
70
+ dependencies:
71
+ - !ruby/object:Gem::Dependency
72
+ name: facets
73
+ version_requirement:
74
+ version_requirements: !ruby/object:Gem::Version::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 1.8.51
79
+ version:
80
+ - !ruby/object:Gem::Dependency
81
+ name: rake
82
+ version_requirement:
83
+ version_requirements: !ruby/object:Gem::Version::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: 0.7.2
88
+ version:
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubyforge
91
+ version_requirement:
92
+ version_requirements: !ruby/object:Gem::Version::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.1
97
+ version: