[Ruby-hl7-users] Empty sections?

Mark Guzman segfault at hasno.info
Tue Jun 19 09:03:53 EDT 2007


Christian,
   Can you send along sample.hl7?
  --mark

Christian Baumann wrote:
> Hello,
>
> I´ld like to know how to handle empty segments?
> Everytime I try to create a Message-object with the following code:
>
> raw_input = open( "sample.hl7" ).readlines
> msg = HL7::Message.new( raw_input )
>
> I get this error message:
>
> c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:253:in
`generate_segments': undefined method `to_sym' for nil:NilClass
(NoMethodError)
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:236:in `each'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:236:in
`generate_segments'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:230:in
`parse_string'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:219:in
`parse_enumerable'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:218:in `each'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:218:in
`parse_enumerable'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:166:in
`parse'
>     from
c:/ruby/lib/ruby/gems/1.8/gems/ruby-hl7-0.1.23/lib/ruby-hl7.rb:90:in
`initialize'
>     from hl7_tries4.rb:5:in `new'
>     from hl7_tries4.rb:5
>
>
> Thy in advance,
> Christian
> _______________________________________________
> Ruby-hl7-users mailing list
> Ruby-hl7-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ruby-hl7-users
>




More information about the Ruby-hl7-users mailing list