Example #1
0
    def test_SendAndCheckFGMessageComm(self):
        """
        Verifies requirements PAN000001 and PAN000002. Sends a finished goods 
        message for a Communicator and then checks that Finished Goods message 
        was sent successfully.
        """       

        # Send Finished Goods Message
        self.pandaInstance.sendFinishedGoodsMessage(self.clinic1, CommEntity=self.comm)

        finishedGoodsDict = {}
        finishedGoodsDict["Communicator"] = {"ModelNumber":self.comm.modelNumber,
                                             "SerialNumber":self.comm.serialNumber,
                                             'MaterialNumber' : self.comm.modelNumber + "-100",
                                             'SoldToSapId' : self.clinic1.sapId,
                                             'MovementDateTime' : '2008-05-21T18:42:38-06:00',
                                             }        
        
        # Query database for communicator
        cQuery = ("select count(*) AS Count from APM.DEVICE where SERIAL_NBR = " + str(self.commSerial) + 
                  " AND MODEL_ID in ( select Model_ID from APM.MODEL where MODEL_NBR= '%s')") % self.comm.modelNumber

        count = db.executeQuery(cQuery, 
                                self.testContext['env'].db.user, 
                                self.testContext['env'].db.pwd, 
                                self.testContext['env'].db.name)

        self.trace('PAN000001')
        self.verifyEqual(count,[[1]]) 
        
        self.trace('PAN000002')
        self.verifyTrue(self.pandaInstance.checkFinishedGoods(self.clinic1, finishedGoodsDict))
Example #2
0
    def test_SendAndCheckFGMessagePG(self):
        """
        Verifies requirements PAN000001 and PAN000002. Sends a finished goods 
        message for a Pulse Generator and then checks that Finished Goods 
        message was sent successfully.
        """

        # Send Finished Goods Message
        self.pandaInstance.sendFinishedGoodsMessage(self.clinic1, PGEntity=self.pg)
        
        finishedGoodsDict = {}
        finishedGoodsDict["PulseGenerator"] = {"ModelNumber":self.pg.modelNumber,
                                               "SerialNumber":self.pg.serialNumber,
                                               "AccessCode": self.pg.wakeUpAccessCode,
                                               "Frequency": self.pg.rfCenterFrequency,
                                               "FullModel":self.pg.fullModelNumber
                                               }

        # Query database for PG
        pgQuery = ("select count(*) AS Count from APM.DEVICE where SERIAL_NBR = " + str(self.pgSerial) + 
                   " AND MODEL_ID in ( select Model_ID from APM.MODEL where MODEL_NBR= '%s')") % self.pg.fullModelNumber

        count = db.executeQuery(pgQuery, 
                                self.testContext['env'].db.user, 
                                self.testContext['env'].db.pwd, 
                                self.testContext['env'].db.name)

        self.trace('PAN000001')
        self.verifyEqual(count,[[1]])        
        
        self.trace('PAN000002')
        self.verifyTrue(self.pandaInstance.checkFinishedGoods(self.clinic1, finishedGoodsDict))
Example #3
0
    def test_SendAndCheckFGMessageBPMWithoutBtoothAddrss(self):
        """
        Verifies requirements PAN000001 and PAN000002. Sends a finished goods 
        message for a Blood Pressure Monitor and then checks that Finished Goods 
        message was sent successfully. It also checks that the bluetooth address 
        for the Blood Pressure Monitor was not received by the system 
        successfully.
        """         

        # Send Finished Goods Message
        self.pandaInstance.sendFinishedGoodsMessage(self.clinic1, BPMEntity=self.bpmWithoutBtoothAddress)

        finishedGoodsDict = {}        
        finishedGoodsDict["BloodPressureMonitor"] = {"ModelNumber":self.bpmWithoutBtoothAddress.modelNumber,
                                                     "SerialNumber":self.bpmWithoutBtoothAddress.serialNumber,
                                                     'MaterialNumber' : self.bpmWithoutBtoothAddress.modelNumber + "-111",
                                                     'SoldToSapId' : self.clinic1.sapId,
                                                     'MovementDateTime' : '2008-05-21T18:42:38-06:00',
                                                     'BluetoothAddress' : self.bpmWithoutBtoothAddress.bluetoothAddress
                                                     }
        # Query Device table for BPM
        bpQuery = ("select count(*) AS Count from APM.DEVICE where SERIAL_NBR = " + str(self.bpmSerialNoBT) + 
                   " AND MODEL_ID in ( select Model_ID from APM.MODEL where MODEL_NBR= '%s')") % self.bpm.modelNumber

        count = db.executeQuery(bpQuery, 
                                self.testContext['env'].db.user, 
                                self.testContext['env'].db.pwd, 
                                self.testContext['env'].db.name)

        self.trace('PAN000001')
        self.verifyEqual(count,[[1]])    

        # Query Security Key table for Bluetooth address
        btoothQuery = ("select count(*) As Count from APM.SECURITY_KEY SK, APM.DEVICE DEV WHERE SK.DEVICE_ID = DEV.DEVICE_Id" +
                       " AND SK.SECURITY_KEY_TYPE_CD = 'BTAD' AND DEV.MODEL_ID in ( select Model_ID from APM.MODEL where MODEL_NBR= '%s')" +
                       " AND DEV.SERIAL_NBR = " + str(self.bpmSerialNoBT)) % self.bpm.modelNumber        

        count = db.executeQuery(btoothQuery, 
                                self.testContext['env'].db.user, 
                                self.testContext['env'].db.pwd, 
                                self.testContext['env'].db.name)

        self.trace('PAN000002')
        self.verifyEqual(count,[[0]]) 
        self.verifyTrue(self.pandaInstance.checkFinishedGoods(self.clinic1, finishedGoodsDict))