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)
Exemple #2
0
def connect_VistA(testname, result_dir, namespace):
    ''' This method is used to establish the connection to VistA via ConnectToMUMPS'''
    logging.debug('Connect_VistA' + ', Namespace: ' + namespace)
    from OSEHRAHelper import ConnectToMUMPS, PROMPT
    VistA = ConnectToMUMPS(logfile=result_dir + '/' + timeStamped(testname + '.txt'), instance='', namespace=namespace)
    if VistA.type == 'cache':
        try:
            VistA.ZN(namespace)
        except IndexError, no_namechange:
            pass
Exemple #3
0
    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)
'''
import sys
sys.path = ['/vagrant/VistA/Python/vista'] + sys.path

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
#
Exemple #5
0
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('')