示例#1
0
def sc_test003(test_suite_details):
    '''
    This tests clinic features such as change clinic, change date-range,
    expand the entry, add and edit, and Patient demographics
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        SC.signon()
        tclinic = SC.getclinic()
        SC.chgclinic()
        SC.signon()
        SC.chgdaterange(clinic=tclinic)
        SC.signon()
        SC.teaminfo(clinic=tclinic)
        SC.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
示例#2
0
def reg_test007(test_suite_details):
    '''Add a new doctor, wait 2 minutes, add another doctor, then attempt to add doctor during patient admitting using a prior date (REF-218) '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        reg = Actions(VistA1, user='******', code='SM1234!!!')
        reg.signon()
        reg.adduser(name='JONES,JOE', ssn='000000050', gender='M', initials='JJ', acode='fakejoe1', vcode1='1SWUSH1234!!')
        VistA1 = test_driver.connect_VistA(testname + '_01', result_dir, namespace)
        reg = Actions(VistA1)
        reg.sigsetup(acode='fakejoe1', vcode1='1SWUSH1234!!', vcode2='1SWUSH12345!!', sigcode='JOEJ123')
        VistA1 = test_driver.connect_VistA(testname + '_02', result_dir, namespace)
        reg = Actions(VistA1, user='******', code='SM1234!!!')
        reg.signon()
        reg.adduser(name='BURKE,BARBARA', ssn='000000051', gender='F', initials='BB', acode='fakebar1', vcode1='1OIG1234!!')
        VistA1 = test_driver.connect_VistA(testname + '_03', result_dir, namespace)
        reg = Actions(VistA1)
        reg.sigsetup(acode='fakebar1', vcode1='1OIG1234!!', vcode2='1OGI12345!!', sigcode='BARB123')
        reg.signoff()
        VistA1 = test_driver.connect_VistA(testname + '_04', result_dir, namespace)
        reg = ADTActions(VistA1, user='******', code='1Doc!@#$')
        reg.signon()
        reg.admit_a_patient(ssn='666551234', bed='2-B', time='t-1@01am', doctorlist=['BURKE', 'Alexander', 'JONES', 'Alexander'])
        reg.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#3
0
def pl_test002(test_suite_details):
    '''This test restores previously removed problems '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.addcsv(ssn='888776666', pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl.editinactivate(ssn='888776666', probnum='4', resdate='08/29/2010')
        pl.editinactivate(ssn='888776666', probnum='3', resdate='08/29/2010')
        pl.verplist(ssn='888776666', vlist=['Essential',
                                            'Chronic'])
        pl.verify(ssn='888776666', probnum='1', itemnum='1',
                     evalue=['Essential Hypertension','Essential hypertension'])
        pl.verify(ssn='888776666', probnum='2', itemnum='1',
                     evalue=['Chronic airway obstruction','Chronic obstructive lung disease'])
        pl.verify(ssn='888776666', probnum='1', itemnum='1',
                     evalue=['Acute myocardial'], view='IA')
        pl.verify(ssn='888776666', probnum='2', itemnum='1',
                     evalue=['Congestive'], view='IA')
        for i in range(4):
            pl.rem(ssn='888776666')
        pl.checkempty(ssn='888776666')
        pl.replace(ssn='888776666', probnum='1')
        pl.verify(ssn='888776666', probnum='1', itemnum='1',
                     evalue=['Essential Hypertension','Essential hypertension'])
        pl.rem(ssn='888776666')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#4
0
def pl_test011(test_suite_details):
    '''This test adds a problem, adds comments, and then removes them from the Problem List. '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.addcsv(ssn='656451234', pfile='./Functional/dataFiles/probdata0.csv')
        pl.verplist(ssn='656451234', vlist=['[Dd]rug abuse', 'Arterial embolism'])
        pl.comcm(ssn='656451234', probnum='1', comment='this is XZY a test')
        pl.rem(ssn='656451234')
        pl.rem(ssn='656451234')
        pl.checkempty(ssn='656451234')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
