Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.redcar
11 changes: 5 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
require 'rake/gempackagetask'
require "rdoc/task"
require "rubygems/package_task"
require 'rake/contrib/sshpublisher'
require 'rbconfig'
require 'rubyforge'
Expand Down Expand Up @@ -117,9 +116,9 @@ Rake::RDocTask.new do |rd|
end


Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_tar = true
end
Gem::PackageTask.new(spec) do |pkg|
pkg.need_tar = true
end

desc 'Clean up all the extras'
task :clean => [ :clobber_rdoc, :clobber_package ] do
Expand Down
13 changes: 13 additions & 0 deletions lib/segments/gt1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: UTF-8
require 'ruby-hl7'
class HL7::Message::Segment::GT1 < HL7::Message::Segment
weight 3 # should occur after PV1 segment
add_field :set_id, :idx => 1
add_field :guarantor_name, :idx => 3
add_field :guarantor_address, :idx => 5
add_field :guarantor_phone, :idx => 6
add_field :guarantor_work_phone, :idx => 7
add_field :guarantor_dob, :idx => 8
add_field :guarantor_sex, :idx => 9
add_field :guarantor_type, :idx => 10
end
8 changes: 5 additions & 3 deletions ruby-hl7.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Gem::Specification.new do |s|
s.files = [
"lib/ruby-hl7.rb",
"lib/segments/evn.rb",
"lib/segments/gt1.rb",
"lib/segments/msa.rb",
"lib/segments/msh.rb",
"lib/segments/nte.rb",
Expand Down Expand Up @@ -51,6 +52,7 @@ Gem::Specification.new do |s|
"test/test_child_segment.rb",
"test/test_default_segment.rb",
"test/test_dynamic_segment_def.rb",
"test/test_gt1_segment.rb",
"test/test_msa_segment.rb",
"test/test_obr_segment.rb",
"test/test_obx_segment.rb",
Expand All @@ -63,14 +65,14 @@ Gem::Specification.new do |s|
s.specification_version = 3

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<rake>, [">= 0.8.7"])
s.add_runtime_dependency(%q<rake>, [">= 10.0.3"])
s.add_runtime_dependency(%q<rubyforge>, [">= 2.0.0"])
else
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<rake>, [">= 10.0.3"])
s.add_dependency(%q<rubyforge>, [">= 2.0.0"])
end
else
s.add_dependency(%q<rake>, [">= 0.8.7"])
s.add_dependency(%q<rake>, [">= 10.0.3"])
s.add_dependency(%q<rubyforge>, [">= 2.0.0"])
end
end
33 changes: 33 additions & 0 deletions test/test_gt1_segment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# encoding: UTF-8
$: << '../lib'
require 'test/unit'
require 'ruby-hl7'

class GT1Segment < Test::Unit::TestCase
def setup
@base = "GT1|||Jane^Doe||123 Guarantor Avenue^^Tucson^AZ^85701|5208675309|5208675310|19010101|F|1"
end

def test_initial_read
gt1 = HL7::Message::Segment::GT1.new @base
assert_equal( "", gt1.set_id )
assert_equal( "Jane^Doe", gt1.guarantor_name )
assert_equal( "123 Guarantor Avenue^^Tucson^AZ^85701", gt1.guarantor_address )
assert_equal( "5208675309", gt1.guarantor_phone )
assert_equal( "5208675310", gt1.guarantor_work_phone )
assert_equal( "19010101", gt1.guarantor_dob )
assert_equal( "F", gt1.guarantor_sex )
assert_equal( "1", gt1.guarantor_type )
end

def test_creation
gt1 = HL7::Message::Segment::GT1.new
gt1.guarantor_name = "John^Doe"
gt1.guarantor_address = "The White House^1600Pennsylvania Avenue NW^Washington^DC^20500"
gt1.guarantor_phone = "2024561111"
gt1.guarantor_work_phone = "2024561414"
gt1.guarantor_dob = "17921013"
gt1.guarantor_sex = "M"
gt1.guarantor_type = "1"
end
end