clinical 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
data/clinical.gemspec CHANGED
@@ -1,12 +1,15 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{clinical}
5
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Dan Pickett"]
9
- s.date = %q{2009-08-10}
12
+ s.date = %q{2009-09-19}
10
13
  s.email = %q{dpickett@enlightsolutions.com}
11
14
  s.extra_rdoc_files = [
12
15
  "LICENSE",
@@ -37,6 +40,7 @@ Gem::Specification.new do |s|
37
40
  "lib/clinical/location.rb",
38
41
  "lib/clinical/location_contact.rb",
39
42
  "lib/clinical/outcome.rb",
43
+ "lib/clinical/overall_contact.rb",
40
44
  "lib/clinical/overall_official.rb",
41
45
  "lib/clinical/primary_outcome.rb",
42
46
  "lib/clinical/secondary_outcome.rb",
@@ -47,6 +47,7 @@ Feature: As a potential participant for a clinical study
47
47
  And the trial should have an "overall_official" like "Alexandra Phan, MD"
48
48
  And the trial should have "eligibility_criteria" like "DISEASE CHARACTERISTICS"
49
49
  And the trial should have "brief_summary" like "Pazopanib"
50
+ And the trial should have an "overall_contact"
50
51
 
51
52
  Scenario: Find trials that were updated between a range of dates
52
53
  Given I am searching for trials that have been updated between "07/06/2009" and "07/07/2009"
@@ -5,5 +5,4 @@ Feature: As a user of the clinical library
5
5
  Scenario: Get keywords, categories, and terms
6
6
  When I attempt to retrieve keywords for trial "NCT00001372"
7
7
  Then the trial should have "keywords" like "Autoimmunity"
8
- And the trial should have "categories" like "Urologic Diseases"
9
8
  And the trial should have "terms" like "Connective Tissue Diseases"
@@ -74,6 +74,10 @@ Then /^I should get a trial$/ do
74
74
  @trial.should_not be_nil
75
75
  end
76
76
 
77
+ Then /^the trial should have an? "([^\"]*)"$/ do |field|
78
+ @trial.send(field).should_not be_nil
79
+ end
80
+
77
81
  Then /^the trial should have an? "([^\"]*)" of "([^\"]*)"$/ do |field, value|
78
82
  @trial.send(field).to_s.should eql(value)
79
83
  end
@@ -109,3 +113,10 @@ end
109
113
  Then /^I should get trials where "([^\"]*)" is between "([^\"]*)" and "([^\"]*)"$/ do |attr, start_date, end_date|
110
114
  end
111
115
 
116
+ Then /^the trial should have "([^\"]*)" with a "([^\"]*)"$/ do |col, attribute|
117
+ @trial.send(col).should_not be_empty
118
+ @trial.send(col).each do |i|
119
+ i.send(attribute).should_not be_nil
120
+ end
121
+ end
122
+
@@ -0,0 +1,7 @@
1
+ module Clinical
2
+ class OverallContact
3
+ include Clinical::Contact
4
+
5
+ tag "overall_official"
6
+ end
7
+ end
@@ -25,6 +25,7 @@ module Clinical
25
25
  has_many :agencies, Clinical::Agency
26
26
 
27
27
  has_one :overall_official, Clinical::OverallOfficial, :tag => "overall_official"
28
+ has_one :overall_contact, Clinical::OverallContact, :tag => "overall_contact"
28
29
 
29
30
  has_many :interventions, Intervention, :tag => "intervention"
30
31
  has_many :primary_outcomes, PrimaryOutcome
@@ -104,20 +105,19 @@ module Clinical
104
105
 
105
106
  {
106
107
  :terms => 0,
107
- :categories => 1,
108
- :keywords => 2
108
+ :keywords => 1
109
109
  }.each do |key, value|
110
-
111
110
  metadata[key] = []
112
111
  html.search("div.indent3:nth-last-child(#{value}) td").each do |td|
113
- word = td.inner_html.split(/\<br\>/).collect{|i| i.gsub(/\<div.*/, "").strip.chomp}
114
- if word != ""
115
- metadata[key] += word
112
+ words = td.inner_html.split(/\<br\/?\>/).collect{|i| i.gsub(/\<div.*/, "").strip.chomp}
113
+ if !words.empty?
114
+ metadata[key] += words
116
115
  end
116
+ metadata[key]
117
117
  end
118
118
 
119
119
  end
120
-
120
+
121
121
  @terms, @categories, @keywords = metadata[:terms], metadata[:categories], metadata[:keywords]
122
122
  metadata
123
123
  end
data/lib/clinical.rb CHANGED
@@ -23,6 +23,7 @@ require "clinical/collaborator"
23
23
  require "clinical/contact"
24
24
  require "clinical/overall_official"
25
25
  require "clinical/location_contact"
26
+ require "clinical/overall_contact"
26
27
 
27
28
  require "clinical/address"
28
29
  require "clinical/location"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clinical
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Pickett
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-10 00:00:00 -04:00
12
+ date: 2009-09-19 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -86,6 +86,7 @@ files:
86
86
  - lib/clinical/location.rb
87
87
  - lib/clinical/location_contact.rb
88
88
  - lib/clinical/outcome.rb
89
+ - lib/clinical/overall_contact.rb
89
90
  - lib/clinical/overall_official.rb
90
91
  - lib/clinical/primary_outcome.rb
91
92
  - lib/clinical/secondary_outcome.rb