Slide 1

Slide 1 text

@kevin_j_m I Know I Can, But Should I? Evaluating Alternatives Kevin Murphy

Slide 2

Slide 2 text

@kevin_j_m

Slide 3

Slide 3 text

@kevin_j_m

Slide 4

Slide 4 text

@kevin_j_m

Slide 5

Slide 5 text

@kevin_j_m Why?

Slide 6

Slide 6 text

@kevin_j_m Experience

Slide 7

Slide 7 text

@kevin_j_m Speed

Slide 8

Slide 8 text

@kevin_j_m Difficulty

Slide 9

Slide 9 text

@kevin_j_m Interest

Slide 10

Slide 10 text

@kevin_j_m Gut Reaction

Slide 11

Slide 11 text

@kevin_j_m @kevin_j_m Kevin Murphy

Slide 12

Slide 12 text

@kevin_j_m Weighted Scoring Model

Slide 13

Slide 13 text

@kevin_j_m Weighted Scoring Model

Slide 14

Slide 14 text

@kevin_j_m Weighted Scoring Model Criteria

Slide 15

Slide 15 text

@kevin_j_m Price Weighted Scoring Model Criteria

Slide 16

Slide 16 text

@kevin_j_m Price Ease of Use Weighted Scoring Model Criteria

Slide 17

Slide 17 text

@kevin_j_m Price Ease of Use Compliance Weighted Scoring Model Criteria

Slide 18

Slide 18 text

@kevin_j_m Price Ease of Use Compliance Delivery Time Weighted Scoring Model Criteria

Slide 19

Slide 19 text

@kevin_j_m Price Ease of Use Compliance Delivery Time Weighted Scoring Model Criteria Weight

Slide 20

Slide 20 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% Weighted Scoring Model Criteria Weight

Slide 21

Slide 21 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A Weighted Scoring Model Criteria Weight

Slide 22

Slide 22 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B Weighted Scoring Model Criteria Weight

Slide 23

Slide 23 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B 8 2 5 3 Weighted Scoring Model Criteria Weight

Slide 24

Slide 24 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B 8 2 5 3 3 5 7 4 Weighted Scoring Model Criteria Weight

Slide 25

Slide 25 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B 8 2 5 3 3 5 7 4 4.8 Weighted Scoring Model Criteria Weight

Slide 26

Slide 26 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B 8 2 5 3 3 5 7 4 4.8 4.4 Weighted Scoring Model Criteria Weight

Slide 27

Slide 27 text

@kevin_j_m Price Ease of Use Compliance Delivery Time 30% 10% 20% 40% A B 8 2 5 3 3 5 7 4 4.8 4.4 Weighted Scoring Model Criteria Weight

Slide 28

Slide 28 text

@kevin_j_m Merits Thoughtful

Slide 29

Slide 29 text

@kevin_j_m Merits Justification ⚖

Slide 30

Slide 30 text

@kevin_j_m Merits Consensus

Slide 31

Slide 31 text

@kevin_j_m Limitations Time ⏰

Slide 32

Slide 32 text

@kevin_j_m Limitations Knowledge

Slide 33

Slide 33 text

@kevin_j_m Limitations Inflexible

Slide 34

Slide 34 text

@kevin_j_m

Slide 35

Slide 35 text

@kevin_j_m Impact Cost Maintenance Consistency

Slide 36

Slide 36 text

@kevin_j_m

Slide 37

Slide 37 text

@kevin_j_m Impact

Slide 38

Slide 38 text

@kevin_j_m ' (

Slide 39

Slide 39 text

@kevin_j_m Send Welcome Email Send a welcome email to a study participant after they have enrolled.

Slide 40

Slide 40 text

@kevin_j_m scenario “Enrolling a participant” do end

Slide 41

Slide 41 text

@kevin_j_m scenario “Enrolling a participant” do visit new_study_participant_path(study) end

Slide 42

Slide 42 text

@kevin_j_m scenario “Enrolling a participant” do visit new_study_participant_path(study) fill_in "First name", with: "Kevin" fill_in "Email", with: "[email protected]" end

