Skip to content

Commit

Permalink
merging conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rdingwell committed Jan 30, 2012
2 parents b2154d2 + 890f2c7 commit 12e7518
Show file tree
Hide file tree
Showing 28 changed files with 451 additions and 117 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ db/*.sqlite3
log/*.log
tmp/
.sass-cache/
.idea
.rvmrc*
11 changes: 6 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'http://rubygems.org'

gem 'rails', '3.1.0'
gem "health-data-standards", :git => "http://github.com/ssayer/health-data-standards.git", :branch => "develop"
gem 'rails', '3.2.1'
gem "health-data-standards", :git => "http://github.com/projectcypress/health-data-standards.git", :branch => "develop"
gem "mongoid"
gem "bson_ext"
gem "pry"
Expand All @@ -13,9 +13,9 @@ gem 'omniauth'


group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
gem 'sass-rails', " ~> 3.2.3"
gem 'coffee-rails', "~> 3.2.1"
gem 'uglifier', ">= 1.0.3"
end

gem 'jquery-rails'
Expand All @@ -29,4 +29,5 @@ end
group :test do
gem 'turn', :require => false
gem 'minitest'
gem 'feedzirra'
end
130 changes: 71 additions & 59 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
GIT
remote: http://github.com/ssayer/health-data-standards.git
revision: 2a5d4eca954fb2e36034c4ba42c0b6d6908ca39d
remote: http://github.com/projectcypress/health-data-standards.git
revision: ba5ed388d479923409cf72777440a2ae59bdd6e5
branch: develop
specs:
health-data-standards (0.5.0)
health-data-standards (0.7.0)
builder (~> 3.0.0)
erubis (~> 2.6)
mongoid (~> 2.3.3)
mongoid (~> 2.4.2)
nokogiri (~> 1.4.7)
uuid (~> 2.3.4)

GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
addressable (2.2.6)
ansi (1.4.1)
arel (2.2.1)
arel (3.0.0)
bcrypt-ruby (3.0.1)
bson (1.5.2)
bson_ext (1.5.2)
Expand All @@ -57,14 +55,15 @@ GEM
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
coderay (1.0.5)
coffee-rails (3.1.1)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
daemons (1.1.5)
curb (0.7.18)
daemons (1.1.6)
devise (1.5.3)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
Expand All @@ -73,6 +72,16 @@ GEM
eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
feedzirra (0.0.31)
activesupport (>= 3.0.8)
builder (~> 3.0.0)
curb (~> 0.7.15)
i18n (>= 0.5.0)
loofah (~> 1.0.0)
nokogiri (~> 1.4.4)
rake (>= 0.9.2)
rdoc (~> 3.8)
sax-machine (~> 0.0.20)
hashie (1.2.0)
heroku (2.19.0)
launchy (>= 0.3.2)
Expand All @@ -82,16 +91,19 @@ GEM
highline (1.6.11)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.19)
railties (~> 3.0)
journey (1.0.1)
jquery-rails (2.0.0)
railties (>= 3.2.0.beta, < 5.0)
thor (~> 0.14)
json (1.6.5)
launchy (2.0.5)
addressable (~> 2.2.6)
libv8 (3.3.10.4)
loofah (1.0.0)
nokogiri (>= 1.3.3)
macaddr (1.5.0)
systemu (>= 2.4.0)
mail (2.3.0)
mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
Expand All @@ -100,7 +112,7 @@ GEM
minitest (2.11.0)
mongo (1.5.2)
bson (= 1.5.2)
mongoid (2.3.4)
mongoid (2.4.2)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
Expand All @@ -122,26 +134,24 @@ GEM
coderay (~> 1.0.5)
method_source (~> 0.7)
slop (>= 2.4.3, < 3)
rack (1.3.6)
rack-cache (1.0.3)
rack (1.4.1)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
railties (= 3.2.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
Expand All @@ -153,13 +163,14 @@ GEM
mime-types (>= 1.16)
rubyzip (0.9.5)
sass (3.1.12)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
sass-rails (3.2.4)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sax-machine (0.0.20)
nokogiri (> 0.0.0)
slop (2.4.3)
sprockets (2.0.3)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
Expand Down Expand Up @@ -193,8 +204,9 @@ PLATFORMS
DEPENDENCIES
bson_ext
capistrano
coffee-rails (~> 3.1.0)
coffee-rails (~> 3.2.1)
devise
feedzirra
health-data-standards!
heroku
jquery-rails
Expand All @@ -203,9 +215,9 @@ DEPENDENCIES
nokogiri
omniauth
pry
rails (= 3.1.0)
sass-rails (~> 3.1.0)
rails (= 3.2.1)
sass-rails (~> 3.2.3)
therubyracer
thin
turn
uglifier
uglifier (>= 1.0.3)
13 changes: 8 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate_user!


#before_filter :audit_log, :find_record
before_filter :find_record

private

def find_record
record_id = params[:record_id] || params[:id]
@record = Record.first(conditions: {medical_record_number: record_id})
render file: "public/404.html", :status => :not_found unless @record
##render file: "public/404.html", :status => :not_found unless @record
end
end

def audit_log
AuditLog.create(:username => "gganley", :event => "doc read", :description => "this is a desc");
end

end
62 changes: 62 additions & 0 deletions app/controllers/audit_logs_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
class AuditLogsController < ApplicationController

#before_filter :authenticate_user!
#before_filter :validate_authorization!
##add_breadcrumb 'access logs', '/logs'

# All attributes of the AuditLog class are valid to sort on except ones that start with an underscore.
VALID_SORTABLE_COLUMNS = AuditLog.fields.keys.reject {|k| k[0] == '_'}
VALID_SORT_ORDERS = ['desc', 'asc']

def index
order = []
if VALID_SORTABLE_COLUMNS.include?(params[:sort]) && VALID_SORT_ORDERS.include?(params[:order])
order << [params[:sort].to_sym, params[:order].to_sym]
end

# If no valid order is specified, order by date
# If anything else is provided as a sort order, make date a secondary order
if order.empty? || order[0][0] != :created_at
order << [:created_at, :desc]
end

where = {}
##where[:username] = current_user.username unless current_user.admin?

start_date = date_param_to_date(params[:log_start_date])
if start_date
where[:created_at] = {'$gte' => start_date}
end

end_date = date_param_to_date(params[:log_end_date])
if end_date
# will create an empty hash if created_at is nil or leave start_date alone if it is there
where[:created_at] ||= {}
where[:created_at].merge!('$lt' => end_date.next_day) # becomes less than midnight the next day
end

@audit_logs = AuditLog.where(where).order_by(order) ##.paginate(:page => params[:page], :per_page => 20)

respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @audit_logs }
end

end

private

def date_param_to_date(date_string)
if date_string && date_string.split('/').length == 3
split_date = date_string.split('/').map(&:to_i)
Date.new(split_date[2], split_date[0], split_date[1])
else
nil
end
end

#def validate_authorization!
# authorize! :read, Log
#end

end
20 changes: 20 additions & 0 deletions app/controllers/authentications_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class AuthenticationsController <
def index
@authentications = current_user.authentications if current_user
end

def create
auth = request.env["omni.auth"]
current_user.authentications.find_or_create_by_provider_and_uid(auth['provider'], auth['uid'])
flash[:notice] = "Authentication successful."
redirect_to authentications_url
end

def destroy
@authentication = current_user.authentications.find(params[:id])
@authentication.destroy
flash[:notice] = "Successfully destroyed authentication."
redirect_to authentications_url
end

end
10 changes: 6 additions & 4 deletions app/controllers/c32_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
class C32Controller < ApplicationController

respond_to :xml, :json, :atom

def index

respond_to do |wants|
wants.atom {}
end
end

def show
respond_to do |wants|
wants.xml { render xml: HealthDataStandards::Export::C32.export(@record) }
end
respond_with(@record)
end

end
Loading

0 comments on commit 12e7518

Please sign in to comment.