-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.py
275 lines (262 loc) · 5.76 KB
/
start.py
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
"""
TO BE USED ON NEW HEROKU DEPLOYS ONLY.
Create database tables, fill in values for relationship tables.
This is run on heroku review apps. If database needs to be cleared, can be run again with:
heroku run python start.py --app icarus-rest-api
"""
from models.designation import DesignationModel
from models.language import LanguageModel
from models.provider_type import ProviderTypeModel
from models.specialty import SpecialtyModel
from os import environ
from app import app
from extensions import db, ma
with app.app_context():
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
if environ.get('DEV_ENV') == ('prod' or 'staging'):
app.config['SQLALCHEMY_DATABASE_URI'] = environ.get('DATABASE_URL') + '?sslmode=require'
else:
app.config['SQLALCHEMY_DATABASE_URI'] = environ.get('DATABASE_URL')
db.init_app(app)
db.create_all()
db.session.commit()
# order matters here
ma.init_app(app)
designations = [
"MD",
]
languages = [
"Acholi",
"Afrikaans",
"Akan",
"Albanian",
"American Sign Language",
"Amharic",
"Arabic",
"Armenian",
"Assyrian",
"Azari",
"Belarusian",
"Bengali",
"Bislama",
"Bosnian",
"Bulgarian",
"Burmese",
"Cambodian",
"Cantonese",
"Catalan",
"Cebuano",
"Chewa",
"Chinese",
"Chitumbuka",
"Creole",
"Croatian",
"Czech",
"Dagaare",
"Danish",
"Dari",
"Dutch",
"English",
"Eritrean",
"Estonian",
"Ethiopian",
"Farsi",
"Filipino",
"Finnish",
"Flemish",
"French",
"Fukien",
"Fuzhou",
"Ga",
"Ga-Adangme-Krobo",
"Gaelic",
"Ganda",
"Georgian",
"German",
"Ghana",
"Greek",
"Gujarati",
"Hakka",
"Hausa",
"Hebrew",
"Hindi",
"Hungarian",
"Ibibio",
"Ibo",
"Icelandic",
"Igbo",
"Ilocano",
"Indonesian",
"Iranian",
"Italian",
"Jamaican Creole",
"Japanese",
"Kaamba",
"Kabyle",
"Kachchi",
"Kannada",
"Kashmiri",
"Konkani",
"Korean",
"Kurdi",
"Lao",
"Latvian",
"Lingala",
"Lithuanian",
"Macedonian",
"Malay",
"Malayalam",
"Maltese",
"Mandarin",
"Marathi",
"Nepali",
"Norwegian",
"Nzema",
"Ojibwa",
"Oriya",
"Other",
"Panjabi/Punjabi",
"Persian",
"Polish",
"Portuguese",
"Pushto",
"Quechua",
"Romanian",
"Russian",
"Samoan",
"Serbian",
"Sesotho",
"Sindhi",
"Sinhala",
"Sinhalese",
"Slovak",
"Slovenian",
"Soga",
"Somalian",
"Spanish",
"Swahili",
"Swatow",
"Swedish",
"Tagalog",
"Taiwanese",
"Tamil",
"Telugu",
"Thai",
"Tigrigna",
"Tiv",
"Tok Pisin",
"Tulu",
"Turkish",
"Ukrainian",
"Urdu",
"Vietnamese",
"Visayan",
"Welsh",
"Xhosa",
"Yiddish",
"Yoruba",
"Yugoslav",
"Zulu"
]
provider_types = [
"Dentist",
]
specialties = [
"Adolescent Medicine",
"Anatomical Pathology",
"Anesthesiology",
"Bacteriology",
"Cardiac Surgery",
"Cardiology",
"Cardiothoracic Surgery",
"Cardiovascular and Thoracic Surgery",
"Child and Adolescent Psychiatry",
"Clinical Immunology",
"Clinical Immunology and Allergy",
"Clinical Pharmacology",
"Clinical Pharmacology and Toxicology",
"Colorectal Surgery",
"Community Medicine",
"Critical Care Medicine",
"Dermatology",
"Developmental Paediatrics",
"Diagnostic and Therapeutic Radiology",
"Diagnostic Radiology",
"Emergency Medicine",
"Endocrinology and Metabolism",
"Family Medicine",
"Family Medicine (Emergency Medicine)",
"Forensic Pathology",
"Forensic Psychiatry",
"Gastroenterology",
"General Internal Medicine",
"General Pathology",
"General Surgery",
"General Surgical Oncology",
"Geriatric Medicine",
"Geriatric Psychiatry",
"Gynecologic Oncology",
"Gynecologic Reproductive Endocrinology & Infertility",
"Hematological Pathology",
"Hematology",
"Infectious Diseases",
"Internal Medicine",
"Laboratory Medicine",
"Maternal Fetal Medicine",
"Medical Biochemistry",
"Medical Genetics",
"Medical Microbiology",
"Medical Oncology",
"Neonatal-Perinatal Medicine",
"Nephrology",
"Neurology",
"Neurology and Psychiatry",
"Neuropathology",
"Neuroradiology",
"Neurosurgery",
"Nuclear Medicine",
"Obstetrics",
"Obstetrics and Gynecology",
"Occupational Medicine",
"Ophthalmology",
"Orthopedic Surgery",
"Otolaryngology - Head and Neck Surgery",
"Paediatric Cardiology",
"Paediatric Emergency Medicine",
"Paediatric Haematology/Oncology",
"Paediatric Radiology",
"Paediatric Surgery",
"Pain Medicine",
"Palliative Medicine",
"Pathology and Bacteriology",
"Pediatric General Surgery",
"Pediatrics",
"Physical Medicine and Rehabilitation",
"Plastic Surgery",
"Psychiatry",
"Public Health",
"Public Health and Preventive Medicine",
"Radiation Oncology",
"Respirology",
"Rheumatology",
"Thoracic Surgery",
"Transfusion Medicine",
"Urology",
"Vascular Surgery"
]
for designation in designations:
with app.app_context():
db.session.add(DesignationModel(name=designation))
db.session.commit()
for language in languages:
with app.app_context():
db.session.add(LanguageModel(name=language))
db.session.commit()
for provider_type in provider_types:
with app.app_context():
db.session.add(ProviderTypeModel(name=provider_type))
db.session.commit()
for specialty in specialties:
with app.app_context():
db.session.add(SpecialtyModel(name=specialty))
db.session.commit()