示例#5
0
def sc_test002(test_suite_details):
    '''Basic appointment managment options
    Make an Appointment (Scheduled and Unscheduled),
    record a No-Show, Cancel an appointment and change patients'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime()
        SC.signon()
        SC.makeapp(patient='655447777', datetime=time)
        time = SC.schtime(plushour=1)
        SC.signon()
        SC.unschvisit(patient='345678233', patientname='Twelve')
        SC.signon()
        SC.noshow(appnum='3')
        SC.signon()
        SC.canapp(mult='1')
        SC.signon()
        SC.chgpatient(patient1='345678233',
                      patient2='345238901',
                      patientname1='Twelve',
                      patientname2='Ten')
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#6
0
def sc_test012(test_suite_details):
    '''
    This test adds a new user with SDOB keys and creates & verifies appointments in timeslots outside a clinic's normal operating window
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        # create new user with SDOB keys
        VistA1 = test_driver.connect_VistA(test_suite_details)
        SC = Actions(VistA1, user='******', code='SM1234!!!')
        SC.signon()
        SC.adduser(name='CRANE,JON', ssn='000000065', gender='M', initials='JC', acode='fakejon1', vcode1='1SWUSH1234!!')
        SC.signoff()
        VistA1 = test_driver.connect_VistA(testname + '_01', result_dir, namespace)
        SC = Actions(VistA1)
        SC.sigsetup(acode='fakejon1', vcode1='1SWUSH1234!!', vcode2='1SWUSH12345!!', sigcode='JONC123')
        SC.signoff()
        # Create appointment outside Clinic1's operating hours via fakedoc1
        VistA2 = test_driver.connect_VistA(testname + '_02', result_dir, namespace)
        SC = SCActions(VistA2, user='******', code='1Doc!@#$')
        SC.signon()
        SC.gotoApptMgmtMenu()
        SC.makeapp(patient='333224444', clinic='Clinic1', datetime='t+5@9AM', fresh='No', badtimeresp='noslot')
        SC.signoff()
        # Create appointment outside Clinic1's operating hours via fakejon1 (SDOB key)
        VistA3 = test_driver.connect_VistA(testname + '_02', result_dir, namespace)
        SC = SCActions(VistA3, user='******', code='1SWUSH12345!!')
        SC.signon()
        SC.gotoApptMgmtMenu()
        SC.makeapp(patient='333224444', clinic='Clinic1', datetime='t+10@9AM', fresh='No', badtimeresp='overbook')
        SC.signoff()
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#7
0
def sc_test001(test_suite_details):
    '''
    Test for basic appointment management options.
    Make an Appointment, Check in, Check Out
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)
    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime()
        SC.signon()
        tclinic = SC.getclinic()
        SC.makeapp(patient='333224444', clinic=tclinic, datetime=time)
        time = SC.schtime(plushour=1)
        now = datetime.datetime.now()
        hour = now.hour + 1
        SC.signon()
        SC.checkin(clinic=tclinic, vlist=['Three', str(hour), 'CHECKED'])
        SC.signon()
        SC.checkout(clinic=tclinic, vlist1=['Three', str(hour), 'Checked In'],
                    vlist2=['RESULTING'], icd='305.91', icd10='F18.10')
        SC.signon()
        SC.makeapp_bypat(clinic=tclinic, patient='333224444', datetime=time, fresh='No', prevCO='yes')
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#8
0
def sc_test009(test_suite_details):
    '''
    This test makes appointments with variable length and makes appointment in distant future for EWL
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime()
        SC.signon()
        tclinic = SC.getclinic()
        SC.makeapp_var(clinic='CLInicA', patient='323678904', datetime='t+7@7AM', fresh='No')
        SC.signon()
        SC.verapp_bypat(patient='323678904', vlist=['THIRTEEN,PATIENT M', 'Clinica', '7:00', 'Future'],)
        SC.signon()
        SC.makeapp_var(clinic='CLInicA', patient='323678904', datetime='t+122@6AM', fresh='No')
        SC.signon()
        SC.makeapp_var(clinic='CLInicA', patient='323678904', datetime='t+10@4AM', fresh='No', nextaval='No')
        SC.signon()
        SC.verapp_bypat(patient='323678904', vlist=['THIRTEEN,PATIENT M', 'Clinica', '4:00', 'Future'],
                        ALvlist=['THIRTEEN,PATIENT M', 'Clinicx', 'Clinica', 'Clinica'],
                        EPvlist=['THIRTEEN,PATIENT M', 'CLINICX', '8904', 'FUTURE', 'SCHEDULED', 'REGULAR'])
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#9
0
def sc_test008(test_suite_details):
    '''
    This test makes future appointments and verifies, and also checks case sensitivity (cLiNiCx, ClInIcX, etc.)
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime()
        SC.signon()
        tclinic = SC.getclinic()
        SC.makeapp_bypat(clinic='cLiNiCx', patient='323678904', datetime='t+5@8PM')
        SC.signon()
        SC.verapp_bypat(patient='323678904', vlist=['THIRTEEN,PATIENT M', 'Clinicx', 'Future'])
        SC.signon()
        SC.makeapp_bypat(clinic='cLiNiCx', patient='222559876', datetime='t+6@8PM', CLfirst='Yes')
        SC.signon()
        SC.verapp_bypat(patient='222559876', vlist=['SIXTEEN,PATIENT P', 'Clinicx', 'Future'],
                        CInum=['1', '1'], COnum=['1', '2'])
        SC.signon()
        SC.verapp(clinic='cLiNiCx',
                  vlist=['Thirteen,Patient M', 'Future', 'Sixteen,Patient P', 'Future'],
                  CInum=['2', '1'], COnum=['2', '2'])
        SC.signon()
        SC.canapp(clinic='cLiNiCx', mult='2', future=1, rebook=1)
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#10
0
def sc_test013(test_suite_details):
    '''
    This test creates a Sharing Agreement subcategory and adds it to a select patient's eligibility
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    if sys.platform == 'win32':
        try:
            # Create Sharing Agreement sub-category
            VistA1 = test_driver.connect_VistA(test_suite_details)
            aa = Actions(VistA1)
            aa.signon()
            aa.addSAsubtype(subcat='subcat1')
            aa.signon()
            aa.addSAsubtype(subcat='SUBCAT2')
        # Add Sharing Agreement to Patient Eligibility
            VistA1 = test_driver.connect_VistA(testname + '_1', result_dir, namespace)
            adt = ADTActions(VistA1)
            adt.signon()
            adt.gotoADTmenu()
            adt.eligverific(patient='333224444', eligtype='SHARING AGREEMENT')
            adt.signoff()
        # Make Appointment using new sub-category
            VistA1 = test_driver.connect_VistA(testname + '_2', result_dir, namespace)
            SC = SCActions(VistA1, user='******', code='1SWUSH12345!!')
            SC.signon()
            SC.gotoApptMgmtMenu()
            SC.makeapp(patient='333224444', clinic='Clinic1', datetime='t+9@5AM', fresh='No', apptype='SHARING AGREEMENT', subcat=['subcat1', 'SUBCAT2'])
            SC.signoff()
        except TestHelper.TestError, e:
            test_driver.exception_handling(test_suite_details, e)
        finally:
