Skip to content

Instantly share code, notes, and snippets.

View marks's full-sized avatar

Mark Silverberg marks

View GitHub Profile
var path = require('path'),
pg = require('../sources/pg'),
sql = require('sql'),
nmLoader = require('../sources/npi/metaLoader'),
NpiFields = require('../sources/npi/fields'),
Q = require('q'),
logger = require('../logger').server,
fs = require('fs'),
npiFields,
npiQueryableColumns,
@marks
marks / gist:7938512
Created December 13, 2013 01:18
Helping a friend
mba62:Desktop mark$ heroku create migrant-farm-mark
Creating migrant-farm-mark... done, stack is cedar
http://migrant-farm-mark.herokuapp.com/ | git@heroku.com:migrant-farm-mark.git
mba62:Desktop mark$ heroku clone migrant-farm-mark
Cloning from app 'migrant-farm-mark'...
Cloning into 'migrant-farm-mark'...
Initializing repository, done.
warning: You appear to have cloned an empty repository.
Checking connectivity... done
@marks
marks / open_data_metadata_scraper.rb
Created November 19, 2013 14:02
Ruby script that runs daily on ScraperWiki which goes follows links inside known data.json files to collect engagement stats including last updated date, number of comments, download count, view count, and number of times rated. Tweet at @skram or email mark@socialhealthinsights.com with any questions or requests.
# by Mark Silverberg (@skram) of Social Health Insights
# mark@socialhealthinsights.com
#!/usr/bin/env ruby
require 'scraperwiki'
require 'open-uri'
require 'json'
hub_urls = [
@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 / gist:6563510
Last active December 23, 2015 01:59
mba62:ONC-EHR-Incentives-Program-Payout-Data mark$ bundle exec rake hospitals:simple_report
loading config file './config/app.yml'
We started by analyzing hospitals that received incentive payments in program year 2011, 2012, or 2013. We then added all hospitals in the hospital compare (general information) data set, and added several data sets' data for as many hospitals as we could (using their CCN as the look-up variable.)
# received an incentive* (* in any of 2011, 2012, _or_ 2013) = 2816
# received an incentive* and we were able to geocode = 2816
# received an incentive* and we found HCAHPS data = 2735
# received an incentive* and we found general information = 2749
# received an incentive* and we found a Joint Commission ID = 1398
new-host-2:ONC-EHR-Incentives-Program-Payout-Data mark$ bundle exec rake hospitals:simple_report
loading config file './config/app.yml'
We started by analyzing hospitals that received incentive payments in program year 2011, 2012, or 2013. We then added all hospitals in the hospital compare (general information) data set, and added HCAHPS data for as many hospitals as we could, using their CCN as the look-up variable.
# received an incentive* (* in any of 2011, 2012, _or_ 2013) = 2816
# received an incentive* and we were able to geocode = 2816
# received an incentive* and we found HCAHPS data = 2116
# received an incentive* and we found general information = 2146
# received an incentive* and we found a Joint Commission ID = 1398
<?php
$xmlstr = file_get_contents("http://keywordorganizer.org/resources/app-resources/startup-messages.xml");
$xmldoc = new SimpleXMLElement($xmlstr);
$latestversion = $xmldoc->version[0]->latestversion;
echo "Make sure you have the latest version $latestversion!"
?>
{:id=>"0142",
:hqmf_id=>"40280381-3D27-5493-013D-4BFBD29A5F66",
:hqmf_set_id=>"BB481284-30DD-4383-928C-82385BBF1B17",
:hqmf_version_number=>2,
:title=>"Aspirin Prescribed at Discharge",
:description=>
"Acute myocardial infarction (AMI) patients who are prescribed aspirin at hospital discharge",
:cms_id=>"CMS100v2",
:population_criteria=>
{:DENEX=>
@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"