Skip to content
Browse files

changes to allow publication, study and funding ad hoc reporting

  • Loading branch information...
1 parent 3cfe8d5 commit 8965e58530f218bc38aa57ff4c89c1d798ed5654 Warren A. Kibbe committed Apr 29, 2012
View
115 LatticeGrid.tmproj
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>currentDocument</key>
- <string>doc/example_loads.txt</string>
+ <string>app/models/proposal.rb</string>
<key>documents</key>
<array>
<dict>
@@ -21,19 +21,61 @@
<integer>384</integer>
<key>metaData</key>
<dict>
- <key>app/helpers/application_helper.rb</key>
+ <key>app/models/proposal.rb</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
- <integer>59</integer>
+ <integer>45</integer>
<key>line</key>
- <integer>85</integer>
+ <integer>58</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>107</integer>
+ <integer>8</integer>
+ </dict>
+ <key>app/models/school.rb</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>19</integer>
+ <key>line</key>
+ <integer>2</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
+ </dict>
+ <key>app/views/abstracts/ccsg.html.erb</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>28</integer>
+ <key>line</key>
+ <integer>178</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>141</integer>
+ </dict>
+ <key>app/views/awards/org.html.erb</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>47</integer>
+ <key>line</key>
+ <integer>38</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>8</integer>
</dict>
<key>app/views/graphs/org_nodes.rxml</key>
<dict>
@@ -82,29 +124,29 @@
<key>caret</key>
<dict>
<key>column</key>
- <integer>22</integer>
+ <integer>27</integer>
<key>line</key>
- <integer>107</integer>
+ <integer>322</integer>
</dict>
<key>columnSelection</key>
<false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>91</integer>
+ <integer>298</integer>
<key>selectFrom</key>
<dict>
<key>column</key>
<integer>17</integer>
<key>line</key>
- <integer>107</integer>
+ <integer>322</integer>
</dict>
<key>selectTo</key>
<dict>
<key>column</key>
- <integer>25</integer>
+ <integer>32</integer>
<key>line</key>
- <integer>107</integer>
+ <integer>322</integer>
</dict>
</dict>
<key>doc/example_loads.txt</key>
@@ -137,57 +179,14 @@
<integer>6</integer>
</dict>
</dict>
- <key>lib/mesh_utilities.rb</key>
- <dict>
- <key>caret</key>
- <dict>
- <key>column</key>
- <integer>20</integer>
- <key>line</key>
- <integer>290</integer>
- </dict>
- <key>columnSelection</key>
- <false/>
- <key>firstVisibleColumn</key>
- <integer>0</integer>
- <key>firstVisibleLine</key>
- <integer>283</integer>
- <key>selectFrom</key>
- <dict>
- <key>column</key>
- <integer>44</integer>
- <key>line</key>
- <integer>290</integer>
- </dict>
- <key>selectTo</key>
- <dict>
- <key>column</key>
- <integer>20</integer>
- <key>line</key>
- <integer>290</integer>
- </dict>
- </dict>
- <key>lib/tasks/pubmed_mesh.rake</key>
- <dict>
- <key>caret</key>
- <dict>
- <key>column</key>
- <integer>42</integer>
- <key>line</key>
- <integer>113</integer>
- </dict>
- <key>firstVisibleColumn</key>
- <integer>0</integer>
- <key>firstVisibleLine</key>
- <integer>73</integer>
- </dict>
</dict>
<key>openDocuments</key>
<array>
<string>doc/example_loads.txt</string>
- <string>lib/mesh_utilities.rb</string>
- <string>app/helpers/application_helper.rb</string>
- <string>lib/tasks/pubmed_mesh.rake</string>
+ <string>app/views/awards/org.html.erb</string>
+ <string>app/models/school.rb</string>
+ <string>app/models/proposal.rb</string>
+ <string>app/views/abstracts/ccsg.html.erb</string>
<string>db/schema.rb</string>
<string>config/initializers/latticegrid.rb</string>
</array>
View
48 app/controllers/awards_controller.rb
@@ -127,8 +127,52 @@ def recent
end
end
end
-
-
+
+ def ad_hoc_by_pi
+ if params[:start_date].nil? or params[:end_date].nil? then
+ redirect_to( current_abstracts_url)
+ else
+ @javascripts_add = ['jquery.min', 'jquery.tablesorter.min', 'jquery.fixheadertable.min', 'jquery-ui.min']
+ @stylesheets = [ 'publications', "latticegrid/#{lattice_grid_instance}", 'jquery-ui' ]
+
+ @faculty = Investigator.find_investigators_in_list(params[:investigator_ids]).sort{|x,y| x.last_name+' '+x.first_name <=> y.last_name+' '+y.first_name}
+ @investigators_in_unit = @faculty.map(&:id).sort.uniq
+
+ @awards = Proposal.recents_by_pi(@investigators_in_unit, params[:start_date], params[:end_date])
+ previous = nil
+ @css = "#main {width:1900px;}"
+ @title = "Funding awards started between #{params[:start_date]} and #{params[:end_date]}"
+
+ @awards_total = @awards.map{ |a|
+ val = (previous.blank? or previous != a.id ) ? a.total_amount : 0
+ previous = a.id
+ val}.inject(0){|sum, element| sum+element}
+ respond_to do |format|
+ format.html { render :action => :org, :layout => 'printable' }
+ format.xml { render :xml => @awards }
+ format.xls {
+ @pdf = 1
+ send_data(render(:template => 'awards/org.html', :layout => "excel"),
+ :filename => "award_listing_for_#{params[:funding_type]}.xls",
+ :type => 'application/vnd.ms-excel',
+ :disposition => 'attachment') }
+ format.doc {
+ @pdf = 1
+ send_data(render(:template => 'awards/org.html', :layout => "excel"),
+ :filename => "award_listing_for_#{params[:funding_type]}.doc",
+ :type => 'application/msword',
+ :disposition => 'attachment') }
+ format.pdf do
+ @pdf = 1
+ render( :pdf => "Award listing for " + params[:funding_type],
+ :stylesheets => "pdf",
+ :template => "awards/org.html",
+ :layout => "pdf")
+ end
+ end
+ end
+ end
+
def org
@javascripts_add = ['jquery-ui.min']
@stylesheets = [ 'publications', "latticegrid/#{lattice_grid_instance}", 'jquery-ui' ]
View
1 app/controllers/orgs_controller.rb
@@ -459,7 +459,6 @@ def investigator_abstracts_during_period
@heading = "#{@abstracts.length} publications. Selected publications "
@heading = @heading + " from #{@start_date} " if !params[:start_date].blank?
@heading = @heading + " to #{@end_date}" if !params[:end_date].blank?
- @heading = @heading + " <br/>Investigators explicitly included: #{@faculty.collect{|pi| pi.name unless pi.blank?}.uniq.join(', ')}" if @faculty.length > 0
@include_mesh = false
@include_graph_link = false
@show_paginator = false
View
43 app/controllers/studies_controller.rb
@@ -119,7 +119,48 @@ def listing
end
end
end
-
+
+ def ad_hoc_by_pi
+ if params[:start_date].nil? or params[:end_date].nil? then
+ redirect_to( current_abstracts_url)
+ else
+ @javascripts_add = ['jquery.min', 'jquery.tablesorter.min', 'jquery.fixheadertable.min', 'jquery-ui.min']
+ @stylesheets = [ 'publications', "latticegrid/#{lattice_grid_instance}", 'jquery-ui' ]
+
+ @faculty = Investigator.find_investigators_in_list(params[:investigator_ids]).sort{|x,y| x.last_name+' '+x.first_name <=> y.last_name+' '+y.first_name}
+ @investigators_in_unit = @faculty.map(&:id).sort.uniq
+
+ @studies = Study.recents_by_pi(@investigators_in_unit, params[:start_date], params[:end_date])
+
+ @css = "#main {width:1900px;}"
+ @title = "Research studies active between #{params[:start_date]} and #{params[:end_date]}"
+
+ respond_to do |format|
+ format.html { render :action => :org, :layout => 'printable' }
+ format.xml { render :xml => @studies }
+ format.xls {
+ @pdf = 1
+ send_data(render(:template => 'studies/org.html', :layout => "excel"),
+ :filename => "study_listing_for_#{@unit.name}.xls",
+ :type => 'application/vnd.ms-excel',
+ :disposition => 'attachment') }
+ format.doc {
+ @pdf = 1
+ send_data(render(:template => 'studies/org.html', :layout => "excel"),
+ :filename => "study_listing_for_#{@unit.name}.doc",
+ :type => 'application/msword',
+ :disposition => 'attachment') }
+ format.pdf do
+ @pdf = 1
+ render( :pdf => "Study listing for " + @unit.name,
+ :stylesheets => "pdf",
+ :template => "studies/org.html",
+ :layout => "pdf")
+ end
+ end
+ end
+ end
+
private
def check_allowed
View
9 app/models/proposal.rb
@@ -33,6 +33,15 @@ def self.belonging_to_pi_ids(ids)
)
end
+ def self.recents_by_pi(pi_ids, start_date, end_date)
+ all(
+ :joins => [:investigator_proposals],
+ :conditions => [ " investigator_proposals.role = 'PD/PI' AND investigator_proposals.investigator_id in (:ids) and (proposals.project_start_date between :start_date and :end_date or proposals.award_start_date between :start_date and :end_date)",
+ {:ids => pi_ids, :start_date=>start_date, :end_date=>end_date }],
+ :order=> "proposals.sponsor_type_code,proposals.sponsor_code, proposals.award_start_date"
+ )
+ end
+
def self.recents_by_type(funding_types, start_date, end_date)
# Funding_type is one of the following in NU InfoEd
View
10 app/models/study.rb
@@ -33,4 +33,14 @@ def self.belonging_to_pi_ids(ids)
)
end
+ def self.recents_by_pi(pi_ids, start_date, end_date)
+ all(
+ :joins => [:investigator_studies],
+ :conditions => [ " investigator_studies.role = 'PI' AND investigator_studies.investigator_id in (:ids) and ( studies.approved_date < :end_date) and ( studies.next_review_date >= :start_date) and ( studies.closed_date is null or studies.closed_date >= :start_date)",
+ {:ids => pi_ids, :start_date=>start_date, :end_date=>end_date }],
+ :order=> "studies.approved_date"
+ )
+ end
+
+
end
View
40 app/views/abstracts/ccsg.html.erb
@@ -158,11 +158,51 @@
<h3><%= link_to year, impact_factor_url(year, '') %> &nbsp; <%= link_to "as pdf", formatted_impact_factor_url(year,"pdf") %> &nbsp; <%= link_to "as Excel", formatted_impact_factor_url(year,"xls") %> &nbsp; <%= link_to "as Word doc", formatted_impact_factor_url(year,"doc") %></h3>
<% end %>
</div>
+ <p>&nbsp;</p>
<% end %><!-- end of admin_listing_options cache -->
<% cache("funding_listing_options") do %>
+ <h2>Funding listing by ad hoc collection of investigators and award start</h2>
+ <div id="funding_listing">
+ <% form_for( :abstract, :url => ad_hoc_by_pi_awards_path, :html => { :method => :post, :class => "p" }) do |form| %>
+ <p>Use the below form for ad hoc reporting of funding for a group of individuals : Paste in a list of netids, email addresses, or employee ids you want to include as well as a date range:</p>
+ <p><%= text_area('', :investigator_ids, :cols => 40, :rows => 20) %> Paste investigator netids, email addresses, or employee ids</p>
+
+ <p>Select the award start date range to include in the report.</p>
+ <% params[:start_date] = '1/1/2012' if params[:start_date].blank? %>
+ <% params[:end_date] = '1/1/2014' if params[:end_date].blank? %>
+ <p>Award start: <%= text_field_tag(:start_date, params[:start_date], :size => 20) %> to
+ <%= text_field_tag(:end_date, params[:end_date], :size => 20) %> select dates </p>
+
+ <p><%= select_tag(:format,
+ options_for_select([["HTML","html"], ["XML", "xml"],["PDF", "pdf"],["Excel", "xls"], ["Word", "doc"]], [params[:format]])
+ ) %> select format </p>
+ <%= submit_tag 'List Funding for these PIs over this period' %>
+ <% end %>
+ </div>
<p>&nbsp;</p>
+
+ <h2>Clinical research studies by ad hoc collection of investigators and open during period</h2>
+ <div id="funding_listing">
+ <% form_for( :abstract, :url => ad_hoc_by_pi_studies_path, :html => { :method => :post, :class => "p" }) do |form| %>
+ <p>Use the below form for ad hoc reporting of studies for a group of individuals : Paste in a list of netids, email addresses, or employee ids you want to include as well as a date range:</p>
+ <p><%= text_area('', :investigator_ids, :cols => 40, :rows => 20) %> Paste investigator netids, email addresses, or employee ids</p>
+
+ <p>Select the study date range to include in the report.</p>
+ <% params[:start_date] = '1/1/2012' if params[:start_date].blank? %>
+ <% params[:end_date] = '1/1/2014' if params[:end_date].blank? %>
+ <p>Award start: <%= text_field_tag(:start_date, params[:start_date], :size => 20) %> to
+ <%= text_field_tag(:end_date, params[:end_date], :size => 20) %> select dates </p>
+
+ <p><%= select_tag(:format,
+ options_for_select([["HTML","html"], ["XML", "xml"],["PDF", "pdf"],["Excel", "xls"], ["Word", "doc"]], [params[:format]])
+ ) %> select format </p>
+ <%= submit_tag 'List clinical studies for these PIs during this period' %>
+ <% end %>
+ </div>
+ <p>&nbsp;</p>
+
<h2>Funding listing by funding source and award start</h2>
<div id="funding_listing">
<% form_for( :abstract, :url => recent_awards_path, :html => { :method => :post, :class => "p" }) do |form| %>
View
11 app/views/awards/org.html.erb
@@ -1,6 +1,7 @@
<% @all_abstracts = nil unless defined?(@all_abstracts) %>
<% @include_graph_link=true if @include_graph_link.nil? %>
<% @investigator_ids = [] if @investigator_ids.blank? %>
+<% @faculty = [] if @faculty.blank? %>
<% @include_graph_link=false if @org.nil? %>
@@ -19,8 +20,12 @@
</h1>
<% end %>
+<% if @faculty.length > 0 %>
+<p>Faculty (<%= @faculty.length -%>) included in chart: <%= link_to_faculty(@faculty) %></p>
+<% end %>
+<span id='data_title' class='h2'>Award data: $<%= number_to_humanized(@awards_total) %> for <%= @awards.length %> awards.</span>
+
<% unless defined?(@pdf) and @pdf %>
- <span id='data_title' class='h2'>Award data: $<%= number_to_humanized(@awards_total) %> for <%= @awards.length %> awards.</span>
<% unless params[:id].blank? %>
<div style="float:right;padding-right:5px;">
<%= link_to( "as Word", org_award_url(params[:id],'doc')) %>
@@ -36,7 +41,7 @@
<% if @awards.length == 0 %>
<h2>No awards were found</h2>
<% else %>
-<p>Awards are organized by source and agency</p>
+<p>Awards are organized by category and agency</p>
<div id="listing">
<table cellpadding="2" cellspacing="0" class="borderless">
<tr valign="bottom" class="header">
@@ -47,7 +52,7 @@
PI
</td>
<td class="list-title-left">
- Source
+ Category
</td>
<td class="list-title-left">
Sponsor award id
View
28 app/views/studies/org.html.erb
@@ -1,17 +1,29 @@
<% @all_abstracts = nil if !defined?(@all_abstracts) %>
<% @include_graph_link=true if @include_graph_link.nil? %>
+<% @include_graph_link=false if @unit.nil? %>
<% unless @studies.blank? %>
<% if !defined?(@pdf) and ! @pdf %>
-<h1><%= @unit.name %> Clinical Research Study Overview &nbsp;
- <% if ! @all_abstracts.nil? && @all_abstracts.length > 9 -%>
- <% publications_per_year=abstracts_per_year_as_string(@all_abstracts) -%>
- <span class='inlinebarchart' values='<%= publications_per_year -%>' title='publications per year: <%= publications_per_year -%>'>&nbsp;</span>
- <%= sparkline_barchart_setup({'barWidth'=>2,'barSpacing'=>2}) -%>
- <% end -%>
-</h1>
+<% if @unit.blank? %>
+ <h1><%= @title unless @title.blank? %></h1>
+<% else %>
+ <h1><%= @unit.name %> Clinical Research Study Overview &nbsp;
+ <% unless defined?(@pdf) and @pdf %>
+ <% if ! @all_abstracts.nil? && @all_abstracts.length > 9 -%>
+ <% publications_per_year=abstracts_per_year_as_string(@all_abstracts) -%>
+ <span class='inlinebarchart' values='<%= publications_per_year -%>' title='publications per year: <%= publications_per_year -%>'>&nbsp;</span>
+ <%= sparkline_barchart_setup({'barWidth'=>2,'barSpacing'=>2}) -%>
+ <% end -%>
+ <% end -%>
+ </h1>
+<% end %>
+
<span id='data_title' class='h2'>Number of Clinical Research Studies: <%= number_to_humanized(@studies.length) %></span>
+<% if @faculty.length > 0 %>
+<p>Faculty (<%= @faculty.length -%>) included in chart: <%= link_to_faculty(@faculty) %></p>
+<% end %>
+
<div style="float:right;padding-right:5px;">
<%= link_to( "as Word", org_award_url(params[:id],'doc')) %>
<%= link_to( "as Excel", org_award_url(params[:id],'xls')) %>
@@ -99,7 +111,7 @@
<%= cnt+1 %>
</td>
<td class="list-left">
- <%= study.pi_study.investigator.name %>
+ <%= study.pi_study.investigator.name unless study.pi_study.blank? or study.pi_study.investigator.blank? %>
</td>
<td class="list-left">
<%= link_to( study.irb_study_number, study_url(study.id)) %>
View
3 config/routes.rb
@@ -10,6 +10,9 @@
map.investigator_listing 'profiles/investigator_listing/:id', {:controller => 'profiles', :action => 'investigator_listing'}
map.award_listing 'awards/listing', {:controller => 'awards', :action => 'listing'}
map.recent_awards 'awards/recent', {:controller => 'awards', :action => 'recent', :conditions => { :method => [:get, :post] } }
+ map.ad_hoc_by_pi_awards 'awards/ad_hoc_by_pi', {:controller => 'awards', :action => 'ad_hoc_by_pi', :conditions => { :method => [:get, :post] } }
+ map.ad_hoc_by_pi_studies 'studies/ad_hoc_by_pi', {:controller => 'studies', :action => 'ad_hoc_by_pi', :conditions => { :method => [:get, :post] } }
+
map.index_orgs 'orgs/index', :controller => 'orgs', :action => 'index' #handle the route for orgs_path to make sure it is cached properly
map.resources :orgs, :only => [:index, :show],
:collection => { :stats => :get, :period_stats => [:get,:post], :list => :get, :centers => :get, :orgs => :get, :departments => :get, :programs => :get, :department_collaborations => :get, :investigator_abstracts_during_period => [:get, :post], :classifications => :get },
View
31 lib/tasks/studies_to_pis.rake
@@ -0,0 +1,31 @@
+require 'file_utilities' #specific methods
+require 'utilities' # was row_iterator and other methods
+require 'app/helpers/format_helper'
+include FormatHelper
+
+require 'rubygems'
+
+namespace :reports do
+ study_list = ["STU00001460","STU00001522","STU00001576","STU00002540","STU00002669","STU00002961","STU00003049","STU00003419","STU00004428","STU00004555","STU00004868","STU00004896","STU00005142","STU00005421","STU00005511","STU00005771","STU00005786","STU00005867","STU00006092","STU00006366","STU00006644","STU00006877","STU00006994","STU00007087","STU00007099","STU00007312","STU00007508","STU00007570","STU00007790","STU00007877","STU00008001","STU00008096","STU00008511","STU00008716","STU00008779","STU00008802","STU00008996","STU00009011","STU00009016","STU00009126","STU00009193","STU00009301","STU00009325","STU00009332","STU00009417","STU00009603","STU00009604","STU00009658","STU00009935","STU00009950","STU00009959","STU00010003","STU00010076","STU00010205","STU00010241","STU00010457","STU00010501","STU00010974","STU00011311","STU00011640","STU00011815","STU00011825","STU00012048","STU00012266","STU00012379","STU00012467","STU00012633","STU00012729","STU00012731","STU00012732","STU00012770","STU00013031","STU00013247","STU00013264","STU00013313","STU00013435","STU00013577","STU00013763","STU00013928","STU00014001","STU00014242","STU00014244","STU00014564","STU00014598","STU00014777","STU00014821","STU00014911","STU00014943","STU00015568","STU00015581","STU00015601","STU00015649","STU00015746","STU00015755","STU00015791","STU00015874","STU00015954","STU00016120","STU00016454","STU00016533","STU00016535","STU00016537","STU00016614","STU00016833","STU00016917","STU00017005","STU00017031","STU00017061","STU00017234","STU00017296","STU00017560","STU00017640","STU00017938","STU00018011","STU00018244","STU00018616","STU00018644","STU00018651","STU00018967","STU00019012","STU00019137","STU00019450","STU00019555","STU00019685","STU00019743","STU00019758","STU00019804","STU00019833","STU00019879","STU00019956","STU00019991","STU00020072","STU00020161","STU00020619","STU00020815","STU00020824","STU00020827","STU00020973","STU00020989","STU00021135","STU00021190","STU00021282","STU00021287","STU00021294","STU00021507","STU00021811","STU00022034","STU00022264","STU00022288","STU00022341","STU00022489","STU00022942","STU00023135","STU00023169","STU00023645","STU00023843","STU00023907","STU00023921","STU00023946","STU00023955","STU00023972","STU00023986","STU00023999","STU00024243","STU00024421","STU00024664","STU00024718","STU00025184","STU00025294","STU00025418","STU00025451","STU00025466","STU00025581","STU00026007","STU00026024","STU00026028","STU00026095","STU00026200","STU00026255","STU00026342","STU00026786","STU00026896","STU00026995","STU00027057","STU00027354","STU00027473","STU00027497","STU00027508","STU00027683","STU00027688","STU00027808","STU00027887","STU00027914","STU00028019","STU00028036","STU00028041","STU00028061","STU00028773","STU00029383","STU00029464","STU00029486","STU00029680","STU00030066","STU00030096","STU00030121","STU00030417","STU00030833","STU00030888","STU00030974","STU00030993","STU00031038","STU00031398","STU00031497","STU00031693","STU00031907","STU00032008","STU00032173","STU00032316","STU00032317","STU00032893","STU00033010","STU00033365","STU00033689","STU00033794","STU00033978","STU00034167","STU00034255","STU00034384","STU00034563","STU00034773","STU00034850","STU00034950","STU00035113","STU00035518","STU00035945","STU00036427","STU00036458","STU00036629","STU00036866","STU00037055","STU00037281","STU00037287","STU00037288","STU00037740","STU00037913","STU00037945","STU00038010","STU00038049","STU00038127","STU00038152","STU00038207","STU00038230","STU00038787","STU00038803","STU00038909","STU00038911","STU00038944","STU00039195","STU00039808","STU00040288","STU00040420","STU00040874","STU00041030","STU00041538","STU00041716","STU00041938","STU00042189","STU00043110","STU00043779","STU00044115","STU00044731","STU00045203","STU00045270","STU00046379","STU00046406","STU00046732","STU00047146","STU00049271","STU00049304","STU00049395","STU00049623","STU00049624","STU00049710","STU00050068","STU00050349","STU00050475","STU00050728","STU00050741","STU00051008","STU00051080","STU00051344","STU00051357","STU00051862","STU00051933","STU00052052","STU00052502","STU00053046","STU00053271","STU00053472","STU00053736","STU00053737","STU00053822","STU00054908","STU00055193","STU00055233","STU00055959","STU00056026","STU00056087","STU00056190","STU00056214","STU00056269","STU00056732","STU00057172","STU00057336","STU00057775","STU00058702","STU00058740","STU00058889","STU00059112","STU00060873","STU00060914","STU00061074","STU00061627","STU00061633","STU00062143","STU00062365"]
+
+ desc "useful for taking a list of netids and looking up in the FSM faculty database and resolving against LDAP"
+
+ desc "useful for taking an investigator name and breaking into first_name, middle_name, last_name, suffix"
+ task :studies_to_pi => :environment do
+ puts "username\tname\tSTU\tirb_study_number\tStatus\tApproved date\tNext review date\tTitle"
+ study_list.each do |stu|
+ study = Study.find_by_irb_study_number(stu)
+ if study.blank?
+ puts "unable to find STU #{stu}"
+ elsif study.pi.blank?
+ puts "unable to find PI for #{stu}"
+ else
+ puts "#{study.pi.username}\t#{study.pi.name}\t#{stu}\t#{study.irb_study_number}\t#{study.status}\t#{study.approved_date}\t#{study.next_review_date}\t#{study.title.gsub(/[\r\n]+/,'')}"
+ end
+ end
+ end
+
+
+ end
+
+

0 comments on commit 8965e58

Please sign in to comment.
Something went wrong with that request. Please try again.