Produced by Araxis Merge on 5/24/2018 2:23:41 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | CUI-v2.5.0-release-source.zip\db | seeds.rb | Fri Mar 23 17:02:06 2018 UTC |
| 2 | CUI-v2.5.0-release-source.zip\db | seeds.rb | Fri May 18 13:49:09 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 1386 |
| Changed | 2 | 90 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | # db/seeds .rb | ||
| 2 | # This fil e is execu ted during `rake db: reset` and `db:setup ` and `db: seed` task s | ||
| 3 | |||
| 4 | PaperTrail .enabled = false | ||
| 5 | |||
| 6 | # If this file is ex ecuted whe n the RAIL S_ENV is d evelopment it will | ||
| 7 | # only see d the stat ic text fi les unless the DBRES ET environ ment varia ble is tru e | ||
| 8 | # WHen DBR ESET is tr ue and RAI LS_ENV is developmen t, the dat abase will have | ||
| 9 | # been res et to a bl ank condit ion prior to this fi le being e xecuted an d the | ||
| 10 | # this fil e will pop ulate the entire dev elopment d ataset. | ||
| 11 | |||
| 12 | require 's eeder.rb' | ||
| 13 | |||
| 14 | require 'c sv_seeder. rb' | ||
| 15 | include Cs vSeeder | ||
| 16 | |||
| 17 | require 's ql_seeder. rb' | ||
| 18 | include Sq lSeeder | ||
| 19 | |||
| 20 | |||
| 21 | ########## ########## ########## ########## ########## ####### | ||
| 22 | ## seed st atic text tables fro m csv file s located in db/csv | ||
| 23 | |||
| 24 | puts "\nLo ading stat ic text ta bles." | ||
| 25 | |||
| 26 | unless CPP _DISABLED # Turn of f CPP feat ures prior to deprec ating code | ||
| 27 | [ | ||
| 28 | CareCa tegory, | ||
| 29 | Consul tationOrde r, | ||
| 30 | Consul tationStat us, | ||
| 31 | Consul tationType , | ||
| 32 | OtherH ealthInsur ance, | ||
| 33 | Referr alDocument Type, | ||
| 34 | Referr alReason, | ||
| 35 | Referr alType, | ||
| 36 | Referr alAppointm entStatus | ||
| 37 | |||
| 38 | ].each d o |model_c lass_name| | ||
| 39 | load_s tatic_text _table_fro m_csv(klas s: model_c lass_name, | ||
| 40 | comm on_fields: { deleted _at: nil } , | ||
| 41 | colu mn_mapping s: ['seque nce','titl e'], | ||
| 42 | use_ copy_from: false | ||
| 43 | ) | ||
| 44 | end | ||
| 45 | end # unle ss CPP_DIS ABLED | ||
| 46 | |||
| 47 | unless see d_from_sql ("Visn", r eset_only: false) | ||
| 48 | load_sta tic_text_t able_from_ csv( | ||
| 49 | klass: Visn, | ||
| 50 | column _mappings: ['sequenc e','delete d_at','reg ion','name '], | ||
| 51 | use_co py_from: f alse | ||
| 52 | ) | ||
| 53 | end | ||
| 54 | |||
| 55 | unless see d_from_sql ("Site", r eset_only: true) | ||
| 56 | load_sta tic_text_t able_from_ csv( | ||
| 57 | klass: Site, | ||
| 58 | column _mappings: ['name', 'address', 'city','st ate','zip_ code','sit e_station_ number'], | ||
| 59 | common _fields: {country : 'USA'}, | ||
| 60 | use_co py_from: false | ||
| 61 | ) | ||
| 62 | end | ||
| 63 | |||
| 64 | unless see d_from_sql ("Diagnosi sCode", re set_only: true) | ||
| 65 | load_sta tic_text_t able_from_ csv( | ||
| 66 | klass: Diagnosi sCode, | ||
| 67 | column _mappings: ['version _code','de scription' ], | ||
| 68 | use_co py_from: false | ||
| 69 | ) | ||
| 70 | end | ||
| 71 | |||
| 72 | unless see d_from_sql ( "Clinic" , reset_on ly: true) | ||
| 73 | load_sta tic_text_t able_from_ csv( | ||
| 74 | klass: Clinic, | ||
| 75 | column _mappings: ['site_i d','clinic _identifie r','name'] , | ||
| 76 | use_co py_from: false | ||
| 77 | ) | ||
| 78 | end | ||
| 79 | |||
| 80 | ########## ########## ########## ########## ########## ######## | ||
| 81 | ## Creat e three db qs for CUI | ||
| 82 | |||
| 83 | puts ".. . Seeding new dbqs i n CUI" | ||
| 84 | |||
| 85 | seed_fro m_sql( | ||
| 86 | "DbqFo rm", | ||
| 87 | "DbqSe ction", | ||
| 88 | "DbqEl ement", | ||
| 89 | reset_ only: true | ||
| 90 | ) | ||
| 91 | |||
| 92 | puts "Do ne" | ||
| 93 | |||
| 94 | |||
| 95 | ### Load i ssue categ ories for DOM-127 Re quest for Support ## # | ||
| 96 | %w[ | ||
| 97 | Performa nce | ||
| 98 | Security | ||
| 99 | Function al | ||
| 100 | Access | ||
| 101 | Forgot_P assword | ||
| 102 | Other | ||
| 103 | ].each do |category| | ||
| 104 | SupportR equestCate gory.find_ or_create_ by(name: c ategory.gs ub('_', ' ').titleca se) | ||
| 105 | end | ||
| 106 | |||
| 107 | org1 = Sup portReques tOrganizat ion.create (short_nam e: "C&P", long_name: "Compensat ion and Pe nsion") | ||
| 108 | |||
| 109 | org2 = Sup portReques tOrganizat ion.create (short_nam e: "CPP", long_name: "Community Provider Portal") | ||
| 110 | |||
| 111 | ########## ########## ########## ########## ########## ########## # | ||
| 112 | |||
| 113 | |||
| 114 | ########## ########## ########## ########## ########## ####### | ||
| 115 | ## define the Referr alStatus | ||
| 116 | |||
| 117 | unless CPP _DISABLED # Turn of f CPP feat ures prior to deprec ating code | ||
| 118 | print "L oading sta tic text f or Referra lStatus .. . " | ||
| 119 | |||
| 120 | [ | ||
| 121 | { | ||
| 122 | stat us: "n ew", | ||
| 123 | upda te_descrip tion: "" , | ||
| 124 | refe rral_queue : "v ha_cc", # Only use rs who hav e one of t hese roles will have this stat us in the referral_q ueue | ||
| 125 | filt erable_by_ roles: "v ha_cc" # Only use rs who hav e one of t hese roles will have this stat us in the detail fil ter pane | ||
| 126 | }, | ||
| 127 | { | ||
| 128 | stat us: "p rep", | ||
| 129 | upda te_descrip tion: "T he Referra l is being prepared for the Co mmunity Pr ovider.", | ||
| 130 | refe rral_queue : "v ha_cc", | ||
| 131 | filt erable_by_ roles: "v ha_cc" | ||
| 132 | }, | ||
| 133 | { | ||
| 134 | stat us: "a ssigned", | ||
| 135 | upda te_descrip tion: "T he Referra l contains all medic al informa tion neede d for the first visi t and has been assig ned to a C ommunity P rovider. < b>Note:</b > The Comm untiy Prov ider will receive a system-gen erated not ification email as s oon as the <b>Submit </b> butto n below is clicked." , | ||
| 136 | refe rral_queue : "v ha_cc, non _vha", | ||
| 137 | filt erable_by_ roles: "v ha_cc, non _vha" | ||
| 138 | }, | ||
| 139 | { | ||
| 140 | stat us: "a ccepted", | ||
| 141 | upda te_descrip tion: "T he Communi ty Provide r has succ essfully r eturned me dical reco rds for th e first ap pointment. Additiona l appointm ents and m edical doc uments are expected. ", | ||
| 142 | refe rral_queue : "n on_vha", | ||
| 143 | filt erable_by_ roles: "v ha_cc, non _vha" | ||
| 144 | }, | ||
| 145 | { | ||
| 146 | stat us: "r eview_pend ing", | ||
| 147 | upda te_descrip tion: "T he Referra l has been sent to t he VA for approval." , | ||
| 148 | refe rral_queue : "v ha_cc, non _vha", | ||
| 149 | filt erable_by_ roles: "v ha_cc, non _vha" | ||
| 150 | }, | ||
| 151 | { | ||
| 152 | stat us: "i nformation _needed", | ||
| 153 | upda te_descrip tion: "T he Referra l has been reviewed and return ed to the Community Provider w ith a requ est for ad ditional i nformation .", | ||
| 154 | refe rral_queue : "v ha_cc, non _vha", | ||
| 155 | filt erable_by_ roles: "v ha_cc, non _vha" | ||
| 156 | }, | ||
| 157 | { | ||
| 158 | stat us: "c omplete", | ||
| 159 | upda te_descrip tion: "T he Referra l is compl ete and al l medical document h ave been r eceived.", | ||
| 160 | refe rral_queue : "" , | ||
| 161 | filt erable_by_ roles: "v ha_cc, non _vha" | ||
| 162 | } | ||
| 163 | ].each d o |entry| | ||
| 164 | Referr alStatus.f ind_or_cre ate_by( | ||
| 165 | name : en try[:statu s].gsub('_ ', ' ').ti tlecase, | ||
| 166 | code : en try[:statu s].upcase, | ||
| 167 | upda te_descrip tion: en try[:updat e_descript ion], | ||
| 168 | refe rral_queue : en try[:refer ral_queue] .downcase, | ||
| 169 | filt erable_by_ roles: en try[:filte rable_by_r oles].down case | ||
| 170 | ) | ||
| 171 | end | ||
| 172 | |||
| 173 | puts "do ne" | ||
| 174 | end # unle ss CPP_DIS ABLED | ||
| 175 | |||
| 176 | |||
| 177 | ########## ########## ########## ########## ########## ####### | ||
| 178 | ## define the test E xamination State | ||
| 179 | |||
| 180 | print "Loa ding stati c text for Examinati onState .. . " | ||
| 181 | |||
| 182 | # FIXME: s pelling er ror: Cance led not Ca ncelled | ||
| 183 | %w[ | ||
| 184 | Pending | ||
| 185 | Ready_to _be_Schedu led | ||
| 186 | Schedule d | ||
| 187 | In_Progr ess | ||
| 188 | Complete d | ||
| 189 | Reviewed | ||
| 190 | Submitte d | ||
| 191 | Rejected | ||
| 192 | Pending_ Cancellati on | ||
| 193 | Canceled | ||
| 194 | Reschedu le | ||
| 195 | Pending_ Clarificat ion | ||
| 196 | ].each do |status| | ||
| 197 | Examinat ionState.f ind_or_cre ate_by(nam e: status. gsub('_', ' ').title case, code : status.u pcase) | ||
| 198 | end | ||
| 199 | |||
| 200 | puts "done " | ||
| 201 | |||
| 202 | |||
| 203 | ########## ########## ########## ########## ########## ####### | ||
| 204 | ## define the test E xamRequest State | ||
| 205 | |||
| 206 | print "Loa ding stati c text for ExamReque stState .. . " | ||
| 207 | |||
| 208 | # FIXME: s pelling er ror Cancel ed not Can celled | ||
| 209 | %w[ | ||
| 210 | New | ||
| 211 | In_Progr ess | ||
| 212 | Pending_ Clarificat ion | ||
| 213 | Pending_ Reported | ||
| 214 | Pending_ Cancellati on | ||
| 215 | Canceled | ||
| 216 | Canceled _by_MAS | ||
| 217 | Canceled _by_RO | ||
| 218 | Complete d | ||
| 219 | Complete d_Printed_ by_RO | ||
| 220 | Released _to_RO_Not _Printed | ||
| 221 | Rerouted _New | ||
| 222 | Rerouted _Accepted | ||
| 223 | Rerouted _Rejected | ||
| 224 | Clarific ation_Rece ived | ||
| 225 | ].each do |status| | ||
| 226 | ExamRequ estState.f ind_or_cre ate_by(nam e: status. gsub('_', ' ').title case, code : status.u pcase) | ||
| 227 | end | ||
| 228 | |||
| 229 | puts "done " | ||
| 230 | |||
| 231 | |||
| 232 | ########## ########## ########## ########## ########## ####### | ||
| 233 | ## define the test C larificati onType | ||
| 234 | |||
| 235 | print "Loa ding stati c text for Clarifica tionType . .. " | ||
| 236 | |||
| 237 | %w[ | ||
| 238 | Request | ||
| 239 | Response | ||
| 240 | ].each do |status| | ||
| 241 | Clarific ationType. find_or_cr eate_by(na me: status .gsub('_', ' ').titl ecase, cod e: status. upcase) | ||
| 242 | end | ||
| 243 | |||
| 244 | puts "done " | ||
| 245 | |||
| 246 | |||
| 247 | ########## ########## ########## ########## ########## ####### | ||
| 248 | ## Loading the data from db/ec m_seeds.rb via | ||
| 249 | ## rake ev al_con_man :seed | ||
| 250 | ## | ||
| 251 | ## The fol lowing mod els are im pacted: | ||
| 252 | ## Di agnosisMod ifier | ||
| 253 | ## Di agnosis | ||
| 254 | ## Dm Assignment | ||
| 255 | ## Sy mptom | ||
| 256 | ## Mi norSystem | ||
| 257 | ## Ma jorSystem | ||
| 258 | ## Ev aluationTe mplate | ||
| 259 | |||
| 260 | |||
| 261 | print "I nvoking ra ke task ev al_con_man :seed ... " | ||
| 262 | unless E valuationT emplate.ex ists? | ||
| 263 | Rake:: Task["eval _con_man:s eed"].invo ke | ||
| 264 | |||
| 265 | puts " done" | ||
| 266 | |||
| 267 | print "Invoking rake task eval_con_m an:load_ht ml ..." | ||
| 268 | |||
| 269 | Rake:: Task["eval _con_man:l oad_html"] .invoke | ||
| 270 | |||
| 271 | puts " done" | ||
| 272 | end | ||
| 273 | |||
| 274 | # ######## ########## ########## ########## ########## ######### | ||
| 275 | # ## Loadi ng the dat a from db/ vbms_r_fg_ init.rb vi a | ||
| 276 | # ## rake vbms_r_fg: init | ||
| 277 | # ## | ||
| 278 | # ## The f ollowing m odels are impacted: | ||
| 279 | # ## VbmsRFactG roup | ||
| 280 | |||
| 281 | print "In voking rak e task vbm s_r_fg:ini t ... " | ||
| 282 | |||
| 283 | Rake::Tas k["vbms_r_ fg:init"]. invoke | ||
| 284 | |||
| 285 | puts "don e" | ||
| 286 | |||
| 287 | ######## ########## ########## ########## ########## ########## ########## ########## # | ||
| 288 | #### Sit es - The b elow 5 sit es were pr ovided ear lier in th e project | ||
| 289 | #### The se sites h ave to be created ou tside the 'developme nt' test d ata sectio n | ||
| 290 | #### as they are v alid sites | ||
| 291 | #### (Th ese sites cannot be moved to t he sites c sv file as they are being used | ||
| 292 | #### (Se e below fo r details on these s ites usage ) | ||
| 293 | ######## ########## ########## ########## ########## ########## ########## ########## # | ||
| 294 | |||
| 295 | print "C reating th e 7 additi onal sites ... " | ||
| 296 | |||
| 297 | site1 = Site.find_ or_create_ by( | ||
| 298 | name: "Chicago M edical Cen ter", | ||
| 299 | addres s: "1111 S ilver Aven ue", | ||
| 300 | city: "Chicago", | ||
| 301 | state: "IL", | ||
| 302 | zip_co de: "60611 ", | ||
| 303 | countr y: "USA") | ||
| 304 | |||
| 305 | site2 = Site.find_ or_create_ by( | ||
| 306 | name: "Dallas VA Clinic", | ||
| 307 | addres s: "2222 R ush Avenue ", | ||
| 308 | city: "Dallas", | ||
| 309 | state: "TX", | ||
| 310 | zip_co de: "75418 ", | ||
| 311 | countr y: "USA") | ||
| 312 | |||
| 313 | site3 = Site.find_ or_create_ by( | ||
| 314 | name: "QTC", | ||
| 315 | site_s tation_num ber: "QTC VBA Vendor ", | ||
| 316 | addres s: "21700 Copley Dr. , Ste 200" , | ||
| 317 | city: "Diamond B ar", | ||
| 318 | state: "CA", | ||
| 319 | zip_co de: "91765 -2219", | ||
| 320 | countr y: "USA") | ||
| 321 | |||
| 322 | site4 = Site.find_ or_create_ by( | ||
| 323 | name: "VES", | ||
| 324 | site_s tation_num ber: "VES VBA Vendor ", | ||
| 325 | addres s: "2707 N orth Loop W., Suite 1000", | ||
| 326 | city: "Houston", | ||
| 327 | state: "TX", | ||
| 328 | zip_co de: "77008 ", | ||
| 329 | countr y: "USA") | ||
| 330 | |||
| 331 | site5 = Site.find_ or_create_ by( | ||
| 332 | name: "VetFed", | ||
| 333 | site_s tation_num ber: "VetF ed VBA Ven dor", | ||
| 334 | addres s: "21700 Copley Dr. , Ste 200" , | ||
| 335 | city: "Diamond B ar", | ||
| 336 | state: "CA", | ||
| 337 | zip_co de: "91765 -2219", | ||
| 338 | countr y: "USA") | ||
| 339 | |||
| 340 | site6 = Site.find_ or_create_ by( | ||
| 341 | name: "Atlanta V A Medical Center", | ||
| 342 | site_s tation_num ber: "508" , | ||
| 343 | addres s: "1670 C lairmont R oad", | ||
| 344 | city: "Decatur", | ||
| 345 | state: "GA", | ||
| 346 | zip_co de: "30033 ", | ||
| 347 | countr y: "USA") | ||
| 348 | |||
| 349 | site7 = Site.find_ or_create_ by( | ||
| 350 | name: "CSRA ITC" , | ||
| 351 | site_s tation_num ber: "777" , | ||
| 352 | addres s: "6300 T exas Ave." , | ||
| 353 | city: "Bossier C ity", | ||
| 354 | state: "LA", | ||
| 355 | zip_co de: "71111 ", | ||
| 356 | countr y: "USA") | ||
| 357 | |||
| 358 | site_man chester_va = Site.fi nd_by_site _station_n umber("608 ") | ||
| 359 | |||
| 360 | # Resets private k ey sequenc es on data base table s | ||
| 361 | ActiveRe cord::Base .connectio n.tables.e ach do |t| | ||
| 362 | Active Record::Ba se.connect ion.reset_ pk_sequenc e!(t) | ||
| 363 | end | ||
| 364 | |||
| 365 | puts "do ne" | ||
| 366 | ########## ########## ########## ########## ########## ####### | ||
| 367 | ## make up some test data for developmen t | ||
| 368 | |||
| 369 | if Rails.e nv.develop ment? && DBRESET | ||
| 370 | |||
| 371 | puts "\n Loading de velopment test data. " | ||
| 372 | |||
| 373 | # CPP-sp ecific tes t users | ||
| 374 | cheryl_h oward_npis = Seeder: :CHERYL_HO WARD_NPIS. dup | ||
| 375 | |||
| 376 | ######## ########## ########## ########## ########## ######### | ||
| 377 | ## defin e test fac ilities an d provider s | ||
| 378 | |||
| 379 | unless C PP_DISABLE D # Turn off CPP fe atures pri or to depr ecating co de | ||
| 380 | unless seed_from _sql( "Fac ility", "P rovider", "MedicalSp ecialty", "MedicalSp ecialtiesP rovider",r eset_only: true ) | ||
| 381 | puts "\n... Fa cilities t able." | ||
| 382 | |||
| 383 | 50.t imes do |f acility_nu mber| | ||
| 384 | fa cility_rec ord = Seed er::Facili tySeed.new (facility_ number) | ||
| 385 | end | ||
| 386 | |||
| 387 | puts "\n... Pr ovider tab le and Med ical Speci alty table from NPI Registry w ith zip co des ..." | ||
| 388 | |||
| 389 | # NO TE: loadin g the cher yl howard NPI record s | ||
| 390 | # into t he provide rs table. | ||
| 391 | cher yl_howard_ npis.each do |npi| | ||
| 392 | Np iRegistry. filter(npi : npi) | ||
| 393 | end | ||
| 394 | |||
| 395 | zipc odes = %w[ 20002 2323 3 71111 73 501] | ||
| 396 | |||
| 397 | zipc odes.each do |postal _code| | ||
| 398 | pr intf "%s " , postal_c ode | ||
| 399 | Np iRegistry. filter(pos tal_code: postal_cod e) | ||
| 400 | end | ||
| 401 | |||
| 402 | puts "done" | ||
| 403 | end | ||
| 404 | end # un less CPP_D ISABLED | ||
| 405 | |||
| 406 | ######## ########## ########## ########## ########## ######### | ||
| 407 | ## defin e test use rs | ||
| 408 | |||
| 409 | puts ".. . User tab le." | ||
| 410 | |||
| 411 | medical_ assistant = User.cre ate( | ||
| 412 | email: "team@adh octeam.us" , | ||
| 413 | passwo rd: "Sms!1 23456789", | ||
| 414 | first_ name: "Med ical", | ||
| 415 | last_n ame: "Assi stant", | ||
| 416 | author ization_st ate: 'auth orized', | ||
| 417 | roles: ['medical _assistant ']) unless User.exis ts?(email: "team@adh octeam.us" ) | ||
| 418 | |||
| 419 | supervis or = User. create( | ||
| 420 | email: "supervis or@adhocte am.us", | ||
| 421 | passwo rd: "Sms!1 23456789", | ||
| 422 | first_ name: "Sup er", | ||
| 423 | last_n ame: "Viso r", | ||
| 424 | author ization_st ate: 'auth orized', | ||
| 425 | roles: ['supervi sor']) unl ess User.e xists?(ema il: "super visor@adho cteam.us") | ||
| 426 | |||
| 427 | examiner = User.cr eate( | ||
| 428 | email: "examiner @adhocteam .us", | ||
| 429 | passwo rd: "Sms!1 23456789", | ||
| 430 | first_ name: "Exa m", | ||
| 431 | last_n ame: "Iner ", | ||
| 432 | author ization_st ate: 'auth orized', | ||
| 433 | roles: ["examine r"]) unles s User.exi sts?(email : "") | ||
| 434 | |||
| 435 | app_admi n = User.c reate( | ||
| 436 | email: "samantha @smith.com ", | ||
| 437 | passwo rd: "Sms!1 23456789", | ||
| 438 | author ization_st ate: "auth orized", | ||
| 439 | first_ name: "Sam antha", | ||
| 440 | last_n ame: "Smit h", | ||
| 441 | # FIXM E: at the end of CPP sprint 15 these two lines wer e removed | ||
| 442 | # from th e integrat ion branch . So if t hey are tr uly not ne eded, | ||
| 443 | # come ba ck here an d delete t his dead c ode in a f uture spri nt. | ||
| 444 | # auth orization_ state: 'au thorized', | ||
| 445 | roles: ["app_adm in"]) unle ss User.ex ists?(emai l: "samant ha@smith.c om") | ||
| 446 | |||
| 447 | site_use r1 = User. create( | ||
| 448 | email: "mike@wal lace.com", | ||
| 449 | passwo rd: "Sms!1 23456789", | ||
| 450 | author ization_st ate: "auth orized", | ||
| 451 | first_ name: "Mik e", | ||
| 452 | last_n ame: "Wall ace") unle ss User.ex ists?(emai l: "mike@w allace.com ") | ||
| 453 | |||
| 454 | site_use r2 = User. create( | ||
| 455 | email: "eric@wil son.com", | ||
| 456 | passwo rd: "Sms!1 23456789", | ||
| 457 | author ization_st ate: "auth orized", | ||
| 458 | first_ name: "Eri c", | ||
| 459 | last_n ame: "Wils on") unles s User.exi sts?(email : "eric@wi lson.com") | ||
| 460 | |||
| 461 | all_role s_QTC_user = User.cr eate( | ||
| 462 | email: "all@qtc. com", | ||
| 463 | passwo rd: "Sms!1 23456789", | ||
| 464 | author ization_st ate: "auth orized", | ||
| 465 | first_ name: "All ", | ||
| 466 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " all@qtc.co m") | ||
| 467 | |||
| 468 | admin_QT C_user = U ser.create ( | ||
| 469 | email: "admin@qt c.com", | ||
| 470 | passwo rd: "Sms!1 23456789", | ||
| 471 | author ization_st ate: "auth orized", | ||
| 472 | first_ name: "Adm in", | ||
| 473 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " admin@qtc. com") | ||
| 474 | |||
| 475 | triage_Q TC_user = User.creat e( | ||
| 476 | email: "triage@q tc.com", | ||
| 477 | passwo rd: "Sms!1 23456789", | ||
| 478 | author ization_st ate: "auth orized", | ||
| 479 | first_ name: "Tri age", | ||
| 480 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " triage@qtc .com") | ||
| 481 | |||
| 482 | scheduli ng_QTC_use r = User.c reate( | ||
| 483 | email: "scheduli ng@qtc.com ", | ||
| 484 | passwo rd: "Sms!1 23456789", | ||
| 485 | author ization_st ate: "auth orized", | ||
| 486 | first_ name: "Sch eduling", | ||
| 487 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " scheduling @qtc.com") | ||
| 488 | |||
| 489 | clinicia n_QTC_user = User.cr eate( | ||
| 490 | email: "clinicia n@qtc.com" , | ||
| 491 | passwo rd: "Sms!1 23456789", | ||
| 492 | author ization_st ate: "auth orized", | ||
| 493 | first_ name: "Cli nician", | ||
| 494 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " clinician@ qtc.com") | ||
| 495 | |||
| 496 | sclinici an_QTC_use r = User.c reate( | ||
| 497 | email: "super_cl inician@qt c.com", | ||
| 498 | passwo rd: "Sms!1 23456789", | ||
| 499 | author ization_st ate: "auth orized", | ||
| 500 | first_ name: "Sup er", | ||
| 501 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " super_clin ician@qtc. com") | ||
| 502 | |||
| 503 | qa_QTC_u ser = User .create( | ||
| 504 | email: "qa@qtc.c om", | ||
| 505 | passwo rd: "Sms!1 23456789", | ||
| 506 | author ization_st ate: "auth orized", | ||
| 507 | first_ name: "Qa" , | ||
| 508 | last_n ame: "Qtc" ) unless U ser.exists ?(email: " qa@qtc.com ") | ||
| 509 | |||
| 510 | unless C PP_DISABLE D | ||
| 511 | vha_cc = User.cr eate( | ||
| 512 | emai l: "vha_cc @example.c om", | ||
| 513 | pass word: "Sms !123456789 ", | ||
| 514 | firs t_name: "V HA CC", | ||
| 515 | last _name: "Te stUser", | ||
| 516 | auth orization_ state: 'au thorized', | ||
| 517 | role s: ["vha_c c"]) unles s User.exi sts?(email : "vha_cc@ example.co m") | ||
| 518 | |||
| 519 | non_vh a = User.c reate( | ||
| 520 | emai l: "non_vh a@example. com", | ||
| 521 | pass word: "Sms !123456789 ", | ||
| 522 | firs t_name: "N on VHA", | ||
| 523 | last _name: "Te stUser", | ||
| 524 | auth orization_ state: 'au thorized', | ||
| 525 | npi: cheryl_ho ward_npis. pop(5), | ||
| 526 | role s: ["non_v ha"]) unle ss User.ex ists?(emai l: "non_vh a@example. com") | ||
| 527 | |||
| 528 | vha_cc 2 = User.c reate( | ||
| 529 | emai l: "vhacc. cpptestuse r@gmail.co m", | ||
| 530 | pass word: "Sms !123456789 ", | ||
| 531 | firs t_name: "V HA CC2", | ||
| 532 | last _name: "Te stUser", | ||
| 533 | auth orization_ state: 'au thorized', | ||
| 534 | role s: ["app_a dmin","vha _cc"]) unl ess User.e xists?(ema il: "vhacc .cpptestus er@gmail.c om") | ||
| 535 | |||
| 536 | non_vh a2 = User. create( | ||
| 537 | emai l: "nonvha .cpptestus er@gmail.c om", | ||
| 538 | pass word: "Sms !123456789 ", | ||
| 539 | firs t_name: "N on VHA2", | ||
| 540 | last _name: "Te stUser", | ||
| 541 | auth orization_ state: 'au thorized', | ||
| 542 | npi: cheryl_ho ward_npis. pop(5), | ||
| 543 | role s: ["non_v ha"]) unle ss User.ex ists?(emai l: "nonvha .cpptestus er@gmail.c om") | ||
| 544 | end # un less CPP_D ISABLED | ||
| 545 | |||
| 546 | |||
| 547 | # add em pty UserPr eference o bject to e ach user, with time zone | ||
| 548 | # corres ponding to index | ||
| 549 | US_TIME_ ZONES = Ac tiveSuppor t::TimeZon e.us_zones .map &:nam e | ||
| 550 | User.all .each_with _index do |user, ind ex| | ||
| 551 | time_z one_string = US_ TIME_ZONES [index % U S_TIME_ZON ES.count] | ||
| 552 | user.u ser_prefer ence = Use rPreferenc e.new(time _zone: tim e_zone_str ing) | ||
| 553 | if use r.is_vha_c c? | ||
| 554 | user .user_pref erence.vis ta_duz = 'mLb+ ZHYXCWt7R9 WvfFhWHBwd OKeT5ZsuZJ OmjLIU8ko= ' | ||
| 555 | user .user_pref erence.vis ta_user_na me = 'WASH ,PAUL E' | ||
| 556 | user .user_pref erence.vis ta_site_id = '516' | ||
| 557 | user .user_pref erence.sav e(validati on: false) | ||
| 558 | end | ||
| 559 | user.s ave(valida tion: fals e) | ||
| 560 | end | ||
| 561 | |||
| 562 | |||
| 563 | ######## ########## ########## ########## ########## ######### | ||
| 564 | ## Updat ing test u ser's site and roles | ||
| 565 | |||
| 566 | puts ".. . Adding s ite and si te roles t o CUI-user s." | ||
| 567 | |||
| 568 | app_admi n.present? ? (app_ad min.add_si te(site3); app_admin .get_site_ roles(site 3).update( admin: tru e, triage: true, sch eduling: t rue, clini cian: true , super_cl inician: t rue, qa: t rue)) : fa lse | ||
| 569 | app_admi n.present? ? (app_ad min.add_si te(site6); app_admin .get_site_ roles(site 6).update( admin: tru e, triage: true, sch eduling: t rue, clini cian: true , super_cl inician: t rue, qa: t rue)) : fa lse | ||
| 570 | app_admi n.present? ? (app_ad min.add_si te(site_ma nchester_v a); app_ad min.get_si te_roles(s ite_manche ster_va).u pdate(admi n: true, t riage: tru e, schedul ing: true, clinician : true, su per_clinic ian: true, qa: true) ) : false | ||
| 571 | site_use r1.present ? ? (site_ user1.add_ site(site3 ); site_us er1.get_si te_roles(s ite3).upda te(admin: true, tria ge: true, scheduling : true, cl inician: t rue, super _clinician : true, qa : true)) : false | ||
| 572 | site_use r2.present ? ? (site_ user2.add_ site(site3 ); site_us er2.get_si te_roles(s ite3).upda te(admin: true, tria ge: true, scheduling : true, cl inician: t rue, super _clinician : true, qa : true)) : false | ||
| 573 | all_role s_QTC_user .present? ? (all_rol es_QTC_use r.add_site (site3); a ll_roles_Q TC_user.ge t_site_rol es(site3). update(adm in: true, triage: tr ue, schedu ling: true , clinicia n: true, s uper_clini cian: true , qa: true )) : false | ||
| 574 | admin_QT C_user.pre sent? ? (a dmin_QTC_u ser.add_si te(site3); admin_QTC _user.get_ site_roles (site3).up date(admin : true)) : false | ||
| 575 | triage_Q TC_user.pr esent? ? ( triage_QTC _user.add_ site(site3 ); triage_ QTC_user.g et_site_ro les(site3) .update(tr iage: true )) : false | ||
| 576 | scheduli ng_QTC_use r.present? ? (schedu ling_QTC_u ser.add_si te(site3); schedulin g_QTC_user .get_site_ roles(site 3).update( scheduling : true)) : false | ||
| 577 | clinicia n_QTC_user .present? ? (clinici an_QTC_use r.add_site (site3); c linician_Q TC_user.ge t_site_rol es(site3). update(cli nician: tr ue)) : fal se | ||
| 578 | sclinici an_QTC_use r.present? ? (sclini cian_QTC_u ser.add_si te(site3); sclinicia n_QTC_user .get_site_ roles(site 3).update( super_clin ician: tru e)) : fals e | ||
| 579 | qa_QTC_u ser.presen t? ? (qa_Q TC_user.ad d_site(sit e3); qa_QT C_user.get _site_role s(site3).u pdate(qa: true)) : f alse | ||
| 580 | |||
| 581 | |||
| 582 | ######## ########## ########## ########## ########## ######### | ||
| 583 | ## Addin g the Eval uation spe cs | ||
| 584 | |||
| 585 | puts ".. . Evaluati onSpec tab le." | ||
| 586 | |||
| 587 | ######## ########## ########## ########## ########## ######### | ||
| 588 | ## Seed the Evalua tion Specs | ||
| 589 | |||
| 590 | seed_spe cs_log = F ile.open(L OG_DIR+'se ed_specs.l og','w') | ||
| 591 | |||
| 592 | print ". .. Executi ng Evaluat ionSpec.sy nc_specs . .. " | ||
| 593 | Evaluati onSpec.syn c_specs(ni l, "app/ex ams/*.yml" , seed_spe cs_log) | ||
| 594 | puts "do ne" | ||
| 595 | |||
| 596 | seed_spe cs_log.clo se | ||
| 597 | |||
| 598 | ######## ########## ########## ########## ########## ########## | ||
| 599 | ## Send exam reque sts to CUI | ||
| 600 | |||
| 601 | puts ".. . Seeding exam reque sts in CUI " | ||
| 602 | |||
| 603 | seed_fro m_sql( | ||
| 604 | "Claim ", | ||
| 605 | "ExamR equest", | ||
| 606 | "Conte ntion", | ||
| 607 | "Conte ntionDetai l", | ||
| 608 | "Conte ntionsDbqI nformation ", | ||
| 609 | "Conte ntionObjec t", | ||
| 610 | "Reque stObject", | ||
| 611 | reset_ only: true | ||
| 612 | ) | ||
| 613 | |||
| 614 | puts "Do ne" | ||
| 615 | |||
| 616 | unless C PP_DISABLE D # Turn off CPP fe atures pri or to depr ecating co de | ||
| 617 | |||
| 618 | ###### ########## ########## ########## ########## ########## # | ||
| 619 | ## def ine test V eteran, co nsultation , referral | ||
| 620 | ## TOD O: add tes t data for the sub-r eferral ta bles | ||
| 621 | |||
| 622 | |||
| 623 | puts " \n... Vete ran, Consu ltation, R eferral ta bles." | ||
| 624 | |||
| 625 | RANDOM IZED_VETER AN_COUNT = 10 | ||
| 626 | |||
| 627 | # PP-4 96: adding more test veterans named afte r famous U .S. Genera ls who die d in WWII | ||
| 628 | PII | ||
| 629 | |||
| 630 | TOTAL_ VETERAN_CO UNT = (RAN DOMIZED_VE TERAN_COUN T + US_GEN ERALS.coun t) | ||
| 631 | |||
| 632 | RANDOM IZED_VETER AN_COUNT.t imes do |v eteran_num ber| | ||
| 633 | |||
| 634 | puts "Fake Vet eran #{vet eran_numbe r+1} of #{ RANDOMIZED _VETERAN_C OUNT}." | ||
| 635 | |||
| 636 | vete ran_record = Seeder ::VeteranS eed.new(ve teran_numb er).vetera n | ||
| 637 | vete ran_id = vetera n_record.i d | ||
| 638 | Refe rral.skip_ callbacks = true | ||
| 639 | 5.ti mes do |co nsultation _number| | ||
| 640 | co nsultation _record = Seeder::Co nsultation Seed.new(v eteran_rec ord, consu ltation_nu mber).cons ultation | ||
| 641 | co nsultation _id = consultati on_record. id | ||
| 642 | |||
| 643 | |||
| 644 | 20 .times do |referral_ number| | ||
| 645 | referral_s eed_record = Seeder ::Referral Seed.new(v eteran_id, consultat ion_id, re ferral_num ber) | ||
| 646 | referral_i d = referr al_seed_re cord.refer ral.id | ||
| 647 | |||
| 648 | 2.times do |referral _note_numb er| | ||
| 649 | Seeder:: ReferralNo teSeed.new (veteran_i d, consult ation_id, referral_i d, referra l_note_num ber) | ||
| 650 | end | ||
| 651 | |||
| 652 | 2.times do |referral _appointme nt_number| | ||
| 653 | Seeder:: ReferralAp pointmentS eed.new(ve teran_id, consultati on_id, ref erral_id, referral_a ppointment _number) | ||
| 654 | end | ||
| 655 | |||
| 656 | 2.times do |referral _approval_ number| | ||
| 657 | Seeder:: ReferralAp provalSeed .new(veter an_id, con sultation_ id, referr al_id, ref erral_appr oval_numbe r) | ||
| 658 | end | ||
| 659 | |||
| 660 | 2.times do |referral _document_ number| | ||
| 661 | Seeder:: ReferralDo cumentSeed .new(veter an_id, con sultation_ id, referr al_id, ref erral_docu ment_numbe r) | ||
| 662 | end | ||
| 663 | |||
| 664 | en d # 20.tim es do |ref erral_numb er| | ||
| 665 | end # 5.times do |consul tation_num ber| | ||
| 666 | end # RANDOMIZED _VETERAN_C OUNT.times do |veter an_number| | ||
| 667 | Referr al.skip_ca llbacks = false | ||
| 668 | |||
| 669 | print "Adding Wo rld War II heroes wi th fake SS Ns ... " | ||
| 670 | US_GEN ERALS.each _with_inde x do |us_g eneral_dat a, usg_ind ex| | ||
| 671 | vet_ number = R ANDOMIZED_ VETERAN_CO UNT + usg_ index + 1 | ||
| 672 | Seed er::Vetera nSeed.new( (vet_numbe r), us_gen eral_data) | ||
| 673 | end | ||
| 674 | |||
| 675 | puts " Done." | ||
| 676 | |||
| 677 | # Addi ng custome r test acc ounts for CPP. | ||
| 678 | |||
| 679 | print "Adding cu stomer tes t accounts ..." | ||
| 680 | custom er_test_ac counts = % w[ | ||
| 681 | PII | ||
| 682 | PII | ||
| 683 | PII | ||
| 684 | ].each do |email | | ||
| 685 | name = email.s plit('@'). first.spli t('.') | ||
| 686 | User .create( | ||
| 687 | emai l: em ail, | ||
| 688 | pass word: "S ms!1234567 89", | ||
| 689 | firs t_name: na me.first, | ||
| 690 | last _name: na me.last, | ||
| 691 | auth orization_ state: 'a uthorized' , | ||
| 692 | role s: [" vha_cc"]) unless Use r.exists?( email: ema il) | ||
| 693 | end | ||
| 694 | |||
| 695 | puts"D one." | ||
| 696 | end # un less CPP_D ISABLED | ||
| 697 | end # if R ails.env = = "develop ment" |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.