示例#11
0
def startmon(test_suite_details):
    '''This starts the Coverage Monitor'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    VistA1 = None
    if test_suite_details.coverage_subset == ['*']:
      test_suite_details.coverage_subset=['GMPL*']
    try:
        VistA1=test_driver.connect_VistA(test_suite_details)
        VistA1.startCoverage(test_suite_details.coverage_subset)

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        '''
        Close Vista
        '''
        VistA1.write('^\r^\r^\r')
        VistA1.write('h\r')
        test_driver.finally_handling(test_suite_details)
    test_driver.end_method_handling(test_suite_details)
示例#12
0
def pl_test015(test_suite_details):
    '''This test verifies that lock function works correctly -- that is that two
    providers/users can not edit the same record simultaneously.'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        test_driver.testname = testname + '_01'
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl1 = PLActions(VistA1, user='******', code='1Nur!@#$')
        pl1.signon()
        pl1.rem_all(ssn='656451234')
        pl1.addcsv(ssn='656451234', pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl1.verplist(ssn='656451234', vlist=['Essential',
                                    'Chronic',
                                    'Acute myocardial',
                                    'Congestive'])
        pl1.editpart1(ssn='656451234', probnum='1', itemnum='1', chgval='786.50')
        #

        test_driver.testname = testname + '_02'
        VistA2 = test_driver.connect_VistA(test_suite_details)
        pl2 = PLActions(VistA2, user='******', code='1Doc!@#$')
        pl2.signon()
        pl2.badeditpart1(ssn='656451234', probnum='1', itemnum='1', chgval='786.50')
        pl2.signoff()
        pl1.editpart2(ssn='656451234', probnum='1', itemnum='1', chgval='786.50')
        pl1.rem_all(ssn='656451234')
        pl1.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#13
0
def sc_test001(test_suite_details):
    '''Basic appointment managment options
    Make an Appointment, Check in, Check Out'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime()
        SC.signon()
        SC.makeapp(patient='333224444', datetime=time)
        time = SC.schtime(plushour=1)
        now = datetime.datetime.now()
        hour = now.hour + 1
        SC.signon()
        SC.checkin(vlist=['Three', str(hour), 'CHECKED-IN:'])
        SC.signon()
        SC.checkout(vlist1=['Three', str(hour), 'Checked In'],
                    vlist2=['305.91', 'OTHER DRUG', 'RESULTING'],
                    icd='305.91')
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#14
0
def sc_test005(test_suite_details):
    '''This test checks a patient into a clinic, then discharges him, then deletes his checkout'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA)
        SC.signon()
        SC.enroll(patient='543236666')
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime(plushour=1)
        SC.signon()
        SC.makeapp(patient='543236666', datetime=time)
        SC.signon()
        SC.discharge(patient='543236666', appnum='3')
        SC.signon()
        SC.checkout(vlist1=['One', 'No Action'],
                    vlist2=['305.91', 'RESULTING'],
                    icd='305.91',
                    mult='3')
        SC = SCActions(VistA, user='******', code='1Doc!@#$')
        SC.signon()
        SC.deletecheckout(appnum='3')
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#15
0
def pl_test007(test_suite_details):
    '''This test adds problems and then views patients by problem via Problem List menu items 4 & 5'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.addcsv(ssn='655447777',
                  pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl.addcsv(ssn='543236666',
                  pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl.addcsv(ssn='345678233',
                  pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl.verlistpats(
            vlist=['EIGHT,PATIENT', 'ONE,PATIENT', 'TWELVE,PATIENT'])
        pl.verpatsrch(prob='428.0',
                      icd10='I50.9',
                      snomed='42343007',
                      vlist=['EIGHT,PATIENT', 'ONE,PATIENT', 'TWELVE,PATIENT'])
        for i in range(4):
            pl.rem('655447777')
            pl.rem('543236666')
            pl.rem('345678233')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#16
0
def pl_test006 (test_suite_details):
    '''This test creates a Selection List from IB Encounter Form'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Nur!@#$')
        pl.signon()
        if(pl.checkOutOfOrder('Copy Selection List from IB Encounter')):
          pl.createibform('LAB', 'FORM1', 'Group1', ['428.0', '410.90', '401.9'],['42343007','57054005','59621000'])
          pl.sellistib('FORM1', 'List003', 'LAB')
          pl.versellist(ssn='345238901', clinic='LAB',
                     vlist=['List003', 'Group1', 'Congestive ', 'Acute myocardial', 'Essential'])
          pl.addbyprobnum(ssn='345238901', clinic='LAB', probnum='1',
                    comment='this is a test', onsetdate='t', status='Active',
                    acutechronic='A', service='N', evalue='Congestive')
          pl.verify(ssn='345238901', probnum='1', itemnum='1',
                       evalue=['Congestive'])
          pl.rem('345238901')
          pl.sellistrm(listname='List003')
          pl.catdl(listname='List003', catname='Group1')
          pl.sellistrfu(listname='List003', username='******')
          pl.sellistdl(listname='List003', clinic='LAB')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
