This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]) | |
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |