dpickett-clinical 0.2.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ begin
14
14
  gem.add_dependency("jnunemaker-httparty", ">= 0.4.3")
15
15
  gem.add_dependency("jnunemaker-happymapper", ">= 0.2.5")
16
16
  gem.add_dependency("mislav-will_paginate", ">= 2.3.11")
17
- gem.add_dependency("nokogiri", "> 1.3.3")
17
+ gem.add_dependency("nokogiri", ">= 1.3.3")
18
18
 
19
19
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
20
20
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.4
data/clinical.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{clinical}
5
- s.version = "0.2.1"
5
+ s.version = "0.2.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Dan Pickett"]
@@ -35,7 +35,9 @@ Gem::Specification.new do |s|
35
35
  "lib/clinical/intervention.rb",
36
36
  "lib/clinical/lead_sponsor.rb",
37
37
  "lib/clinical/location.rb",
38
+ "lib/clinical/location_contact.rb",
38
39
  "lib/clinical/outcome.rb",
40
+ "lib/clinical/overall_official.rb",
39
41
  "lib/clinical/primary_outcome.rb",
40
42
  "lib/clinical/secondary_outcome.rb",
41
43
  "lib/clinical/sponsor.rb",
@@ -65,17 +67,17 @@ Gem::Specification.new do |s|
65
67
  s.add_runtime_dependency(%q<jnunemaker-httparty>, [">= 0.4.3"])
66
68
  s.add_runtime_dependency(%q<jnunemaker-happymapper>, [">= 0.2.5"])
67
69
  s.add_runtime_dependency(%q<mislav-will_paginate>, [">= 2.3.11"])
68
- s.add_runtime_dependency(%q<nokogiri>, ["> 1.3.3"])
70
+ s.add_runtime_dependency(%q<nokogiri>, [">= 1.3.3"])
69
71
  else
70
72
  s.add_dependency(%q<jnunemaker-httparty>, [">= 0.4.3"])
71
73
  s.add_dependency(%q<jnunemaker-happymapper>, [">= 0.2.5"])
72
74
  s.add_dependency(%q<mislav-will_paginate>, [">= 2.3.11"])
73
- s.add_dependency(%q<nokogiri>, ["> 1.3.3"])
75
+ s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
74
76
  end
75
77
  else
76
78
  s.add_dependency(%q<jnunemaker-httparty>, [">= 0.4.3"])
77
79
  s.add_dependency(%q<jnunemaker-happymapper>, [">= 0.2.5"])
78
80
  s.add_dependency(%q<mislav-will_paginate>, [">= 2.3.11"])
79
- s.add_dependency(%q<nokogiri>, ["> 1.3.3"])
81
+ s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
80
82
  end
81
83
  end
@@ -44,6 +44,7 @@ Feature: As a potential participant for a clinical study
44
44
  And the trial should have "conditions" like "Lung Cancer"
45
45
  And the trial should have a "minimum_age" of "21 Years"
46
46
  And the trial should have "sponsors" like "M.D. Anderson"
47
+ And the trial should have an "overall_official" like "Alexandra Phan, MD"
47
48
 
48
49
  Scenario: Find a non-existant trial
49
50
  When I attempt to retrieve trial "4325785"
@@ -63,7 +63,7 @@ Then /^the trial should have an? "([^\"]*)" of "([^\"]*)"$/ do |field, value|
63
63
  @trial.send(field).to_s.should eql(value)
64
64
  end
65
65
 
66
- Then /^the trial should have "([^\"]*)" like "([^\"]*)"$/ do |field, value|
66
+ Then /^the trial should have (an\s)?"([^\"]*)" like "([^\"]*)"$/ do |an, field, value|
67
67
  @trial.send(field).to_s.should =~ /#{Regexp.escape(value)}/
68
68
  end
69
69
 
@@ -1,13 +1,25 @@
1
1
  module Clinical
2
- class Contact
3
- include HappyMapper
2
+ module Contact
3
+ def self.included(base)
4
+ base.class_eval do
5
+ include HappyMapper
6
+ include Clinical::Contact::InstanceMethods
4
7
 
