This repository has been archived by the owner on May 2, 2022. It is now read-only.
/
routes.rb
164 lines (131 loc) · 7.98 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
require 'sidekiq/web'
Rails.application.routes.draw do
use_doorkeeper do
controllers tokens: 'tokens'
end
if ADMIN_OPTIONS['report_mode']
root to: 'assessments#landing'
else
root to: 'home#index'
end
devise_for :users, only: [:sessions, :authy], controllers: {devise_authy: 'devise_authy'}, :path_names => {
verify_authy: "/verify-token",
enable_authy: "/enable-two-factor",
verify_authy_installation: "/verify-installation"
}
devise_scope :user do
authenticate :user, lambda { |u| u.usa_admin? } do
mount Sidekiq::Web => '/sidekiq'
end
end
as :user do
get 'users/edit', to: 'users/registrations#edit', as: :edit_user_registration
put 'users', to: 'users/registrations#update', as: :user_registration
get 'users/password_expired', to: 'users/registrations#password_expired', as: :user_password_expired
end
namespace :fhir, defaults: { format: :json } do
namespace :r4 do
post '', to: 'api#transaction'
get '/metadata', to: 'api#capability_statement'
get '/.well-known/smart-configuration', to: 'api#well_known'
get '/Patient/$export', to: 'api#bulk_data_export'
get '/ExportStatus/:id', to: 'api#export_status'
get '/ExportFiles/:id/:resource_type', to: 'api#export_files'
get '/:resource_type/:id', to: 'api#show'
put '/:resource_type/:id', to: 'api#update'
patch '/:resource_type/:id', to: 'api#update'
post '/:resource_type', to: 'api#create'
get '/:resource_type', to: 'api#search'
post '/:resource_type/_search', to: 'api#search'
get '/Patient/:id/$everything', to: 'api#all'
end
end
get '/.well-known/smart-configuration', to: 'fhir/r4/api#well_known'
namespace :api do
get '/nbs/patient', to: 'api_export#nbs_patients'
end
get '/redirect', to: redirect { |params, request| "/oauth/authorize/native?#{request.params.to_query}" }
get '/patients/sms_eligibility_check', to: 'patients#sms_eligibility_check'
resources :patients, only: [:index, :new, :create, :show, :edit, :update]
resources :admin, only: [:index]
get 'admin/users', to: 'admin#users'
get 'admin/counts', to: 'admin#counts'
post 'users/audits/:id', to: 'users#audits'
post 'admin/create_user', to: 'admin#create_user'
post 'admin/edit_user', to: 'admin#edit_user'
post 'admin/reset_password', to: 'admin#reset_password'
post 'admin/reset_2fa', to: 'admin#reset_2fa'
post 'admin/email_all', to: 'admin#email_all'
post '/histories', to: 'histories#create'
post '/histories/:id/edit', to: 'histories#edit'
post '/histories/:id/delete', to: 'histories#delete'
resources :contact_attempts, only: [:create]
post '/laboratories', to: 'laboratories#create'
post '/laboratories/:id', to: 'laboratories#update'
delete '/laboratories/:id', to: 'laboratories#destroy'
get '/jurisdictions/paths', to: 'jurisdictions#jurisdiction_paths', as: :jurisdiction_paths
get '/jurisdictions/allpaths', to: 'jurisdictions#all_jurisdiction_paths', as: :all_jurisdiction_paths
post '/jurisdictions/assigned_users', to: 'jurisdictions#assigned_users_for_viewable_patients', as: :assigned_users_for_viewable_patients
post '/close_contacts', to: 'close_contacts#create'
post '/close_contacts/:id', to: 'close_contacts#update'
delete '/close_contacts/:id', to: 'close_contacts#destroy'
get '/patients/:id/group', to: 'patients#new_group_member'
get '/export/csv_linelist/:workflow', to: 'export#csv_linelist'
get '/export/sara_alert_format/:workflow', to: 'export#sara_alert_format'
get '/export/full_history_patients/:scope', to: 'export#full_history_patients'
get '/export/full_history_patient/:patient_id', to: 'export#full_history_patient'
post '/export/custom', to: 'export#custom_export'
get '/export/nbs/patient/:patient_id', to: 'export#nbs_patient'
post '/import/:workflow/:format', to: 'import#import'
get '/import/download_guidance', to: 'import#download_guidance'
get '/monitoree_unavailable', to: 'patients#monitoree_unavailable'
get '/patients/:id/household_removeable', to: 'patients#household_removeable'
post '/patients/head_of_household_options', to: 'patients#head_of_household_options'
post '/patients/bulk_edit', to: 'patients#bulk_update'
post '/patients/:id/status', to: 'patients#update_status'
post '/patients/:id/status/clear', to: 'patients#clear_assessments'
post '/patients/:id/status/clear/:assessment_id', to: 'patients#clear_assessment'
post '/patients/:id/update_hoh', to: 'patients#update_hoh'
post '/patients/:id/move_to_household', to: 'patients#move_to_household'
post '/patients/:id/remove_from_household', to: 'patients#remove_from_household'
post '/patients/:id/follow_up_flag', to: 'patients#update_follow_up_flag'
post '/patients/current_case_status', to: 'patients#current_case_status'
resources :patients, param: :submission_token do
resources :assessments, only: [:create, :new, :index]
end
resources :vaccines, only: [:index, :create, :update, :destroy]
resources :close_contacts, only: [:index, :create, :update, :destroy]
resources :user_filters, only: [:index, :create, :update, :destroy]
resources :user_export_presets, only: [:index, :create, :update, :destroy]
post '/report/patients/:patient_submission_token/:unique_identifier', to: 'assessments#create', as: :create_patient_assessment_jurisdiction_report
post '/twilio', to: 'assessments#create', as: :create_patient_assessment_jurisdiction_report_twilio
post '/report/twilio', to: 'assessments#create', as: :create_patient_assessment_jurisdiction_report_twilio_report
get '/patients/:patient_submission_token/:unique_identifier', to: 'assessments#new', as: :new_patient_assessment_jurisdiction
get '/patients/:patient_submission_token/:lang/:unique_identifier', to: 'assessments#new', as: :new_patient_assessment_jurisdiction_lang
get '/report/patients/:patient_submission_token/:unique_identifier', to: 'assessments#new', as: :new_patient_assessment_jurisdiction_report
get '/report/patients/:patient_submission_token/:lang/:unique_identifier', to: 'assessments#new', as: :new_patient_assessment_jurisdiction_report_lang
get '/r/:patient_submission_token/:unique_identifier/:lang', to: 'assessments#new', as: :new_patient_assessment_jurisdiction_lang_no_initials
get '/r/:patient_submission_token/:unique_identifier/:lang/:initials_age', to: 'assessments#new', as: :new_patient_assessment_jurisdiction_lang_initials
get '/already_reported', to: 'assessments#already_reported', as: :already_reported
get '/report/already_reported', to: 'assessments#already_reported', as: :already_reported_report
get '/invalid_link', to: 'assessments#invalid_link', as: :invalid_link
get '/report/invalid_link', to: 'assessments#invalid_link', as: :invalid_link_report
post '/patients/:patient_submission_token/assessments/:id', to: 'assessments#update'
get '/public_health', to: redirect('/public_health/exposure')
get '/public_health/global', to: 'public_health#global', as: :public_health_global
get '/public_health/exposure', to: 'public_health#exposure', as: :public_health_exposure
get '/public_health/isolation', to: 'public_health#isolation', as: :public_health_isolation
post '/public_health/patients', to: 'public_health#patients', as: :public_health_patients
post '/public_health/patients/count', to: 'public_health#patients_count', as: :public_health_patients_count
get '/public_health/patients/counts/workflow', to: 'public_health#workflow_counts', as: :workflow_counts
get '/public_health/patients/counts/:workflow/:tab', to: 'public_health#tab_counts', as: :tab_counts
get '/languages/get_all_languages', to: 'languages#language_data'
post '/languages/translate_languages', to: 'languages#translate_language_codes'
get '/analytics', to: 'analytics#index', as: :analytics
get '/analytics/monitoree_maps', to: 'analytics#monitoree_maps', as: :monitoree_maps
get '/county_level_maps/:mapFile', to: 'analytics#clm_geo_json'
# Errors
get '/404', to: 'errors#not_found'
get '/422', to: 'errors#unprocessable'
get '/500', to: 'errors#internal_server_error'
end