Skip to content

Instantly share code, notes, and snippets.

View marks's full-sized avatar

Mark Silverberg marks

View GitHub Profile
@marks
marks / non_federal_exchanges.txt
Last active December 24, 2015 14:59
Interactive portion of my blog post about healthcare.gov individual and small business insurance exchange premiums by county at http://socialhealthinsights.com/2013/10/healthcare-gov-open-data/
To start this process, here is a list of the 17 other health insurance exchanges:
* California – Covered California (http://www.coveredca.com)
- PDF of the four plan levels (Platinum, Gold, Silver, Bronze): https://www.coveredca.com/PDFs/English/CoveredCA-HealthPlanBenefitsComparisonChart.pdf
- PDF of pricing by region: https://www.coveredca.com/PDFs/English/booklets/CC-health-plans-booklet-rev2.pdf
- Finding: there are 19 different pricing regions which are split up by counties. Each pricing region lists number of subsidy-eligible individuals in that area and also which insurance providers are providing plans in the region
- Finding: there are 12 different insurance plan providers
* Colorado – Connect for Health Colorado (http://www.connectforhealthco.com)
- I couldn't seem to browse plans without putting in location/age/etc information
@marks
marks / ruby_code.rb
Last active December 21, 2015 12:59
Some real quick code to extract NDC values and specific attributes from a FDA SPL XML document. Provided as-is.
# Input: FDA SPL XML file (can be found at http://dailymed.nlm.nih.gov/dailymed/)
# Output: Array of hashes containing NDCs and their sizes
# This code is provided AS-IS: THE INFORMATION CONTAINED HEREIN OR ANY SITE-RELATED SERVICE, IS PROVIDED "AS IS" WITH NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. YOU ASSUME TOTAL RESPONSIBILITY AND RISK FOR YOUR USE OF THIS SITE, SITE-RELATED SERVICES, AND ANY HYPERLINKED WEBSITES.
require 'pp'
require 'rexml/document'
xml_file = "12e3a517-4858-42f3-ab2e-062f1a592737.xml" # or use ARGV[0] to take in a command-line argument
xml_doc = REXML::Document.new(File.read(xml_file))
@marks
marks / checkqm_support_tropo.rb
Created August 19, 2013 15:41
Open-sourced Tropo scripting app code for CheckQM.com Blog post: http://socialhealthinsights.com/2013/08/checkqm-support-powered-by-tropo/
wait(1500)
answer
say "Thank you for calling Check Q M support."
# if time's hour is between 13 and 21 UTC (9a and 5pm EST) and not on Saturday or Sunday, attempt to transfer to an agent.
# (otherwise, play a recording and suggest they email support@checkqm.com)
day_of_week = Time.now.strftime('%a')
if Time.now.utc.hour >= 13 && Time.now.utc.hour <= 21 && day_of_week != "Sun" && day_of_week != "Sat"
@RedBeard0531
RedBeard0531 / functions.js
Created February 22, 2012 20:13
Min, Max, Sum, Count, Avg, and Std deviation using MongoDB MapReduce
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
function map() {
emit(1, // Or put a GROUP BY key here
{sum: this.value, // the field you want stats for
min: this.value,
max: this.value,
count:1,
diff: 0, // M2,n: sum((val-mean)^2)
});
require 'rubygems'
require 'sinatra'
require 'json'
def json_get(route, options={}, &block)
get(route, options) do
content_type 'text/json'
block.call.to_json
end
end