Slide 43

Slide 43 text

@kevin_j_m scenario “Enrolling a participant” do visit new_study_participant_path(study) fill_in "First name", with: "Kevin" fill_in "Email", with: "[email protected]" expect { click_button "Enroll" } .to have_enqueued_job .on_queue(“mailers”) end

Slide 44

Slide 44 text

@kevin_j_m class StudyParticipant < ApplicationRecord private end

Slide 45

Slide 45 text

@kevin_j_m class StudyParticipant < ApplicationRecord after_commit :deliver_welcome_mailer, on: :create private end +

Slide 46

Slide 46 text

@kevin_j_m class StudyParticipant < ApplicationRecord after_commit :deliver_welcome_mailer, on: :create private def deliver_welcome_mailer end end + + +

Slide 47

Slide 47 text

@kevin_j_m class StudyParticipant < ApplicationRecord after_commit :deliver_welcome_mailer, on: :create private def deliver_welcome_mailer StudyParticipantMailer.with(study_participant: self) .welcome_email .deliver_later end end + + + + + +

Slide 48

Slide 48 text

@kevin_j_m $ rspec . Finished in 0.01783 seconds 1 example, 0 failures

Slide 49

Slide 49 text

@kevin_j_m $ git reset --hard

Slide 50

Slide 50 text

@kevin_j_m class StudyEnrollment end

Slide 51

Slide 51 text

@kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end end

Slide 52

Slide 52 text

@kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end def save end end

Slide 53

Slide 53 text

@kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end def save @study_participant = StudyParticipant.new(@participant_params) end end

Slide 54

Slide 54 text

@kevin_j_m class StudyEnrollment def initialize(participant_params) @participant_params = participant_params end def save @study_participant = StudyParticipant.new(@participant_params) if @study_participant.save send_welcome_email end end end

Slide 55

Slide 55 text

@kevin_j_m class StudyParticipantsController < ApplicationController def create @study_participant = StudyParticipant.new( study_participant_params) if @study_participant.save redirect_to study_study_participants_path else render :new end end end

Slide 56

Slide 56 text

@kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new( study_participant_params) if @study_participant.save redirect_to study_study_participants_path else render :new end end end +

Slide 57

Slide 57 text

@kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new( study_participant_params) if enrollment.save redirect_to study_study_participants_path else render :new end end end + +

Slide 58

Slide 58 text

@kevin_j_m class StudyParticipantsController < ApplicationController def create enrollment = StudyEnrollment.new( study_participant_params) if enrollment.save redirect_to study_study_participants_path else @study_participant = enrollment.study_participant render :new end end end + + +

Slide 59

Slide 59 text

@kevin_j_m $ rspec . Finished in 0.01437 seconds 1 example, 0 failures

Slide 60

Slide 60 text

@kevin_j_m Impact Team Reaction ☢

Slide 61

Slide 61 text

@kevin_j_m Impact Future Standard

Slide 62

Slide 62 text

@kevin_j_m Impact Non-Functional Requirements

Slide 63

Slide 63 text

@kevin_j_m Cost

Slide 64

Slide 64 text

@kevin_j_m Limit System Access Ensure that only Principal Investigators may create study protocols.

Slide 65

Slide 65 text

@kevin_j_m scenario “Co-investigators cannot create a study protocol” do end

Slide 66

Slide 66 text

@kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in co_investigator_user end

Slide 67

Slide 67 text

@kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in co_investigator_user visit new_study_protocol_path(study) end

Slide 68

Slide 68 text

@kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in co_investigator_user visit new_study_protocol_path(study) within(".alert-danger") do expect(page).to have_content "Only Principal Investigators may create study protocols" end end

Slide 69

Slide 69 text

@kevin_j_m scenario “Co-investigators cannot create a study protocol” do sign_in co_investigator_user visit new_study_protocol_path(study) within(".alert-danger") do expect(page).to have_content "Only Principal Investigators may create study protocols" end expect(page).to have_current_path root_path end

Slide 70

Slide 70 text

