def __importZGORoutine__(self, vistATestClient): logger.info("Import ZGO routine to VistA instance") from PackRO import pack zgoOutFile = os.path.join(self._outputResultDir, "ZGO.ro") zgoRoutine = os.path.join(SCRIPTS_DIR, "ZGO.m") assert os.path.exists(zgoRoutine) pack([zgoRoutine], open(zgoOutFile, 'w')) vistARoutineImport = VistARoutineImport() vistARoutineImport.importRoutines(vistATestClient, zgoOutFile, self._routineOutDir)
def checkforZGI(self,vistaClient,tmpDir,gtmDir): connection = vistaClient.getConnection() try: print "Checking for the ZGI routine" connection.send("D ^ZGI\r") connection.expect("Device") connection.send("^\r") # If error, ZGI routine doesn't exist except Exception as ex: print "Installing ZGI" # Attempt to install ZGI from SCRIPT_DIR? zgiRO = open(tmpDir+"/ZGI.ro","w") pack([SCRIPT_DIR+"/ZGI.m"],zgiRO) zgiRO.close() vistARoutineImport = VistARoutineImport() vistARoutineImport.importRoutines(vistaClient, tmpDir+"/ZGI.ro", gtmDir) print "Done installing!"
def checkforZGI(self, vistaClient, tmpDir, gtmDir): connection = vistaClient.getConnection() try: print("Checking for the ZGI routine") connection.send("D ^ZGI\r") connection.expect("Device") connection.send("^\r") # If error, ZGI routine doesn't exist except Exception as ex: print("Installing ZGI") # Attempt to install ZGI from SCRIPT_DIR? zgiRO = open(tmpDir + "/ZGI.ro", "w") pack([SCRIPT_DIR + "/ZGI.m"], zgiRO) zgiRO.close() vistARoutineImport = VistARoutineImport() vistARoutineImport.importRoutines(vistaClient, tmpDir + "/ZGI.ro", gtmDir) print("Done installing!")