Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby -wKU
src_file = File.new 'soar_7-1-1.xml', 'r'
cln_file = File.new 'soar-cleaned_7-1-1.xml', 'w'
cleaned_data = ''
src_file.each_line do |line|
cleaned_data += line.gsub(/[^\20-\x7E\s]/, ' ')
end
h1. ${1:Meeting Title} - `date`
"PSR $2":$3
${4:Meeting Description}
h2. Attendees:
h3. Siemens
#!/usr/bin/env ruby
# http://github.com/mojombo/jekyll/tree/master
require 'rubygems'
require 'sqlite3'
db = SQLite3::Database.new( "blog.db3" )
db.results_as_hash = true
db.execute( "select * from articles" ) do |row|
file_name = row['created_at'].split(" ")[0]
#!/usr/bin/env ruby -wKU
puts "Begin Splitting - #{Time.now}"
header_line = "medical_record_number;encounter_number;encounter_start_date;patient_name;patient_birth_date;ip_op_indicator;encounter_type;doc_id;document_date;documnet_create_date;document_modify_date;doc_type_name;doc_type_description;page_number;signed;signatures;annotation_files;text_notes;file_path"
input = File.new('index.idx', 'r')
line_number = 0
line_limit = 930
file_count = 1
threshold = line_limit
@ebot
ebot / .htaccess
Created February 20, 2009 03:09
Default compression and expires settings for performance and YSlow
# Default compression and expires settings for performance and YSlow
# Set compression
SetOutputFilter DEFLATE
AddOutputFilter DEFLATE css js
AddType text/javascript .js
AddType text/css .css
### turn on the Expires engine
ExpiresActive On
### default expires after a month in the client's cache
@ebot
ebot / cobius_pat_info.rb
Created February 26, 2009 13:14
script to pull patient info from cobius xml files.
#!/usr/bin/env ruby -wKU
require "rexml/document"
require 'FileUtils'
out = File.new 'patient_list.csv', 'w'
out << "medical_record_number,encounter_number,patient_last_name,"
out << "patient_middle_name,patient_first_name\n"
Dir.glob( File.join( '.', '*.XML' ) ) do |cobius_file|
@ebot
ebot / rename_files.rb
Created March 17, 2009 19:06
P0MB - Summit Rename Exit Script
#!/usr/bin/env ruby -wKU
#http://gist.github.com/80716
require 'rubygems'
require 'fastercsv'
begin
csv_options = {:col_sep => ';', :headers => :first_row, :write_headers => true}
index_file = FasterCSV.open '../index.txt', csv_options
new_index = []
@ebot
ebot / audit_process.rb
Created April 7, 2009 18:46
Sample audit config file
#!/usr/bin/env ruby -wKU
require 'yaml'
config = YAML::load( File.open( 'config.yml' ) )
execution_time = config["Execution Time"]
doc_types = config["Document Types"]
user_groups = config["User Groups"]
puts ""
@ebot
ebot / gist:99233
Created April 21, 2009 16:43
Nag Sample Deficiency Report Query
Select docs.DocId, DocTypeName, DocTypeDesc,DocStatus, DefStatusName, OwnerTypeName,
EnrolleeName, docs.CreateDateTime, ModifyDateTime, DocDateTime
From Documents as docs
Inner Join DocsOwners as do on
docs.DocId = do.DocId
Inner Join Encounters as enc on
do.OwnerId = enc.EncntrOwnerId
Inner Join DocTypes as dt on
docs.DocType = dt.DocType
left outer join deficiencies as def on
@ebot
ebot / idea.textile
Created April 30, 2009 20:01
Ideas for Professor: JavaScript XML Object

The Big Idea

  • Create a JavaScript class that converts an xml document into an object.
  • Inspired from Ruby’s XmlSimple.