forked from JimmySpivey/ATF-for-Vista-FOIA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XINDEXScript.py
47 lines (45 loc) · 1.15 KB
/
XINDEXScript.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
import sys
sys.path = [sys.argv[7] + '/lib/vista'] + sys.path
from OSEHRAHelper import ConnectToMUMPS,PROMPT
VistA=ConnectToMUMPS(sys.argv[1],sys.argv[3],sys.argv[4])
if (sys.argv[5] and sys.argv[6]):
VistA.login(sys.argv[5],sys.argv[6])
if VistA.type=='cache':
try:
VistA.ZN(sys.argv[4])
except IndexError,no_namechange:
pass
VistA.wait(PROMPT)
VistA.write('K ^XUTL("XQ",$J)')
VistA.write('D ^XINDEX')
if VistA.type == 'cache':
VistA.wait('No =>')
VistA.write('No')
arglist = sys.argv[2].split(',')
for routine in arglist:
VistA.wait('Routine:')
VistA.write(routine)
VistA.wait('Routine:')
VistA.write('')
selectionList = ['Select BUILD NAME:',
'Select INSTALL NAME:',
'Select PACKAGE NAME:']
while True:
index = VistA.multiwait(selectionList)
VistA.write('')
if index == len(selectionList) - 1:
break
VistA.wait('warnings?')
VistA.write('No')
VistA.wait('routines?')
VistA.write('NO')
VistA.wait('DEVICE:')
VistA.write(';;9999')
if sys.platform == 'win32':
VistA.wait('Right Margin:')
VistA.write('')
VistA.write('')
VistA.wait('continue:',60)
VistA.write('')
VistA.wait('--- END ---',60)
VistA.write('h')