Class: CtGov::ClinicalTrial
- Inherits:
-
Object
- Object
- CtGov::ClinicalTrial
- Defined in:
- lib/ct_gov/clinical_trial.rb
Instance Method Summary collapse
- #brief_summary ⇒ Object
- #brief_title ⇒ Object
- #detailed_description ⇒ Object
- #eligibility_description ⇒ Object
-
#initialize(raw_trial) ⇒ ClinicalTrial
constructor
A new instance of ClinicalTrial.
- #nctid ⇒ Object
- #official_title ⇒ Object
- #overall_status ⇒ Object
- #publications ⇒ Object
- #start_date ⇒ Object
- #study_type ⇒ Object
Constructor Details
#initialize(raw_trial) ⇒ ClinicalTrial
Returns a new instance of ClinicalTrial.
3 4 5 |
# File 'lib/ct_gov/clinical_trial.rb', line 3 def initialize(raw_trial) @raw_trial = raw_trial end |
Instance Method Details
#brief_summary ⇒ Object
19 20 21 |
# File 'lib/ct_gov/clinical_trial.rb', line 19 def brief_summary @raw_trial['brief_summary']['textblock'].strip end |
#brief_title ⇒ Object
11 12 13 |
# File 'lib/ct_gov/clinical_trial.rb', line 11 def brief_title @raw_trial['brief_title'] end |
#detailed_description ⇒ Object
23 24 25 |
# File 'lib/ct_gov/clinical_trial.rb', line 23 def detailed_description @raw_trial['detailed_description']['textblock'].strip end |
#eligibility_description ⇒ Object
27 28 29 |
# File 'lib/ct_gov/clinical_trial.rb', line 27 def eligibility_description @raw_trial['eligibility']['criteria']['textblock'] end |
#nctid ⇒ Object
7 8 9 |
# File 'lib/ct_gov/clinical_trial.rb', line 7 def nctid @raw_trial['id_info']['nct_id'] end |
#official_title ⇒ Object
15 16 17 |
# File 'lib/ct_gov/clinical_trial.rb', line 15 def official_title @raw_trial['official_title'] end |
#overall_status ⇒ Object
31 32 33 |
# File 'lib/ct_gov/clinical_trial.rb', line 31 def overall_status @raw_trial['overall_status'] end |
#publications ⇒ Object
35 36 37 38 39 |
# File 'lib/ct_gov/clinical_trial.rb', line 35 def publications @raw_trial['reference'].map do |reference| Publication.new(reference) end end |
#start_date ⇒ Object
41 42 43 |
# File 'lib/ct_gov/clinical_trial.rb', line 41 def start_date Date.parse(@raw_trial['start_date']) end |
#study_type ⇒ Object
45 46 47 |
# File 'lib/ct_gov/clinical_trial.rb', line 45 def study_type @raw_trial['study_type'] end |