def demo_screen_man(test_suite_details):
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        vista = test_driver.connect_VistA(test_suite_details)
        rc = RCActions(
            vista, user='******', code='radiologist1'
        )  #TODO: when moving to the config approach, new a/v codes should be put into a new test suite?
        rc.signon()
        vista.wait('Select TERMINAL TYPE NAME:')
        vista.write('')
        vista.wait('Select Clinician Menu Option:')
        vista.write('OE')
        vista.wait('Select Patient: Change View')
        vista.write('FD')
        vista.wait('Select PATIENT NAME:')
        vista.write('0849')  #0849
        vista.wait('Select: Next Screen')
        vista.write('Q')
        vista.wait('Select Patient: Change View')
        vista.write('^')
        vista.wait('Select Clinician Menu Option:')
        rc.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#18
0
def reg_test003(test_suite_details):
    '''Test for Wait list entries '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        reg = ADTActions(VistA1)
        reg.signon()
        reg.gotoADTmenu()
        reg.waiting_list_entry(ssn='323554567')
        reg.signon()
        reg.gotoADTmenu()
        reg.waiting_list_entry(ssn='123455678')
        reg.signon()
        reg.gotoADTmenu()
        reg.waiting_list_output(
            vlist=['TWENTYFOUR,PATIENT', 'TWENTYTHREE,PATIENT'])
        reg.signon()
        reg.gotoADTmenu()
        reg.delete_waiting_list_entry(ssn='323554567')
        reg.signon()
        reg.gotoADTmenu()
        reg.delete_waiting_list_entry(ssn='123455678')
        reg.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#19
0
def reg_test004(test_suite_details):
    '''Test for Lodger checkin / checkout '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        reg = ADTActions(VistA1, user='******', code='1Doc!@#$')
        reg.signon()
        reg.checkin_lodger(ssn='323554567', bed='1-A')
        reg.checkin_lodger(ssn='123455678', bed='1-B')
        time.sleep(10)
        reg.lodger_checkout(ssn='323554567')
        reg.lodger_checkout(ssn='123455678')
        # DRG Calculation
        reg.drg_calc(ssn='123455678',
                     diag='787.1',
                     ICD10diag='R12.',
                     sdiag='786.50',
                     ICD10sdiag='R07.9',
                     oper='31.93',
                     ICD10oper='0C7S0DZ')
        reg.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#20