@kevin_j_m class StudyProtocolsController < ApplicationController def new @study_protocol = StudyProtocol.new(study: study) end end

Slide 71

Slide 71 text

@kevin_j_m class StudyProtocolsController < ApplicationController def new if current_user.principal_investigator? @study_protocol = StudyProtocol.new(study: study) end end end + + +

Slide 72

Slide 72 text

@kevin_j_m class StudyProtocolsController < ApplicationController def new if current_user.principal_investigator? @study_protocol = StudyProtocol.new(study: study) else user_not_authorized end end end + + + + +

Slide 73

Slide 73 text

@kevin_j_m $ rspec . Finished in 0.02832 seconds 1 example, 0 failures

Slide 74

Slide 74 text

@kevin_j_m $ git reset --hard

Slide 75

Slide 75 text

@kevin_j_m class StudyProtocolsController < ApplicationController def new @study_protocol = StudyProtocol.new(study: study) end end

Slide 76

Slide 76 text

@kevin_j_m class StudyProtocolsController < ApplicationController def new @study_protocol = StudyProtocol.new(study: study) authorize(@study_protocol) end end +

Slide 77

Slide 77 text

@kevin_j_m class StudyProtocolsController < ApplicationController rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized def new @study_protocol = StudyProtocol.new(study: study) authorize(@study_protocol) end end + + +

Slide 78

Slide 78 text

@kevin_j_m $ rspec . Finished in 0.02146 seconds 1 example, 0 failures

Slide 79

Slide 79 text

@kevin_j_m Cost

Slide 80

Slide 80 text

@kevin_j_m Cost Risk Appetite

Slide 81

Slide 81 text

@kevin_j_m Cost Contextual Pressures ⌛

Slide 82

Slide 82 text

@kevin_j_m Cost Big Picture

Slide 83

Slide 83 text

@kevin_j_m Maintenance

Slide 84

Slide 84 text

@kevin_j_m Data Collection Date Display the date when data was collected along with the data.

Slide 85

Slide 85 text

@kevin_j_m scenario “Viewing a data collection event” do end

Slide 86

Slide 86 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) end

Slide 87

Slide 87 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at end

Slide 88

Slide 88 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) end

Slide 89

Slide 89 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end

Slide 90

Slide 90 text

@kevin_j_m

Slide 91

Slide 91 text

@kevin_j_m
Collection Date:

Slide 92

Slide 92 text

@kevin_j_m
Collection Date:

Slide 93

Slide 93 text

@kevin_j_m
Collection Date:
<%= l(@data_collection_event.created_at, format: :long_date_only)%>

Slide 94

Slide 94 text

@kevin_j_m $ rspec . Finished in 0.01126 seconds 1 example, 0 failures

Slide 95

Slide 95 text

@kevin_j_m $ git reset --hard

Slide 96

Slide 96 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end

Slide 97

Slide 97 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end

Slide 98

Slide 98 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, created_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end

Slide 99

Slide 99 text

@kevin_j_m scenario “Viewing a data collection event” do collected_at = Time.zone.local(2019, 5, 1, 15, 30) collection_event = create :data_collection_event, collected_at: collected_at visit data_collection_event_path(collection_event) within ".summary-information .collected-date" do expect(page).to have_content "May 1, 2019" end end

Slide 100

Slide 100 text

@kevin_j_m $ rails g migration add_collected_at_to_data_collection

Slide 101

Slide 101 text

@kevin_j_m
Collection Date:
<%= l(@data_collection_event.created_at, format: :long_date_only)%>

Slide 102

Slide 102 text

@kevin_j_m
Collection Date:
<%= l(@data_collection_event.created_at, format: :long_date_only)%>

Slide 103

Slide 103 text

@kevin_j_m
Collection Date:
<%= l(@data_collection_event.collected_at, format: :long_date_only)%>

Slide 104

Slide 104 text

@kevin_j_m $ rspec . Finished in 0.01283 seconds 1 example, 0 failures

Slide 105

Slide 105 text

@kevin_j_m Maintenance Upcoming Requirements

Slide 106

Slide 106 text

@kevin_j_m Maintenance Solicit Input 1

