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
#!/bin/sh | |
# | |
# Janos Kasza (@janoskk) | |
# | |
# Creates (if necessary) and replicates all databases from a couchdb server to another one | |
# | |
if [ -z "$2" ]; then | |
cat <<EOF | |
Usage: $0 <sourceUrl> <targetUrl> |
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
'use strict'; | |
var tablesort = require('tablesort'); | |
function cleanNumber(i) { | |
return i.replace(/[^\-?0-9.]/g, ''); | |
} | |
function compareNumber(a, b) { | |
a = parseFloat(a); |
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
#!/usr/bin/ruby | |
require 'fastercsv' | |
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") | |
def prescribe_drug(patient, drug, dose, frequency, encounter, date = nil) | |
encounter ||= patient.encounters.create(:encounter_datetime => date, :encounter_type => EncounterType.find_by_type("ART Visit").encounter_type_id) | |
encounter.observations.create(:value_drug => drug.drug_id, :value_text => frequency, :value_numeric => dose, :concept_id => Concept.find_by_name("Prescribed Dose").concept_id, :obs_datetime => encounter.encounter_datetime) | |
encounter | |
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
#!/bin/sh | |
# the command= trick gets screwed up with quotes so be careful | |
echo "Hostname is currently `hostname`" | |
# TODO setup hostname | |
# TODO setup LibertyNet/connectivity |