0
def sc_test011(test_suite_details):
    '''
    This makes appointments via Multiple Clinic Display and then verifies the appointments
    '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, user='******', code='1Doc!@#$')
        SC.signon()
        SC.multiclinicdisplay(cliniclist=['Clinic1', 'ClinicX'],
                              patient='656454321',
                              timelist=['7', '5'],
                              pending=None)
        SC.gotoApptMgmtMenu()
        SC.verapp_bypat(
            patient='656454321',
            vlist=['Clinic1', '7:00', 'Future', 'Clinicx', '17:00', 'Future'],
        )
        SC.signoff()
    except TestHelper.TestError, e:
        resultlog.write('\nEXCEPTION ERROR:' + str(e))
        logging.error('*****exception*********' + str(e))
示例#21
0
def stopmon (test_suite_details):
    '''This stops the Coverage Monitor'''

    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    VistA1 = None
    try:
        # Connect to VistA
        VistA1=test_driver.connect_VistA(test_suite_details)
        path = (test_suite_details.result_dir + '/' + TestHelper.timeStamped('ProblemList_coverage.txt'))
        VistA1.stopCoverage(path, test_suite_details.coverage_type)

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        '''
        Close Vista
        '''
        VistA1.write('^\r^\r^\r')
        VistA1.write('h\r')
        test_driver.finally_handling(test_suite_details)
    test_driver.end_method_handling(test_suite_details)
示例#22
0
def pl_test017(resultlog, result_dir, namespace):
    '''This test creates Problem Selection List, but does not delete the lists upon completion
    such that global files can be compared post-testing.'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1)
        pl.signon()
        pl.createsellist(listname="List001", clinic='VISTA')
        pl.createcat(listname='List001', catname='cat001')
        pl.createcat(listname='List001', catname='cat002')
        pl.createcat(listname='List001', catname='cat003')
        pl.catad(listname='List001', catname='cat001', icd='785.2', snomed='75431008', spec='General', dtext='', seqnum='5')
        pl.catad(listname='List001', catname='cat001', icd='786.50', snomed= '29857009', spec='General', dtext='', seqnum='1')
        pl.catad(listname='List001', catname='cat001', icd='786.2', snomed='49727002', spec='General', dtext='PAINFUL cough', seqnum='2')
        pl.catad(listname='List001', catname='cat001', icd='786.05', snomed='267036007', spec='General', dtext='Trouble Breathing', seqnum='7')
        pl.catad(listname='List001', catname='cat002', icd='829.0', snomed='125605004', spec='N', dtext='', seqnum='19')
        pl.catad(listname='List001', catname='cat002', icd='807.00', snomed='60667009', spec='N', dtext='', seqnum='18')
        pl.catad(listname='List001', catname='cat002', icd='806.12', snomed='21978005', spec='N', dtext='', seqnum='17')
        pl.catad(listname='List001', catname='cat002', icd='829.1', snomed='1370007', spec='N', dtext='', seqnum='16')
        pl.catad(listname='List001', catname='cat002', icd='802.8', snomed='430984009',spec='N', dtext='', seqnum='15')
        pl.catad(listname='List001', catname='cat003', icd='780.50', snomed='53888004', spec='I', dtext='', seqnum='3')
        pl.catad(listname='List001', catname='cat003', icd='292.0', snomed='363101005', spec='I', dtext='DRUG withdrawal', seqnum='1')
        pl.catad(listname='List001', catname='cat003', icd='304.90', snomed='191816009',spec='I', dtext='', seqnum='2')
        pl.sellistad(listname='List001', catname='cat001', hdrname='FATCAT', seqnum='7')
        pl.sellistad(listname='List001', catname='cat002', hdrname='SKINNYcat', seqnum='1')
        pl.sellistad(listname='List001', catname='cat003', hdrname='blackCAT', seqnum='5')
        pl.signoff()
    except TestHelper.TestError, e:
        resultlog.write(e.value)
        logging.error(testname + ' EXCEPTION ERROR: Unexpected test result')
