Skip to content

Instantly share code, notes, and snippets.

class Email
attr_accessor :is_set, :alert_name, :from, :to, :subject, :priority, :include_trigger, :include_trigger_time,
:report_server_enabled, :inline, :send_results, :use_ns_subject
def initialize(is_set: "1", alert_name: "no-reply@email", from: "no-reply@email", to: "no-reply@email",
priority: "2", include_trigger: "1", include_trigger_time: "1", report_server_enabled: "0", inline: "1",
send_results: "1", use_ns_subject: "1")
@is_set = is_set
@alert_name = alert_name
@from = "\" " + alert_name + " \"" + from
class Email
attr_accessor :is_set, :alertname, :from, :to, :subject, :priority, :include_trigger, :include_trigger_time, :reportServerEnabled, :inline, :sendresults, :useNSSubject
def initialize(is_set: "1", alertname: "no-reply@email", from: "no-reply@email", to: "no-reply@email", priority: "2", include_trigger: "1", include_trigger_time: "1", reportServerEnabled: "0", inline: "1", sendresults: "1", useNSSubject: "1")
@is_set = is_set
@alertname = alertname
@from = "\" " + alertname + " \"" + from
@to = to
@subject = alertname
@priority = priority
require 'spreadsheet'
class Claim
@@no_of_claims = 0
attr_accessor :payor
attr_accessor :patient
attr_accessor :total
attr_accessor :date_range
attr_accessor :sent_date
attr_accessor :comments
Error:
=== Will include all ruby core libraries
C:/Ruby22/lib/ruby/2.2.0/Win32API.rb:16:in `initialize': no implicit conversion
from nil to integer (TypeError)
from C:/Ruby22/lib/ruby/2.2.0/Win32API.rb:16:in `new'
from C:/Ruby22/lib/ruby/2.2.0/Win32API.rb:16:in `initialize'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.4/bin/ocra:951:in `new'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/ocra-1.3.4/bin/ocra:951:in `load
require 'spreadsheet'
def help
print "
You must pass in the path to the file to launch.
Usage: ruby #{__FILE__} path/to/target_file
"
end
class Claim
require 'spreadsheet'
def help
print "
You must pass in the path to the file to launch.
Usage: ruby #{__FILE__} path/to/target_file
"
end
class Claim
def file_operation
dir = Dir.open(__dir__)
newbook = Spreadsheet::Workbook.new
newsheet1 = newbook.create_worksheet
dir.each do |file|
if File.extname(file) != '.ub4'
next if File.extname(file) != '.npi'
end
claim_array = File.readlines(file).map(&:chomp)
if File.extname(file) == '.ub4'
if ARGV == 'help'
help
exit
else
file_operation
move
end
def ub04
book = RubyXL::Parser.parse('ub04.xlsx')
newbook = RubyXL::Workbook.new
newsheet1 = newbook[0]
# THIS CODE IS FINE
print newsheet1[0][2]
sheet1 = book[0]
sheet1.each_with_index() { |row, index |
break if row[0].value == nil
next if index == 0
book = RubyXL::Parser.parse('ub04.xlsx')
newbook = RubyXL::Workbook.new
newsheet1 = newbook[0]
sheet1 = book[0]
sheet1.each_with_index() { |row, index |
break if row[0] == nil
next if index == 0
# Column 3
col_3 = row[104]
# this just prints a bunch of <RubyXL::Cell:0x007fcb4ea12900>