5
- element :first_name, String
6
- element :middle_name, String
7
- element :last_name, String
8
- element :degrees, String
9
- element :phone, String
10
- element :phone_ext, String
11
- element :email, String
8
+ element :first_name, String
9
+ element :middle_name, String
10
+ element :last_name, String
11
+ element :degrees, String
12
+ element :phone, String
13
+ element :phone_extension, String, :tag => "phone_ext"
14
+ element :email, String
15
+ end
16
+
17
+ end
18
+
19
+ module InstanceMethods
20
+ def to_s
21
+ [first_name, last_name, "(#{phone})"].join(" ")
22
+ end
23
+ end
12
24
  end
13
25
  end
@@ -4,7 +4,7 @@ module Clinical
4
4
 
5
5
  element :facility, String
6
6
  has_one :status, Clinical::Status, :parser => :parse
7
- has_one :contact, Clinical::Contact
7
+ has_one :contact, Clinical::LocationContact
8
8
  has_one :address, Clinical::Address
9
9
  end
10
10
  end
@@ -0,0 +1,7 @@
1
+ module Clinical
2
+ class LocationContact
3
+ include Clinical::Contact
4
+ tag "contact"
5
+ end
6
+ end
7
+
@@ -0,0 +1,6 @@
1
+ module Clinical
2
+ class OverallOfficial
3
+ include Clinical::Contact
4
+ tag "overall_official"
5
+ end
6
+ end
@@ -1,13 +1,13 @@
1
1
  module Clinical
2
2
  module Sponsor
3
- def self.included(base)
4
- base.class_eval do
5
- attr_accessor :name
6
- include HappyMapper
7
- end
8
- base.extend(ClassMethods)
9
- base.send(:include, InstanceMethods)
3
+ def self.included(base)
4
+ base.class_eval do
5
+ attr_accessor :name
6
+ include HappyMapper
10
7
  end
8
+ base.extend(ClassMethods)
9
+ base.send(:include, InstanceMethods)
10
+ end
11
11
 
12
12
  module InstanceMethods
13
13
  def to_s
@@ -24,4 +24,4 @@ module Clinical
24
24
  end
25
25
  end
26
26
  end
27
- end
27
+ end
@@ -24,6 +24,8 @@ module Clinical
24
24
  has_many :collaborators, Clinical::Collaborator
25
25
  has_many :agencies, Clinical::Agency
26
26
 
27
+ has_one :overall_official, Clinical::OverallOfficial, :tag => "overall_official"
28
+
27
29
  has_many :interventions, Intervention, :tag => "intervention"
28
30
  has_many :primary_outcomes, PrimaryOutcome
29
31
  has_many :secondary_outcomes, SecondaryOutcome
data/lib/clinical.rb CHANGED
@@ -20,8 +20,11 @@ require "clinical/lead_sponsor"
20
20
  require "clinical/agency"
21
21
  require "clinical/collaborator"
22
22
 
23
- require "clinical/address"
24
23
  require "clinical/contact"
24
+ require "clinical/overall_official"
25
+ require "clinical/location_contact"
26
+
27
+ require "clinical/address"
25
28
  require "clinical/location"
26
29
 
27
30
  require "clinical/trial"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpickett-clinical
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Pickett
@@ -48,7 +48,7 @@ dependencies:
48
48
  version_requirement:
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">"
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.3.3
54
54
  version:
@@ -84,7 +84,9 @@ files:
84
84
  - lib/clinical/intervention.rb
85
85
  - lib/clinical/lead_sponsor.rb
86
86
  - lib/clinical/location.rb
87
+ - lib/clinical/location_contact.rb
87
88
  - lib/clinical/outcome.rb
89
+ - lib/clinical/overall_official.rb
88
90
  - lib/clinical/primary_outcome.rb
89
91
  - lib/clinical/secondary_outcome.rb
90
92
  - lib/clinical/sponsor.rb