Class: PHSFellowshipQuestionnaireObject

Inherits:
Object
  • Object
show all
Includes:
DataFactory, Foundry, Navigation, StringFactory, Utilities
Defined in:
lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb

Constant Summary collapse

YN_QUESTIONS =
[:indefinite_human_subjects, :clinical_trial, :phase_3_trial, :indefinite_vertebrates,
:human_stem_cells, :specific_cell_line, :seeking_degree_during_proposed_award,
:have_kirchstein_support, :have_kirschstein_support_start_date, :have_kirschstein_support_end_date,
:have_nih_grant_number, :have_additional_kirschstein_support, :previous_submission,
:senior_fellowship_application, :supplement_funding]

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utilities

#get, #make_role, #make_user, #random_percentage, #set, #snake_case

Methods included from Navigation

#doc_search, #fill_out, #fill_out_item, #on_document?, #on_page?, #open_document, #window_cleanup

Constructor Details

#initialize(browser, opts = {}) ⇒ PHSFellowshipQuestionnaireObject

Returns a new instance of PHSFellowshipQuestionnaireObject.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 30

def initialize(browser, opts={})
  @browser = browser

  defaults = {
      indefinite_human_subjects:            'N',
      clinical_trial:                       'N',
      indefinite_vertebrates:               'N',
      human_stem_cells:                     'N',
      field_of_training:                    '1110 Biological Chemistry',
      seeking_degree_during_proposed_award: 'N',
      have_kirchstein_support:              'N',
      previous_submission:                  'N',
      senior_fellowship_application:        'N'
  }

  set_options(defaults.merge(opts))
  requires :document_id, :doc_type
end

Instance Attribute Details

#additional_kirschstein_supportObject

Returns the value of attribute additional_kirschstein_support.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def additional_kirschstein_support
  @additional_kirschstein_support
end

#clinical_trialObject

Returns the value of attribute clinical_trial.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def clinical_trial
  @clinical_trial
end

#expected_degree_completion_dateObject

Returns the value of attribute expected_degree_completion_date.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def expected_degree_completion_date
  @expected_degree_completion_date
end

#field_of_trainingObject

Returns the value of attribute field_of_training.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def field_of_training
  @field_of_training
end

#former_institutionObject

Returns the value of attribute former_institution.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def former_institution
  @former_institution
end

#have_kirchstein_supportObject

Returns the value of attribute have_kirchstein_support.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def have_kirchstein_support
  @have_kirchstein_support
end

#have_kirschstein_support_end_dateObject

Returns the value of attribute have_kirschstein_support_end_date.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def have_kirschstein_support_end_date
  @have_kirschstein_support_end_date
end

#have_kirschstein_support_start_dateObject

Returns the value of attribute have_kirschstein_support_start_date.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def have_kirschstein_support_start_date
  @have_kirschstein_support_start_date
end

#have_nih_grant_numberObject

Returns the value of attribute have_nih_grant_number.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def have_nih_grant_number
  @have_nih_grant_number
end

#human_stem_cellsObject

Returns the value of attribute human_stem_cells.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def human_stem_cells
  @human_stem_cells
end

#indefinite_human_subjectsObject

Returns the value of attribute indefinite_human_subjects.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def indefinite_human_subjects
  @indefinite_human_subjects
end

#indefinite_vertebratesObject

Returns the value of attribute indefinite_vertebrates.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def indefinite_vertebrates
  @indefinite_vertebrates
end

#kirschstein_support_end_dateObject

Returns the value of attribute kirschstein_support_end_date.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def kirschstein_support_end_date
  @kirschstein_support_end_date
end

#kirschstein_support_levelObject

Returns the value of attribute kirschstein_support_level.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def kirschstein_support_level
  @kirschstein_support_level
end

#kirschstein_support_recipientObject

Returns the value of attribute kirschstein_support_recipient.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def kirschstein_support_recipient
  @kirschstein_support_recipient
end

#kirschstein_support_start_dateObject

Returns the value of attribute kirschstein_support_start_date.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def kirschstein_support_start_date
  @kirschstein_support_start_date
end

#nih_grant_numberObject

Returns the value of attribute nih_grant_number.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def nih_grant_number
  @nih_grant_number
end

#phase_3_trialObject

Returns the value of attribute phase_3_trial.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def phase_3_trial
  @phase_3_trial
end

#present_institutional_base_salaryObject

Returns the value of attribute present_institutional_base_salary.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def present_institutional_base_salary
  @present_institutional_base_salary
end

#previous_submissionObject

Returns the value of attribute previous_submission.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def previous_submission
  @previous_submission
end

#salary_periodObject

Returns the value of attribute salary_period.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def salary_period
  @salary_period
end

#seeking_degree_during_proposed_awardObject

Returns the value of attribute seeking_degree_during_proposed_award.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def seeking_degree_during_proposed_award
  @seeking_degree_during_proposed_award
end

#senior_fellowship_applicationObject

Returns the value of attribute senior_fellowship_application.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def senior_fellowship_application
  @senior_fellowship_application
end

#specific_cell_lineObject

Returns the value of attribute specific_cell_line.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def specific_cell_line
  @specific_cell_line
end

#supplement_fundingObject

Returns the value of attribute supplement_funding.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def supplement_funding
  @supplement_funding
end

#supplemental_funding_amountObject

Returns the value of attribute supplemental_funding_amount.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def supplemental_funding_amount
  @supplemental_funding_amount
end

#supplemental_funding_receipt_periodObject

Returns the value of attribute supplemental_funding_receipt_period.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def supplemental_funding_receipt_period
  @supplemental_funding_receipt_period
end

#supplemental_funding_sourceObject

Returns the value of attribute supplemental_funding_source.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def supplemental_funding_source
  @supplemental_funding_source
end

#supplemental_funding_typeObject

Returns the value of attribute supplemental_funding_type.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def supplemental_funding_type
  @supplemental_funding_type
end

#type_of_degree_during_proposed_awardObject

Returns the value of attribute type_of_degree_during_proposed_award.



14
15
16
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 14

def type_of_degree_during_proposed_award
  @type_of_degree_during_proposed_award
end

Instance Method Details

#createObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/kuality-coeus/data_objects/grants_gov/phs_fellowship_questionnaire.rb', line 49

def create
  navigate
  on(S2S).questions
  on(Questions).expand_all
  on PHSFellowshipQuestionnaire do |phs_fellowship|

  # Answers all of the Yes/No questions first (in random order)
  YN_QUESTIONS.shuffle.each do |q|
    var = get(q)
    phs_fellowship.send(q, var) if var != nil && phs_fellowship.send("#{q}_element".to_sym, var).present?
  end

  # Next we answer the questions that are conditional, based on the above answers...
  1.upto(20) do |n|
    scl = "phs_stem_cell_line_#{n}"
    phs_fellowship.send(scl).fit get(scl)
  end

  fill_out phs_fellowship, :expected_degree_completion_date,
           :kirschstein_support_start_date, :kirschstein_support_end_date, :nih_grant_number, :former_institution,
           :present_institutional_base_salary, :salary_receipt_period, :supplemental_funding_amount,
           :supplemental_funding_receipt_period, :supplemental_funding_type, :supplemental_funding_source

  phs_fellowship.save
  end

end