示例#23
0
def pl_test008 (test_suite_details):
    '''This test adds a problem via data entry as clerk and changes the problem as doctor'''
    '''Multiple VistA instances to allow concurrent logins for when
    tstart and trollback become available and implemented'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        test_driver.testname = testname + '_01'
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl1 = PLActions(VistA1, user='******', code='1Cle!@#$')
        pl1.signon()
        pl1.dataentry(ssn='666551234', provider='Alexander', clinic='', problem='chest pain',
                      comment='test', onsetdate='t', status='Active', acutechronic='A',
                      service='N')
        pl1.signoff()

        test_driver.testname = testname + '_02'
        VistA2 = test_driver.connect_VistA(test_suite_details)
        pl2 = PLActions(VistA2, user='******', code='1Doc!@#$')
        pl2.signon()
        pl2.editsimple(ssn='666551234', probnum='1', itemnum='1', chgval='786.50', icd10='R07.9', snomed='29857009')
        pl2.verplist(ssn='666551234', vlist=['[Cc]hest pain'])
        pl2.rem('666551234')
        pl2.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
示例#24
0
def sc_test004(test_suite_details):
    '''This tests clinic features such as expand the entry, add and edit, and Patient demographics'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA = test_driver.connect_VistA(test_suite_details)
        SC = SCActions(VistA, scheduling='Scheduling')
        time = SC.schtime(plushour=1)
        SC.signon()
        SC.makeapp(patient='345238901', datetime=time)
        SC.signon()
        SC.patdem(name='Ten', mult='2')
        SC.signon()
        SC.expandentry(vlist1=['TEN', 'SCHEDULED', '30'],
                       vlist2=['Event', 'Date', 'User', 'TESTMASTER'],
                       vlist3=['NEXT AVAILABLE', 'NO', '0'],
                       vlist4=['1933', 'MALE', 'UNANSWERED'],
                       vlist5=['Combat Veteran:', 'No check out information'],
                       mult='2')
        SC.signon()
        SC.addedit(name='345623902', icd='305.91')
        SC.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#25
0
def reg_test002(test_suite_details):
    '''Test to Schedule, Unschedule, and Transfer Patients '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        reg = ADTActions(VistA1, user='******', code='1Doc!@#$')
        reg.signon()
        reg.admit_a_patient(ssn='888776666', bed='1-A')
        reg.roster_list(vlist=['TWO,PATIENT B', '1-A'])
        reg.det_inpatient_inquiry(
            ssn='888776666',
            item='1',
            vlist=['DIRECT', '1-A', 'ALEXANDER,ROBER', 'SMITH,MARY'])
        reg.schedule_admission(ssn='656451234')
        reg.schedule_admission(ssn='656771234')
        reg.scheduled_admit_list(vlist=['SEVEN,PATIENT G', 'SIX,PATIENT F'])
        time.sleep(10)
        reg.provider_change(ssn='888776666')
        time.sleep(10)
        reg.transfer_patient(ssn='888776666')
        reg.cancel_scheduled_admission(ssn='656451234')
        reg.cancel_scheduled_admission(ssn='656771234')
        reg.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#26
0
def pl_test012(test_suite_details):
    '''This test performs Problem List Menu Testing (pseudo smoke test)'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        test_driver.testname = testname + '_01'
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.addcsv(ssn='656451234', pfile='./Functional/dataFiles/probdata0.csv')
        pl.detview(ssn='656451234', probnum='2', vlist1=['ACTIVE', 'ALEXANDER', '444.21', 'I74.2','54687002'], vlist2=['hurts'])
        pl.rem(ssn='656451234')
        pl.rem(ssn='656451234')
        pl.checkempty(ssn='656451234')
        pl.signoff()

        test_driver.testname = testname + '_02'
        VistA2 = test_driver.connect_VistA(test_suite_details)
        p2 = PLActions(VistA2, user='******', code='1Cle!@#$')
        p2.signon()
        p2.dataentry(ssn='656451234', provider='Alexander', clinic='', problem='305.91',
                     comment='Test', onsetdate='t', status='a', acutechronic='A', service='n')
        p2.signoff()

        test_driver.testname = testname + '_03'
        VistA3 = test_driver.connect_VistA(test_suite_details)
        p3 = PLActions(VistA3, user='******', code='1Doc!@#$')
        p3.signon()
        p3.verifyproblem(ssn='656451234', problem='305.91')
        p3.add(ssn='656451234', clinic='Clinic1', comment='this is a test',
               onsetdate='t', status='Active', acutechronic='A', service='N',
               icd='786.2', icd10='R05',snomed='49727002', verchknum='2')
        p3.signoff()

        test_driver.testname = testname + '_04'
        VistA4 = test_driver.connect_VistA(test_suite_details)
        p4 = PLActions(VistA4, user='******', code='1Doc!@#$')
        p4.signon()
        p4.selectnewpatient(ssn1='656451234', name1='SIX,', ss2='323123456', name2='NINE,')
        p4.signoff()

        test_driver.testname = testname + '_05'
        VistA5 = test_driver.connect_VistA(test_suite_details)
        p5 = PLActions(VistA5, user='******', code='1Doc!@#$')
        p5.signon()
        p5.addcsv(ssn='656451234', pfile='./Functional/dataFiles/probdata0.csv')
        p5.printproblemlist(ssn='656451234', vlist=['PROBLEM LIST', '305.91'])
        p5.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
