451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
|
# File 'lib/oddb2xml/extractor.rb', line 451
def to_arry
data = []
case @type
when :company
while line = @io.gets
row = line.chomp.split("\t")
next if row[0] =~ /^GLN/
data << {
:data_origin => 'medreg',
:gln => row[0].to_s.gsub(/[^0-9]/, ''),
:name_1 => row[1].to_s,
:name_2 => row[2].to_s,
:address => row[3].to_s,
:number => row[4].to_s,
:post => row[5].to_s,
:place => row[6].to_s,
:region => row[7].to_s,
:country => row[8].to_s,
:type => row[9].to_s,
:authorization => row[10].to_s,
}
end
when :person
while line = @io.gets
row = line.chomp.split("\t")
next if row[0] =~ /^GLN/
data << {
:data_origin => 'medreg',
:gln => row[0].to_s.gsub(/[^0-9]/, ''),
:last_name => row[1].to_s,
:first_name => row[2].to_s,
:post => row[3].to_s,
:place => row[4].to_s,
:region => row[5].to_s,
:country => row[6].to_s,
:license => row[7].to_s,
:certificate => row[8].to_s,
:authorization => row[9].to_s,
}
end
end
data
end
|