def connect_VistA(self, test_suite_details): ''' Generic method to connect to VistA. Inteded to be reused by the ATF Recorder. ''' if test_suite_details.remote_conn_details: location = test_suite_details.remote_conn_details.remote_address else: location = '127.0.0.1' from OSEHRAHelper import ConnectToMUMPS, PROMPT VistA = ConnectToMUMPS(logfile=test_suite_details.result_dir + '/' + self.testname + '.txt', instance=test_suite_details.instance, namespace=test_suite_details.namespace, location=location, remote_conn_details=test_suite_details.remote_conn_details) if not test_suite_details.remote_conn_details or not test_suite_details.remote_conn_details.default_namespace: try: VistA.ZN(VistA.namespace) except IndexError, no_namechange: pass VistA.wait(PROMPT)
def connect_VistA(self, test_suite_details): """ Generic method to connect to VistA. Intended to be used by the ATF Recorder. """ if test_suite_details.remote_conn_details: location = test_suite_details.remote_conn_details.remote_address else: location = "127.0.0.1" from OSEHRAHelper import ConnectToMUMPS, PROMPT try: VistA = ConnectToMUMPS( logfile=test_suite_details.result_dir + "/" + self.testname + ".txt", instance=test_suite_details.instance, namespace=test_suite_details.namespace, location=location, remote_conn_details=test_suite_details.remote_conn_details, ) except ImportError as ex: print ex raise if test_suite_details.username != "": test_suite_details.password = os.getenv("CACHE_PASSWORD", "") VistA.wait("Username") VistA.write(test_suite_details.username) VistA.wait("Password") VistA.write(test_suite_details.password) if VistA.type is not None and VistA.type == "cache" and test_suite_details.namespace != "": try: VistA.ZN(test_suite_details.namespace) except IndexError, no_namechange: pass VistA.wait(PROMPT)
def connect_VistA(self, test_suite_details): ''' Generic method to connect to VistA. Intended to be used by the ATF Recorder. ''' if test_suite_details.remote_conn_details: location = test_suite_details.remote_conn_details.remote_address else: location = '127.0.0.1' from OSEHRAHelper import ConnectToMUMPS, PROMPT try: VistA = ConnectToMUMPS( logfile=test_suite_details.result_dir + '/' + self.testname + '.txt', instance=test_suite_details.instance, namespace=test_suite_details.namespace, location=location, remote_conn_details=test_suite_details.remote_conn_details) except ImportError as ex: print ex raise if test_suite_details.username != '': test_suite_details.password = os.getenv('CACHE_PASSWORD', '') VistA.wait("Username") VistA.write(test_suite_details.username) VistA.wait("Password") VistA.write(test_suite_details.password) if VistA.type is not None and VistA.type == 'cache' and test_suite_details.namespace != '': try: VistA.ZN(test_suite_details.namespace) except IndexError, no_namechange: pass VistA.wait(PROMPT)
def connect_VistA(self, test_suite_details): ''' Generic method to connect to VistA. Inteded to be reused by the ATF Recorder. ''' if test_suite_details.remote_conn_details: location = test_suite_details.remote_conn_details.remote_address else: location = '127.0.0.1' from OSEHRAHelper import ConnectToMUMPS, PROMPT VistA = ConnectToMUMPS( logfile=test_suite_details.result_dir + '/' + self.testname + '.txt', instance=test_suite_details.instance, namespace=test_suite_details.namespace, location=location, remote_conn_details=test_suite_details.remote_conn_details) if not test_suite_details.remote_conn_details or not test_suite_details.remote_conn_details.default_namespace: try: VistA.ZN(VistA.namespace) except IndexError, no_namechange: pass VistA.wait(PROMPT)
def connect_VistA(self, test_suite_details): ''' Generic method to connect to VistA. Intended to be used by the ATF Recorder. ''' if test_suite_details.remote_conn_details: location = test_suite_details.remote_conn_details.remote_address else: location = '127.0.0.1' from OSEHRAHelper import ConnectToMUMPS, PROMPT try: VistA = ConnectToMUMPS(logfile=test_suite_details.result_dir + '/' + self.testname + '.txt', instance=test_suite_details.instance, namespace=test_suite_details.namespace, location=location, remote_conn_details=test_suite_details.remote_conn_details) except ImportError as ex: print ex raise if VistA.type is not None and VistA.type =='cache' and test_suite_details.namespace != '': try: VistA.ZN(test_suite_details.namespace) except IndexError, no_namechange: pass VistA.wait(PROMPT)
import os import time import OSEHRASetup from OSEHRAHelper import ConnectToMUMPS, PROMPT VistA = ConnectToMUMPS("./VistA/bin/Testing/Log/PostImport1.log", "CACHE", "VISTA") if ('' and ''): VistA.login('', '') if VistA.type == 'cache': try: VistA.ZN('VISTA') except IndexError, no_namechange: pass VistA.wait(PROMPT, 60) #--------------------------------------------------------------------- #- SECTION TO SETUP DEMO VistA SITE - #--------------------------------------------------------------------- #Initialize FileMan # Pass a site name from CMake and have a default site name of 6161 OSEHRASetup.initializeFileman(VistA, "DEMO.NODEVISTA.ORG", "6161") # Setup the primary HFS directory from the # Kernel System Parameters file via FileMan # # Use an "@" to remove or set a new file path. OSEHRASetup.setupPrimaryHFSDir(VistA, '@')
import sys,os sys.path = [sys.argv[7] + '/Python/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 if sys.argv[8]=='ON': VistA.wait(PROMPT) VistA.startCoverage() 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:']
import sys, os 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 if sys.argv[8] == "ON": VistA.wait(PROMPT) VistA.startCoverage() 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:
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('')
def ZTMGRSET(): VistA = ConnectToMUMPS(LOGFILE) VistA.wait(PROMPT) VistA.write('D ^ZTMGRSET') while True: index = VistA.multiwait(['Should I continue?', 'System:']) if index == 0: VistA.write('YES') continue if index == 1: break # After choosing GTM (8), will see: # 'I will now rename a group of routines specific to your operating system VistA.write('8') # MANAGER's VistA.wait('NAME OF') VistA.write(TEST_VISTA_SETUP_UCI_NAME + "," + TEST_VISTA_SETUP_VOLUME_SET) # PRODUCTION SIGN ON VistA.wait('PRODUCTION') VistA.write(TEST_VISTA_SETUP_UCI_NAME + "," + TEST_VISTA_SETUP_VOLUME_SET) # VOLUME SET must match one used in PRODUCTION VistA.wait('NAME OF') VistA.write(TEST_VISTA_SETUP_VOLUME_SET) # Accept /tmp VistA.wait('The temp directory for the system') VistA.write('') # last step - Now to load routines common to all systems. VistA.wait('Want to rename the FileMan routines: No//') VistA.write('YES') VistA.wait(PROMPT, 200)
level=logging.INFO, #filename='debug.log', #format='%(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') try: from OSEHRAHelper import ConnectToMUMPS, PROMPT VistA = ConnectToMUMPS('./VistA/bin/Testing/Log/importPats_details.txt', 'CACHE', 'VISTA') if ('' and ''): VistA.login('', '') if VistA.type == 'cache': try: VistA.ZN('VISTA') except IndexError, no_namechange: pass VistA.wait(PROMPT) pat = PATActions(VistA) pat.signon() pat.patientaddallcsv( '/vagrant/VistA/Testing/Functional/dataFiles/patdata0.csv') except TestHelper.TestError, e: resultlog.write(e.value) logging.error('*****exception*********') else: resultlog.write('Pass\n') finally: ''' Close Vista ''' pat.signoff()