lib/segments/pid.rb in ruby-hl7-0.1.23 vs lib/segments/pid.rb in ruby-hl7-0.2.44

- old
+ new

@@ -1,6 +1,6 @@ -# $Id: pid.rb 21 2007-03-17 04:49:50Z segfault $ +# $Id: pid.rb 29 2007-05-06 23:13:04Z segfault $ require 'ruby-hl7' class HL7::Message::Segment::PID < HL7::Message::Segment weight 1 add_field :name=>:set_id add_field :name=>:patient_id @@ -8,10 +8,10 @@ add_field :name=>:alt_patient_id add_field :name=>:patient_name add_field :name=>:mother_maiden_name add_field :name=>:patient_dob add_field :name=>:admin_sex do |sex| - unless /^[FMOUAN]$/.match(sex) || sex == nil + unless /^[FMOUAN]$/.match(sex) || sex == nil || sex == "" raise HL7::InvalidDataError.new( "bad administrative sex value (not F|M|O|U|A|N)" ) end sex = "" unless sex sex end