Slide 107

Slide 107 text

@kevin_j_m Maintenance Future Self

Slide 108

Slide 108 text

@kevin_j_m Consistency

Slide 109

Slide 109 text

@kevin_j_m Personal Info Warning Warn a user that editing their personal information may make them ineligible for the study.

Slide 110

Slide 110 text

@kevin_j_m scenario “Warn about personal information changes” do end

Slide 111

Slide 111 text

@kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant) end

Slide 112

Slide 112 text

@kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant) within(".alert-warning") do end end

Slide 113

Slide 113 text

@kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant) within(".alert-warning") do expect(page).to have_content “Modifying your information may risk your eligibility.” end end

Slide 114

Slide 114 text

@kevin_j_m class PersonalInformationController < ApplicationController def edit @personal_information = PersonalInformation.new(id) end end

Slide 115

Slide 115 text

@kevin_j_m class PersonalInformationController < ApplicationController def edit @personal_information = PersonalInformation.new(id) flash[:warning] = I18n.t(“personal_info.edit.warning”) end end +

Slide 116

Slide 116 text

@kevin_j_m $ rspec . Finished in 0.01427 seconds 1 example, 0 failures

Slide 117

Slide 117 text

@kevin_j_m

Slide 118

Slide 118 text

@kevin_j_m class PersonalInformationController < ApplicationController def edit @personal_information = PersonalInformation.new(id) flash[:warning] = I18n.t(“personal_info.edit.warning”) end end +

Slide 119

Slide 119 text

@kevin_j_m scenario “Warn about personal information changes” do visit edit_personal_information_path(participant) within(".alert-warning") do expect(page).to have_content “Modifying your information may risk your eligibility.” end end - - - - - - - -

Slide 120

Slide 120 text

@kevin_j_m Consistency Institutional Knowledge

Slide 121

Slide 121 text

@kevin_j_m Consistency Existing Standards

Slide 122

Slide 122 text

@kevin_j_m Consistency Orientation Time

Slide 123

Slide 123 text

@kevin_j_m Impact Cost Maintenance Consistency

Slide 124

Slide 124 text

@kevin_j_m Current Applicability

Slide 125

Slide 125 text

@kevin_j_m Impact Cost Maintenance Consistency

Slide 126

Slide 126 text

@kevin_j_m Impact Cost Maintenance Consistency 30% 10% 20% 40%

Slide 127

Slide 127 text

@kevin_j_m Personal Info Warning Per FDA RC2019-PII, warn a user that editing their personal information may make them ineligible for the study.

Slide 128

Slide 128 text

@kevin_j_m Impact Cost Maintenance Consistency 30% 10% 20% 40%

Slide 129

Slide 129 text

@kevin_j_m Impact Cost Maintenance Consistency 40% 10% 30% 20%

Slide 130

Slide 130 text

@kevin_j_m RC2019-PII …Failure to notify participants of this may be punishable by up to 30 days in jail or fines of $1,000,000 per documented occurrence.

Slide 131

Slide 131 text

@kevin_j_m Impact Cost Maintenance Consistency 40% 10% 30% 20%

Slide 132

Slide 132 text

@kevin_j_m Impact Cost Maintenance Consistency 15% 70% 10% 5%

Slide 133

Slide 133 text

@kevin_j_m scenario “Editing Personal Information” do visit edit_personal_information_path(participant) fill_in “First Name”, with: “Kevin” click_button “Submit” … end

Slide 134

Slide 134 text

@kevin_j_m scenario “Editing Personal Information” do visit edit_personal_information_path(participant) within(".alert-warning") do expect(page).to have_content "Modifying your information your may risk your eligibility.” end fill_in “First Name”, with: “Kevin” … end + + + +

Slide 135

Slide 135 text

@kevin_j_m Impact Cost Maintenance Consistency

Slide 136

Slide 136 text

@kevin_j_m https://www.thegnar.co/railsconf https://github.com/kevin-j-m/evaluating-alternatives

Slide 137

Slide 137 text

@kevin_j_m @kevin_j_m Kevin Murphy