示例#27
0
def pl_test005(test_suite_details):
    '''This test creates a Problem Selection List, assigns it to user, and adds problem. '''
    '''This test uses separate VistA Instances to allow concurrent connections in case of
    future use of tstart and trollback when these features are available.'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        test_driver.testname = testname + '_01'
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl1 = PLActions(VistA1)
        pl1.signon()
        pl1.createsellist(listname="List002", clinic='')
        pl1.sellistgal(listname="List002", username='******')
        pl1.createcat(listname='List002', catname='cat011')
        pl1.createcat(listname='List002', catname='cat022')
        pl1.catad(listname='List002', catname='cat011', icd='787.1', snomed='16331000')
        pl1.catad(listname='List002', catname='cat011', icd='786.50', snomed= '29857009')
        pl1.catad(listname='List002', catname='cat011', icd='100.0', snomed='77377001')
        pl1.catad(listname='List002', catname='cat022', icd='780.50', snomed='53888004')
        pl1.catad(listname='List002', catname='cat022', icd='292.0', snomed='363101005')
        pl1.catad(listname='List002', catname='cat022', icd='304.90', snomed='191816009')
        pl1.sellistad(listname='List002', catname='cat011')
        pl1.sellistad(listname='List002', catname='cat022')

        test_driver.testname = testname + '_02'
        VistA2 = test_driver.connect_VistA(test_suite_details)
        pl2 = PLActions(VistA2, user='******', code='1Doc!@#$')
        pl2.signon()
        pl2.versellist(ssn='354623902', clinic='',
                      vlist=['List002', 'cat011', 'Heartburn', '[Cc]hest pain',
                             'Leptospirosis', 'cat022', 'Disturbance',
                             '[Dd]rug withdrawal', '[Dd]rug dependence'])
        pl2.addbyprobnum(ssn='354623902', clinic='', probnum='1',
                   comment='this is a test', onsetdate='t',
                   status='Active', acutechronic='A', service='N',
                   evalue='Heartburn')
        pl2.verify(ssn='354623902', probnum='1', itemnum='1',
                      evalue=['Heartburn'])
        pl2.rem(ssn='354623902')
        pl1.sellistrm(listname='List002')
        pl1.sellistrm(listname='List002')
        pl1.catdl(listname='List002', catname='cat011')
        pl1.catdl(listname='List002', catname='cat022')
        pl1.sellistrfu(listname='List002', username='******')
        pl1.sellistdl(listname='List002', clinic='')
        pl2.signoff()
        pl1.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError as e:
        test_driver.exception_handling(test_suite_details, e)
    else:
        test_driver.try_else_handling(test_suite_details)
    finally:
        test_driver.finally_handling(test_suite_details)
示例#28
0
def pl_test013(test_suite_details):
    '''This tests the remaining selection list Build menu options not already tested elsewhere'''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.createsellist(listname="List001", clinic='VISTA')
        pl.createsellist(listname="List002", clinic='VISTA')
        pl.createcat(listname='List001', catname='cat001')
        pl.createcat(listname='List001', catname='cat002')
        pl.catad(listname='List002',
                 catname='cat001',
                 icd='787.1',
                 snomed='16331000')
        pl.catad(listname='List002',
                 catname='cat001',
                 icd='786.50',
                 snomed='29857009')
        pl.catad(listname='List002',
                 catname='cat001',
                 icd='100.0',
                 snomed='77377001')
        pl.catad(listname='List002',
                 catname='cat002',
                 icd='780.50',
                 snomed='53888004')
        pl.catad(listname='List002',
                 catname='cat002',
                 icd='292.0',
                 snomed='363101005')
        pl.catad(listname='List002',
                 catname='cat002',
                 icd='304.90',
                 snomed='191816009')
        pl.sellistad(listname='List001', catname='cat001')
        pl.sellistad(listname='List001', catname='cat002')
        pl.resequencecat(listname='List001', catnames=['cat001', 'cat002'])
        pl.categorydisp(listname='List001', catname='cat001')
        pl.changesellist(list1='List001', list2='List002')
        pl.sellistrm(listname='List001')
        pl.sellistrm(listname='List001')
        pl.catdl(listname='List001', catname='cat001')
        pl.catdl(listname='List001', catname='cat002')
        pl.sellistrfu(listname='List001', username='******')
        pl.sellistdl(listname='List001')
        pl.sellistdl(listname='List002')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#29
0
def pl_test004(test_suite_details):
    ''' Create Problem Selection List, add/modify/remove categories and problems '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1)
        pl.signon()
        pl.createsellist(listname="List001", clinic='VISTA')
        pl.createcat(listname='List001', catname='cat001')
        pl.createcat(listname='List001', catname='cat002')
        pl.catad(listname='List001', catname='cat001', icd='787.1')
        pl.catad(listname='List001', catname='cat001', icd='786.50')
        pl.catad(listname='List001', catname='cat001', icd='100.0')
        pl.catad(listname='List001', catname='cat002', icd='780.50')
        pl.catad(listname='List001', catname='cat002', icd='292.0')
        pl.catad(listname='List001', catname='cat002', icd='304.90')
        pl.sellistad(listname='List001', catname='cat001')
        pl.sellistad(listname='List001', catname='cat002')
        pl.versellist(ssn='656454321',
                      clinic='VISTA',
                      vlist=[
                          'List001', 'cat001', 'Heartburn', 'chest pain',
                          'Leptospirosis', 'cat002', 'Sleep Disturbance',
                          'Drug withdrawal', 'drug dependence'
                      ])
        pl.add(ssn='656454321',
               clinic='VISTA',
               probnum='1',
               comment='this is a test',
               onsetdate='t',
               status='Active',
               acutechronic='A',
               service='N',
               evalue='Heartburn')
        pl.verify(ssn='656454321',
                  probnum='1',
                  itemnum='1',
                  evalue='Heartburn')
        pl.rem(ssn='656454321')
        pl.sellistrm(listname='List001')
        pl.sellistrm(listname='List001')
        pl.catdl(listname='List001', catname='cat001')
        pl.catdl(listname='List001', catname='cat002')
        pl.sellistrfu(listname='List001', username='******')
        pl.sellistdl(listname='List001')
        pl.signoff()
        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)
