-
Notifications
You must be signed in to change notification settings - Fork 1
/
PostImportSetupScript.py.in
805 lines (762 loc) · 22.8 KB
/
PostImportSetupScript.py.in
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
#---------------------------------------------------------------------------
# Copyright 2011 The Open Source Electronic Health Record Agent
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#---------------------------------------------------------------------------
import sys
import time
sys.path = ['${VISTA_SOURCE_DIR}/lib/vista'] + sys.path
from OSEHRAHelper import ConnectToMUMPS,PROMPT
VistA=ConnectToMUMPS("${VISTA_BINARY_DIR}/Testing/Log/PostImport1.log","${INSTANCE}","${NAMESPACE}")
if ('${USERNAME}' and '${PASSWORD}'):
VistA.login('${USERNAME}','${PASSWORD}')
if VistA.type=='cache':
try:
VistA.ZN('${NAMESPACE}')
except IndexError,no_namechange:
pass
VistA.wait(PROMPT,60)
#---------------------------------------------------------------------
#- SECTION TO SETUP DEMO VistA SITE -
#---------------------------------------------------------------------
#Initialze FileMan
VistA.write('D ^DINIT')
VistA.wait('Initialize VA FileMan now?')
VistA.write('Yes')
VistA.wait('SITE NAME:')
VistA.write('${VISTA_SITE_NAME}')
VistA.wait('SITE NUMBER')
VistA.write('6161')
VistA.wait('Do you want to change the MUMPS OPERATING SYSTEM File?')
VistA.write('Yes')
VistA.wait('TYPE OF MUMPS SYSTEM YOU ARE USING')
if VistA.type=='cache':
VistA.write('CACHE')
else:
VistA.write('GT.M(UNIX)')
VistA.wait(PROMPT,60)
#Setup the ZU Routine
VistA.write('D ^ZUSET')
VistA.wait('Rename')
VistA.write('Yes')
VistA.wait(PROMPT,60)
VistA.write('S DUZ=1 D Q^DI')
#Ensure that the null device is correctly configured.
VistA.wait('Select OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('DEVICE')
VistA.wait('EDIT WHICH FIELD')
VistA.write('$I\rSIGN-ON/SYSTEM DEVICE\r')
VistA.wait('NAME:')
VistA.write('NULL\r1')
VistA.wait('//')
if sys.platform=='win32':
VistA.write('//./nul\rNO\r')
else:
VistA.write('/dev/null\rNO\r')
#Create and Christen the New Domain
VistA.wait('Select OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('DOMAIN\r')
VistA.wait('Select DOMAIN NAME')
VistA.write('${VISTA_SITE_NAME}\rY\r^\r\r')
VistA.wait(PROMPT,60)
VistA.write('D CHRISTEN^XMUDCHR')
VistA.wait('Are you sure you want to change the name of this facility?')
VistA.write('Yes')
VistA.wait('Select DOMAIN NAME')
VistA.write('${VISTA_SITE_NAME}')
VistA.wait('PARENT')
VistA.write('')
VistA.wait('TIME ZONE')
VistA.write(time.strftime('%Z').replace(' Time',''))
index = VistA.multiwait([VistA.prompt,'TIME ZONE'])
if index==1:
VistA.write('EST')
VistA.wait(PROMPT,60)
VistA.IEN('DOMAIN','${VISTA_SITE_NAME}')
VistA.wait(PROMPT,60)
VistA.write('S $P(^XWB(8994.1,1,0),"^")=' + VistA.IENumber)
VistA.write('S $P(^XTV(8989.3,1,0),"^")=' + VistA.IENumber)
VistA.getenv('${VOLUME_SET}')
VistA.wait(PROMPT,60)
VistA.write('S DUZ=1 D Q^DI')
VistA.wait('Select OPTION')
VistA.write('UTILITY')
VistA.wait('UTILITY OPTION')
VistA.write('RE')
VistA.wait('MODIFY WHAT FILE')
VistA.write('8989.3\rNO\rY\rY')
VistA.wait('UTILITY OPTION')
VistA.write('RE')
VistA.wait('MODIFY WHAT FILE')
VistA.write('8994.1\rNO\rY\rY\r')
VistA.wait('Select OPTION')
# Set up the proper Box:Volume pair
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('14.5\r')
VistA.wait('Select VOLUME SET')
VistA.write('`1')
VistA.wait('VOLUME SET:')
VistA.write('${VOLUME_SET}\r\r\r\r\r')
VistA.wait('TASKMAN FILES UCI')
if VistA.type=='cache':
VistA.write('${NAMESPACE}\r\r\r\r\r\r')
else:
VistA.write('${VOLUME_SET}\r\r\r\r\r\r')
VistA.wait('Select OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('14.7')
VistA.wait('ALL//')
VistA.write('')
VistA.wait('Select TASKMAN SITE PARAMETERS BOX-VOLUME PAIR:')
VistA.write('`1')
VistA.wait('//')
VistA.write(VistA.boxvol)
VistA.wait('RESERVED')
VistA.write('^\r')
VistA.wait('Select OPTION')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('8994.1\r')
VistA.wait('Select RPC BROKER SITE PARAMETERS DOMAIN NAME')
VistA.write('${VISTA_SITE_NAME}\r\r\r\r' + VistA.boxvol + '\rY\r\r9210\rY')
if VistA.type=='cache':
VistA.write('1\r\r1\r')
else:
VistA.write('1\r\r\r')
VistA.wait('Select OPTION')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('KERNEL SYSTEM PARAMETERS\rVOLUME SET\r\r')
VistA.wait('Select KERNEL SYSTEM PARAMETERS DOMAIN NAME:')
VistA.write('${VISTA_SITE_NAME}\r\r${VOLUME_SET}\rY\r500\rN\r\r\r')
# Start TaskMan
VistA.wait(PROMPT,60)
VistA.write('K')
VistA.wait(PROMPT,60)
VistA.write('D ^ZTMB')
VistA.wait(PROMPT,60)
VistA.write('D STRT^XWBTCP(9210)')
#Create the System Manager
VistA.wait(PROMPT,60)
VistA.write('S DUZ=1 D ^XUP')
VistA.wait('Select OPTION NAME')
VistA.write('EVE\r1')
VistA.wait('Select Systems Manager Menu Option:')
VistA.write('USER MANAGEMENT')
VistA.wait('Select User Management Option:')
VistA.write('ADD')
VistA.wait(':')
VistA.write('MANAGER,SYSTEM')
VistA.wait('No//')
VistA.write('Y')
VistA.wait('INITIAL:')
VistA.write('SM')
VistA.wait('SSN:')
VistA.write('000000001')
VistA.wait('SEX:')
VistA.write('M')
VistA.wait('NPI')
VistA.write('')
#TODO: Give XUPROGMODE key
VistA.wait('NAME COMPONENTS')
VistA.write('\r\r\r\r\r^PRIMARY MENU OPTION\rEVE\r1\r^Want to edit ACCESS CODE\rY\rSM1234\rSM1234\r^Want to edit VERIFY CODE\rY\rSM1234!!\rSM1234!!\r^SECONDARY MENU OPTIONS\rOR PARAM COORDINATOR MENU\rY\r\r\r\rTIU IRM MAINTENANCE MENU\rY\r\r\r\rXPAR MENU TOOLS\rY\r\r\r\rDG REGISTER PATIENT\rY\r\r\r\r^MULTIPLE SIGN-ON\r1\r1\r99\r^SERVICE/SECTION\rIRM\r^\rY')
VistA.wait('User Account Access Letter')
VistA.write('NO')
VistA.wait('wish to allocate security keys?')
VistA.write('Y')
VistA.wait('Allocate key')
VistA.write('XUMGR')
VistA.wait('Another key')
VistA.write('XUPROG\r1')
VistA.wait('Another key')
VistA.write('SD SUPERVISOR')
VistA.wait('Another key')
VistA.write('SDWL PARAMETER')
VistA.wait('Another key')
VistA.write('SDWL MENU')
VistA.wait('Another key')
VistA.write('')
VistA.wait('Another holder')
VistA.write('')
VistA.wait('YES//')
VistA.write('')
VistA.wait('mail groups?')
VistA.write('\r')
VistA.wait('Option')
# Set the Listener Starter to run when TaskMan is started
if VistA.type=='cache':
VistA.write('TASK')
VistA.wait('Option:')
VistA.write('SCHED')
VistA.wait('reschedule:')
VistA.write('XWB LISTENER STARTER\rY')
VistA.wait('COMMAND:')
VistA.write('\r^SPECIAL QUEUEING\rSTARTUP\rS\rE\r\r\r\r')
else:
VistA.write('\rY')
VistA.wait(PROMPT,60)
VistA.IEN('NEW PERSON','MANAGER,SYSTEM')
VistA.wait(PROMPT,60)
VistA.write('S DUZ=' + VistA.IENumber + ' S $P(^VA(200,DUZ,0),"^",4)="@"')
#Open FileMan and start by creating the VistA Health Care institution
VistA.wait(PROMPT,60)
VistA.write('S DUZ=1 S XUMF=1 D Q^DI')
VistA.wait('OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE:')
VistA.write('4')
VistA.wait('EDIT WHICH FIELD')
VistA.write('STATION NUMBER')
VistA.wait('THEN EDIT FIELD')
VistA.write('')
VistA.wait('Select INSTITUTION NAME:')
VistA.write('VISTA HEALTH CARE')
VistA.wait('Are you adding')
VistA.write('Y')
VistA.wait('STATION NUMBER:')
VistA.write('6100')
VistA.wait('Select INSTITUTION NAME:')
VistA.write('')
#Next create the Medical Center Division of the VistA Health Care institution
VistA.wait('Select OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE:')
VistA.write('40.8')
VistA.wait('EDIT WHICH FIELD')
VistA.write('FACILITY NUMBER')
VistA.wait('THEN EDIT FIELD')
VistA.write('INSTITUTION FILE POINTER')
VistA.wait('THEN EDIT FIELD')
VistA.write('')
VistA.wait('DIVISION NAME')
VistA.write('VISTA MEDICAL CENTER')
VistA.wait('Are you adding')
VistA.write('Y')
VistA.wait('MEDICAL CENTER DIVISION NUM:')
VistA.write('')
VistA.wait('FACILITY NUMBER')
VistA.write('6101')
VistA.write('')
VistA.wait('INSTITUTION FILE POINTER')
VistA.write('6100')
VistA.write('\r')
VistA.wait(PROMPT,60)
VistA.write('D Q^DI')
VistA.wait('OPTION')
VistA.write('1')
VistA.write('HOSPITAL LOCATION')
VistA.wait('EDIT WHICH FIELD')
VistA.write('TYPE\r1')
VistA.wait('THEN EDIT FIELD')
VistA.write('ABBREVIATION')
VistA.wait('THEN EDIT FIELD')
VistA.write('Telephone\r')
VistA.wait('Select HOSPITAL LOCATION NAME')
VistA.write('VISTA HEALTH CARE')
VistA.wait('Are you adding')
VistA.write('Y')
VistA.wait('TYPE')
VistA.write('CLINIC\rCLINIC\r')
VistA.wait('ABBREVIATION')
VistA.write('VHC')
VistA.wait('TELEPHONE')
VistA.write('555-555-1414\r')
#Change the accession number of the Chemistry area
VistA.wait('OPTION')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('ACCESSION\r1')
VistA.wait('EDIT WHICH FIELD')
VistA.write('.4\r')
VistA.wait('Select ACCESSION AREA')
VistA.write('CHEMISTRY')
VistA.wait('NUMERIC IDENTIFIER')
VistA.write('CH\r')
#Change the STREPTOZYME test to be accessioned through the chem area and the Vista Health Care institution
VistA.wait('OPTION')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('LABORATORY TEST')
VistA.wait('EDIT WHICH FIELD')
VistA.write('ACCESSION AREA\r\r')
VistA.wait('Select LABORATORY TEST NAME')
VistA.write('STREPTOZYME')
VistA.wait('Select INSTITUTION')
VistA.write('VISTA HEALTH CARE')
VistA.wait('ACCESSION AREA')
VistA.write('CHEMISTRY\r')
#Change the Package Prefix of the ONCE scheudle to be used by the Laboratory
VistA.wait('OPTION')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('ADMINISTRATION SCHEDULE')
VistA.wait('EDIT WHICH FIELD')
VistA.write('PACKAGE PREFIX\r')
VistA.wait('Select ADMINISTRATION SCHEDULE NAME')
VistA.write('ONCE\rLR\r\r')
#Register the Vitals DLL and GUI Versions within the XPAR Menu
VistA.wait(PROMPT,60)
VistA.write('S GMVDLL=\"GMV_VITALSVIEWENTER.DLL:v. 08/11/09 15:00\"')
VistA.wait(PROMPT,60)
VistA.write('D EN^XPAR(\"SYS\",\"GMV DLL VERSION\",GMVDLL,1)')
VistA.wait(PROMPT,60)
VistA.write('S GMVDLL=\"GMV_VITALSVIEWENTER.DLL:v. 01/21/11 12:52\"')
VistA.wait(PROMPT,60)
VistA.write('D EN^XPAR(\"SYS\",\"GMV DLL VERSION\",GMVDLL,1)')
VistA.wait(PROMPT,60)
VistA.write('S GMVGUI=\"VITALSMANAGER.EXE:5.0.26.1\"')
VistA.wait(PROMPT,60)
VistA.write('D EN^XPAR(\"SYS\",\"GMV GUI VERSION\",GMVGUI,1)')
# Sign into the ZU menu as the System,Manager and start the TCP listeneer
VistA.wait(PROMPT,60)
VistA.write('D ^ZU')
VistA.wait('ACCESS CODE:')
VistA.write('SM1234')
VistA.wait('VERIFY CODE:')
VistA.write('SM1234!!')
VistA.wait('verify code:')
VistA.write('SM1234!!')
VistA.wait('VERIFY CODE:')
VistA.write('SM12345!!')
VistA.wait('right:')
VistA.write('SM12345!!')
VistA.wait('TYPE NAME:')
VistA.write('')
#Enter the Doctor Robert Alexander
VistA.write('USER MANAGEMENT')
VistA.wait('Select User Management Option')
VistA.write('ADD')
VistA.wait('name')
VistA.write('ALEXANDER,ROBERT\rY')
VistA.wait('INITIAL:')
VistA.write('RA')
VistA.wait('SSN:')
VistA.write('000000029')
VistA.wait('SEX:')
VistA.write('M')
VistA.wait('NPI')
VistA.write('')
VistA.wait('NAME COMPONENTS')
VistA.write('\r\r\r\r\r^PRIMARY MENU OPTION\rXUCOR\r^SECONDARY MENU OPTIONS\rGMPL MGT MENU\rY\r\r\r\rOR CPRS GUI CHART\rY\r\r\r\rGMV V/M GUI\rY\r\r\r\r^Want to edit ACCESS CODE\rY\rfakedoc1\rfakedoc1\r^Want to edit VERIFY CODE\rY\r2Doc!@#$\r2Doc!@#$\rVISTA HEALTH CARE\rY\r\r\r\r\r^SERVICE/SECTION\rIRM\r^Language\r\r767\rY\rY\rT-1\r\r^RESTRICT PATIENT SELECTION\r0\r\rCOR\rY\rT-1\r\r^MULTIPLE SIGN-ON\r1\r1\r99\r^\rE\rY')
VistA.wait('User Account Access Letter')
VistA.write('NO')
VistA.wait('wish to allocate security keys?')
VistA.write('Y')
VistA.wait('Allocate key')
VistA.write('PROVIDER\r1')
VistA.wait('Another key')
VistA.write('GMV MANAGER')
VistA.wait('Another key')
VistA.write('LRLAB')
VistA.wait('Another key')
VistA.write('LRVERIFY')
VistA.wait('Another key')
VistA.write('ORES')
VistA.wait('Another key')
VistA.write('SD SUPERVISOR')
VistA.wait('Another key')
VistA.write('SDWL PARAMETER')
VistA.wait('Another key')
VistA.write('SDWL MENU')
VistA.wait('Another key')
VistA.write('')
VistA.wait('Another holder')
VistA.write('')
VistA.wait('Do you wish to proceed')
VistA.write('Yes')
VistA.wait('add this user to mail groups')
VistA.write('NO')
#Enter the Nurse Mary Smith
VistA.wait('Select User Management Option')
VistA.write('ADD')
VistA.wait('name')
VistA.write('SMITH,MARY\rY')
VistA.wait('INITIAL:')
VistA.write('MS')
VistA.wait('SSN:')
VistA.write('000000030')
VistA.wait('SEX:')
VistA.write('F')
VistA.wait('NPI')
VistA.write('')
VistA.wait('NAME COMPONENTS')
VistA.write('\r\r\r\r\r^PRIMARY MENU OPTION\rXUCOR\r^SECONDARY MENU OPTIONS\rGMPL MGT MENU\rY\r\r\r\rOR CPRS GUI CHART\rY\r\r\r\rGMV V/M GUI\rY\r\r\r\r^Want to edit ACCESS CODE\rY\rfakenurse1\rfakenurse1\r^Want to edit VERIFY CODE\rY\r2Nur!@#$\r2Nur!@#$\rVISTA HEALTH CARE\rY\r\r\r\r\r^SERVICE/SECTION\rIRM\r^Language\r\r289\rY\rY\rT-1\r\r^RESTRICT PATIENT SELECTION\r0\r\rCOR\rY\rT-1\r\r^MULTIPLE SIGN-ON\r1\r1\r99\r^\rE\rY')
VistA.wait('User Account Access Letter')
VistA.write('NO')
VistA.wait('wish to allocate security keys?')
VistA.write('Y')
VistA.wait('Allocate key')
VistA.write('PROVIDER\r1')
VistA.wait('Another key')
VistA.write('ORELSE\r')
VistA.wait('Another holder')
VistA.write('')
VistA.wait('Do you wish to proceed')
VistA.write('Yes')
VistA.wait('add this user to mail groups')
VistA.write('NO\r')
#Create the first patient named "David Carter Jr')
#TODO: Enter patient as a Clerk, not System Manager
VistA.wait('Menu Option:')
VistA.write('Register a Patient')
VistA.wait('PATIENT NAME')
VistA.write('Carter,David Jr\rY')
VistA.wait('SEX')
VistA.write('M')
VistA.wait('DATE OF BIRTH')
VistA.write('03/02/2001')
VistA.wait('SOCIAL SECURITY NUMBER')
VistA.write('000000112')
VistA.wait('TYPE')
VistA.write('NON-VETERAN')
VistA.wait('PATIENT VETERAN')
VistA.write('NO')
VistA.wait('SERVICE CONNECTED')
VistA.write('NO')
VistA.wait('MULTIPLE BIRTH INDICATOR')
VistA.write('')
VistA.wait('//')
VistA.write('^\r')
VistA.wait('MAIDEN NAME:')
VistA.write('')
VistA.wait('[CITY]')
VistA.write('Santa Monica')
VistA.wait('[STATE]')
VistA.write('California')
VistA.wait('ALIAS')
VistA.write('')
if VistA.type=='cache':
# Enter in more information about the patient.
VistA.wait('exit:')
VistA.write('\r')
VistA.wait('Patient Data')
VistA.write('Y')
VistA.wait('QUIT')
VistA.write('4')
VistA.wait('COUNTRY')
VistA.write('')
VistA.wait('STREET ADDRESS')
VistA.write('834 Ocean Vista Avenue\r')
VistA.wait('ZIP')
VistA.write('90401')
VistA.wait('CITY')
VistA.write('1')
VistA.wait('PHONE NUMBER')
VistA.write('310-555-2233\r\r')
VistA.wait('changes')
VistA.write('Y\r')
VistA.wait('QUIT')
VistA.write('\r\r')
VistA.wait('QUIT')
VistA.write('1')
VistA.wait('PRIMARY NOK')
VistA.write('Carter,David J Sr')
VistA.wait('RELATIONSHIP')
VistA.write('FATHER')
VistA.wait('ADDRESS')
VistA.write('Y')
VistA.wait('WORK PHONE')
VistA.write('310-555-9876\r^')
VistA.wait('condition')
VistA.write('N')
VistA.wait('today')
VistA.write('Y\r')
else:
# Workaround to reconnect after GT.M crash
'''
Fileman-based Joe Clerk User Setup
-- Workaround: Can't use Select User Management Option at this point as it causes unexpected exit from menu
'''
VistA=ConnectToMUMPS("${VISTA_BINARY_DIR}/Testing/Log/PostImport1A.log","${INSTANCE}","${NAMESPACE}")
VistA.wait(PROMPT,60)
VistA.write('S DUZ=1 D Q^DI')
VistA.wait('Select OPTION:')
VistA.write('1')
VistA.wait('INPUT TO WHAT FILE')
VistA.write('200')
VistA.wait('EDIT WHICH FIELD')
VistA.write('PRIMARY MENU OPTION')
VistA.wait('THEN EDIT FIELD')
VistA.write('SECONDARY MENU OPTIONS\r')
VistA.wait('THEN EDIT FIELD')
VistA.write('CPRS TAB\r')
VistA.wait('THEN EDIT FIELD')
VistA.write('ACCESS CODE')
VistA.wait('THEN EDIT FIELD')
VistA.write('VERIFY CODE\r1')
VistA.wait('THEN EDIT FIELD')
VistA.write('DIVISION\r')
VistA.wait('THEN EDIT FIELD')
VistA.write('SERVICE/SECTION')
VistA.wait('THEN EDIT FIELD')
VistA.write('MULTIPLE SIGN-ON LIMIT')
VistA.wait('THEN EDIT FIELD')
VistA.write('MULTIPLE SIGN-ON\r1')
VistA.wait('THEN EDIT FIELD')
VistA.write('Language')
VistA.wait('THEN EDIT FIELD')
VistA.write('RESTRICT PATIENT SELECTION')
VistA.wait('THEN EDIT FIELD')
VistA.write('KEYS\r1\r')
VistA.wait('THEN EDIT FIELD')
VistA.write('\r')
VistA.wait('Select NEW PERSON NAME')
VistA.write('Clerk, Joe')
VistA.wait('Are you adding')
VistA.write('YES')
VistA.wait('NEW PERSON INITIAL')
VistA.write('JC\r')
VistA.wait('PRIMARY MENU OPTION')
VistA.write('XUCORE')
VistA.wait('Select SECONDARY MENU OPTIONS:')
VistA.write('GMPL DATA ENTRY\rY\r\r')
VistA.wait('Select CPRS TAB:')
VistA.write('COR\rY\rT\r\r')
VistA.wait('Want to edit ACCESS CODE')
VistA.write('Y')
VistA.wait('Enter a new ACCESS CODE')
VistA.write('fakeclerk1\rfakeclerk1')
VistA.wait('Want to edit VERIFY CODE')
VistA.write('Y')
VistA.wait('Enter a new VERIFY CODE')
VistA.write('2Cle!@#$\r2Cle!@#$')
VistA.wait('Select DIVISION')
VistA.write('VISTA HEALTH CARE\rY\r')
VistA.wait('SERVICE/SECTION:')
VistA.write('IRM')
VistA.wait('MULTIPLE SIGN-ON LIMIT')
VistA.write('99')
VistA.wait('MULTIPLE SIGN-ON')
VistA.write('ALLOWED')
VistA.wait('LANGUAGE')
VistA.write('1')
VistA.wait('RESTRICT PATIENT SELECTION')
VistA.write('NO')
VistA.wait('Select KEY')
VistA.write('ORELSE\r')
VistA.wait('Select KEY')
VistA.write('PROVIDER\r1\r\r')
VistA.wait('Select NEW PERSON NAME')
VistA.write('\r\r\r')
VistA.wait(PROMPT,60)
VistA.write('D ^ZU')
VistA.wait('ACCESS CODE:')
VistA.write('SM1234')
VistA.wait('VERIFY CODE:')
VistA.write('SM12345!!')
VistA.wait('//')
VistA.write('')
#Set Up the Quick Order Menu for the Strep Throat
VistA.wait('Menu Option:')
VistA.write('CPRS Configuration')
VistA.wait('Option:')
VistA.write('MM')
VistA.wait('Option:')
VistA.write('QO')
VistA.wait('Select QUICK ORDER NAME')
VistA.write('LRZ STREP TEST')
VistA.wait('Are you adding')
VistA.write('Y')
VistA.wait('TYPE OF QUICK ORDER')
VistA.write('LAB\r')
VistA.wait('DISPLAY TEXT')
VistA.write('STREP TEST')
VistA.wait('VERIFY ORDER')
VistA.write('Y')
VistA.wait('DESCRIPTION')
VistA.write('N\r')
VistA.wait('Lab Test')
VistA.write('STREP\r2')
VistA.wait('Collected By')
VistA.write('SP')
VistA.wait('Collection Sample')
VistA.write('SWAB\r')
VistA.wait('Collection Date/Time')
VistA.write('TODAY\r')
VistA.wait('How often')
VistA.write('ONCE')
VistA.wait('PLACE//')
VistA.write('\r\r')
VistA.wait('Option')
VistA.write('ST')
VistA.wait('Select ORDER SET NAME')
VistA.write('STREP TEST')
VistA.wait('Are you adding')
VistA.write('Y')
VistA.wait('Do you wish to copy')
VistA.write('No\r')
VistA.wait('DISPLAY TEXT')
VistA.write('Strep Test\r\r\r')
VistA.wait('COMPONENT SEQUENCE')
VistA.write('10\r')
VistA.wait('ITEM:')
VistA.write('LRZ STREP TEST\r\r\r\r')
#Add the Quick order for LRZ Strep to the Orders menu
VistA.wait('Menu Option:')
VistA.write('General Parameter')
VistA.wait('Select General Parameter Tools Option')
VistA.write('EP')
VistA.wait('Select PARAMETER DEFINITION NAME')
VistA.write('ORWOR WRITE ORDERS LIST')
VistA.wait('Enter selection')
VistA.write('3')
VistA.wait('Select Sequence')
VistA.write('10')
VistA.wait('Are you adding')
VistA.write('Y\r')
VistA.wait('Order Dialog')
VistA.write('STREP TEST\r2\r')
VistA.wait('selection:')
VistA.write('\r\r')
VistA.wait('Menu Option:')
VistA.write('CPRS Configuration')
VistA.wait('Option:')
VistA.write('MM')
VistA.wait('Option:')
VistA.write('MN')
VistA.wait('Select ORDER MENU')
VistA.write('OR ADD MENU CLINICIAN')
VistA.write('ADD\rMenu')
VistA.wait('ITEM')
VistA.write('STREP TEST\r2\r20\r1\r\r\r')
VistA.write('Q\r\r')
#Give all users of the instance permission to mark allergies as "Entered in error')
VistA.wait('Menu Option:')
VistA.write('CPRS Configuration')
VistA.wait('Option:')
VistA.write('GUI PARAMETERS')
VistA.wait('Option')
VistA.write('GUI Mark Allergy Entered in Error')
VistA.wait('Enter selection')
VistA.write('4\rY\r\r')
#Give Mary Smith permission to create shared templates
VistA.wait('Menu Option:')
VistA.write('TIU Maintenance')
VistA.wait('Option')
VistA.write('User Class Management')
VistA.wait('Option')
VistA.write('List Membership by User')
VistA.wait('Select USER')
VistA.write('MS\rAdd\rClinical Coordinator\rT-1\r\r\r')
VistA.wait('Option')
VistA.write('\r\r')
VistA.wait('Do you really want to halt?')
VistA.write('Y')
time.sleep(10)
#Set up the Doctors electronic signature
VistA=ConnectToMUMPS("${VISTA_BINARY_DIR}/Testing/Log/PostImportSignature.log","${INSTANCE}","${NAMESPACE}")
if ('${USERNAME}' and '${PASSWORD}'):
VistA.login('${USERNAME}','${PASSWORD}')
if VistA.type=='cache':
try:
VistA.ZN('${NAMESPACE}')
except IndexError,no_namechange:
pass
VistA.wait(PROMPT,60)
VistA.write('D ^ZU')
VistA.wait('ACCESS CODE:')
VistA.write('fakedoc1')
VistA.wait('VERIFY CODE:')
VistA.write('2Doc!@#$')
VistA.wait('verify code:')
VistA.write('2Doc!@#$')
VistA.wait('VERIFY CODE:')
VistA.write('1Doc!@#$')
VistA.wait('right:')
VistA.write('1Doc!@#$')
VistA.wait('TYPE NAME')
VistA.write('')
VistA.wait('Option:')
VistA.write('USER\'s TOOLBOX')
VistA.wait('Toolbox Option')
VistA.write('ELE')
VistA.wait('INITIAL')
VistA.write('')
VistA.wait('SIGNATURE BLOCK PRINTED NAME')
VistA.write('')
VistA.wait('SIGNATURE BLOCK TITLE')
VistA.write('\r\r\r')
VistA.wait('SIGNATURE CODE')
VistA.write('ROBA123')
VistA.wait('SIGNATURE CODE FOR VERIFICATION')
VistA.write('ROBA123')
VistA.wait('Toolbox Option')
VistA.write('\r\r\r')
#Set up the Nurse electronic signature
VistA=ConnectToMUMPS("${VISTA_BINARY_DIR}/Testing/Log/PostImport4.log","${INSTANCE}","${NAMESPACE}")
if ('${USERNAME}' and '${PASSWORD}'):
VistA.login('${USERNAME}','${PASSWORD}')
if VistA.type=='cache':
try:
VistA.ZN('${NAMESPACE}')
except IndexError,no_namechange:
pass
VistA.wait(PROMPT,60)
VistA.write('D ^ZU')
VistA.wait('ACCESS CODE:')
VistA.write('fakenurse1')
VistA.wait('VERIFY CODE:')
VistA.write('2Nur!@#$')
VistA.wait('verify code:')
VistA.write('2Nur!@#$')
VistA.wait('VERIFY CODE:')
VistA.write('1Nur!@#$')
VistA.wait('right:')
VistA.write('1Nur!@#$')
VistA.wait('//')
VistA.write('')
VistA.wait('Option:')
VistA.write('USER\'s TOOLBOX')
VistA.wait('Toolbox Option')
VistA.write('ELE')
VistA.wait('INITIAL')
VistA.write('')
VistA.wait('SIGNATURE BLOCK PRINTED NAME')
VistA.write('')
VistA.wait('SIGNATURE BLOCK TITLE')
VistA.write('\r\r\r')
VistA.wait('SIGNATURE CODE')
VistA.write('MARYS123')
VistA.wait('SIGNATURE CODE FOR VERIFICATION')
VistA.write('MARYS123')
VistA.wait('Toolbox Option')
VistA.write('^\r\r\r\r\r\r')
#Set up the Clerk verification code
VistA=ConnectToMUMPS("${VISTA_BINARY_DIR}/Testing/Log/PostImport5.log","${INSTANCE}","${NAMESPACE}")
if ('${USERNAME}' and '${PASSWORD}'):
VistA.login('${USERNAME}','${PASSWORD}')
if VistA.type=='cache':
try:
VistA.ZN('${NAMESPACE}')
except IndexError,no_namechange:
pass
VistA.wait(PROMPT,60)
VistA.write('D ^ZU')
VistA.wait('ACCESS CODE:')
VistA.write('fakeclerk1')
VistA.wait('VERIFY CODE:')
VistA.write('2Cle!@#$')
VistA.wait('verify code:')
VistA.write('2Cle!@#$')
VistA.wait('VERIFY CODE:')
VistA.write('1Cle!@#$')
VistA.wait('right:')
VistA.write('1Cle!@#$')
VistA.wait('//')
VistA.write('^\r\r\r\r\r\r')