Skip to content

Instantly share code, notes, and snippets.

@ebot
ebot / gist:108163
Created May 7, 2009 15:31
Audit Report Sample SQL
-- For each user run this query:
Select d.DocId, DocTypeName, OwnerTypeName, CreateDateTime,
EncounterNo, MedRecNo, EnrolleeName
From Documents as d
Inner Join DocTypes as dt on
d.DocType = dt.DocType
Inner Join DocsOwners as do on
d.DocId = do.DocId
Inner Join Owners as o on
do.OwnerId = o.OwnerId
@ebot
ebot / gist:122521
Created June 2, 2009 19:37
batch acquire log file stat maker
#!/usr/bin/env ruby -wKU
total_files = 0
# Looop through each yml file
d = Dir.new(".")
Dir.glob( '*.yml' ) do |file|
file_count = 0
log_file = File.new file, 'r'
log_text = log_file.read
@ebot
ebot / gist:124347
Created June 5, 2009 16:04
ADD0 exit script for streamline
#!/usr/bin/env ruby -wKU
#http://gist.github.com/124347
require 'rubygems'
require 'fastercsv'
require 'yaml'
begin
# Load the config file
ops = YAML::load(File.new('config.yml'))
@ebot
ebot / gist:146431
Created July 13, 2009 20:27
cch-alphasys move script
#!/usr/bin/env ruby -wKU
#http://gist.github.com/gists/146431
require 'fileutils'
tif_dir = "\\\\EDMC0D0a\\C0D0\\OlcReports"
tag_dir = "\\\\EDMC0D0a\\C0D0\\Upload\\Alpha"
begin
Dir.glob("data/*.tif").each do |file|
file_name = File.basename(file)
@ebot
ebot / gist:148478
Created July 16, 2009 15:36
Lesson XML
<?xml version="1.0" encoding="UTF-8"?>
<lesson title="" lang="EN" version="">
<pages>
<page title="" number="">
<text><![CDATA[]]></text>
<overlays>
<overlay type="txt|img|swf|qt">
<source></source>
<xloc></xloc>
<yloc></yloc>
@ebot
ebot / gist:192720
Created September 24, 2009 13:17
Converts the Backpack deinstall xml file to individual textile files per backpack page and. generates an html preview page too.
#!/usr/bin/env ruby -wKU
require 'rexml/document'
require 'rubygems'
require 'RedCloth'
include REXML
doc = Document.new( File.new( 'bpack.xml', 'r' ) )
XPath.match( doc, "//pages/page" ).each do |page|
@ebot
ebot / combine.rb
Created October 6, 2009 12:49
Merge seperate pdfs into one, using iText
#!/usr/bin/env ruby -wKU
require 'rubygems'
require 'fastercsv'
require 'yaml'
begin
# Gather the encounter information
map = YAML::load( File.new( 'encounter-map.yml', 'r' ) )
encounters = {}
@ebot
ebot / _vimrc.conf
Created December 17, 2009 13:49
My vim configuration file.
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
@ebot
ebot / estimate_encounter_size.sql
Created January 14, 2010 19:06
Common EDM Queries
SELECT YEAR(ModifyDateTime) as document_year,
COUNT(TotalKB) as document_count,
(SUM(TotalKB)/1024)/1024 as document_size_gb
FROM Documents as d
INNER JOIN DocTypes as dt ON d.DocType = dt.DocType
INNER JOIN DocArchStg as das ON d.DocID = das.Docid
INNER JOIN DocsOwners as do ON d.DocId = do.DocId
INNER JOIN Encounters as e ON do.OwnerId = e.EncntrOwnerId
GROUP BY YEAR(ModifyDateTime) WITH ROLLUP
@ebot
ebot / gist:287035
Created January 26, 2010 17:44
Taco Bell
#!/usr/bin/env ruby -wKU
#
# A practical example of using modules is the process of making tacos.
# There are 4 main modules: main, Ingredients, Prep, and Serve
#
module TacoBell
class Tacos
def initialize(style = "Mild")
@style = style