示例#30
0
def pl_test003(test_suite_details):
    '''This test changes problem data '''
    testname = sys._getframe().f_code.co_name
    test_driver = TestHelper.TestDriver(testname)

    test_driver.pre_test_run(test_suite_details)
    try:
        VistA1 = test_driver.connect_VistA(test_suite_details)
        pl = PLActions(VistA1, user='******', code='1Doc!@#$')
        pl.signon()
        pl.addcsv(ssn='656771234',
                  pfile='./Functional/dataFiles/NISTinpatientdata0.csv')
        pl.editsimple(ssn='656771234',
                      probnum='1',
                      itemnum='1',
                      chgval='787.1',
                      icd10='R12',
                      snomed='16331000')
        pl.editsimple(ssn='656771234',
                      probnum='1',
                      itemnum='2',
                      chgval='3/26/12')
        pl.editsimple(ssn='656771234',
                      probnum='1',
                      itemnum='4',
                      chgval='MANAGER')
        pl.editsimple(ssn='656771234',
                      probnum='1',
                      itemnum='5',
                      chgval='VISTA')
        pl.verify(ssn='656771234',
                  probnum='1',
                  itemnum='1',
                  evalue=['Heartburn'])
        pl.verify(ssn='656771234',
                  probnum='1',
                  itemnum='2',
                  evalue=['3/26/12'])
        pl.verify(ssn='656771234',
                  probnum='1',
                  itemnum='4',
                  evalue=['MANAGER,SYSTEM'])
        pl.verify(ssn='656771234', probnum='1', itemnum='5', evalue=['VISTA'])
        for i in range(4):
            pl.rem(ssn='656771234')
        pl.checkempty(ssn='656771234')
        pl.signoff()

        test_driver.post_test_run(test_suite_details)
    except TestHelper.TestError, e:
        test_driver.exception_handling(test_suite_details, e)