def reloadSubjects(self): """Reload OpenClinica study subects enrolled into selected study/site in working thread """ # Clear study subjects del self._studySubjects[:] self._studySubjects = [] self._selectedStudySubject = None self._studySubjects = None self._subjectsREST = None # Setup loading UI self.window().statusBar.showMessage("Loading list of study subjects...") self.window().enableIndefiniteProgess() self.tabWidget.setEnabled(False) # Load subject for whole study or only site if it is multicentre study if self._selectedStudy and self._selectedStudy.isMulticentre: self._threadPool.append( WorkerThread( self.ocWebServices.listAllStudySubjectsByStudySite, [self._selectedStudy, self._selectedStudySite, self._studyMetadata] ) ) else: self._threadPool.append( WorkerThread( self.ocWebServices.listAllStudySubjectsByStudy, [self._selectedStudy, self._studyMetadata] ) ) # Connect slots self.connect( self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("finished(QVariant)"), self.loadSubjectsFinished ) # Start thread self._threadPool[len(self._threadPool) - 1].start() # TODO: it would be much faster if I request REST subject only for the selected one # TODO: however we have to migrate to a new version of OC first # Need to get OIDs of subjects self._threadPool.append( WorkerThread( self.svcHttp.getStudyCasebookSubjects, [ConfigDetails().ocHost, self.getStudyOid()] ) ) # Connect slots self.connect( self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("finished(QVariant)"), self.loadSubjectsRESTFinished ) # Start thread self._threadPool[len(self._threadPool) - 1].start()
def reloadEvents(self): """Reload OpenClinica events scheduled for selected study subject """ # Setup loading UI self.window().statusBar.showMessage("Loading subject scheduled events...") self.window().enableIndefiniteProgess() self.tabWidget.setEnabled(False) # Define a job # Need to get EventRepeatKeys self._threadPool.append( WorkerThread( self.svcHttp.getStudyCasebookEvents, [ConfigDetails().ocHost, self.getStudyOid(), self._selectedStudySubject.oid] ) ) # Connect slots self.connect( self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("finished(QVariant)"), self.loadEventsFinished ) # Start thread self._threadPool[len(self._threadPool) - 1].start()
def btnDownloadClicked(self): """Upload button pressed (DICOM upload workflow started) """ QtGui.qApp.processEvents(QtCore.QEventLoop.AllEvents, 1000) #self.progressBar.setRange(0, 100) #self.progressBar.setValue(0) self._downloadDir = self.selectFolderDialog() if self._downloadDir is not None: # Disable upload button for now but better is to disable whole UI self.btnDownload.setEnabled(False) # Start download DICOM data # Create thread self._threadPool.append( WorkerThread(self._svcDicom.downloadDicomData, [ self._downloadDir, self.getStudyIdentifier(), self._svcHttp ])) # Connect finish event self._threadPool[len(self._threadPool) - 1].finished.connect( self.DicomDownloadFinishedMessage) # Connect message eventscd self.connect(self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("message(QString)"), self.Message) self.connect(self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("log(QString)"), self.LogMessage) # Progress self.connect(self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("taskUpdated"), self.handleTaskUpdated) # Start thread self._threadPool[len(self._threadPool) - 1].start()
def reloadStudyMetadata(self): """Reload study metadata for selected study """ # Setup loading UI self.window().statusBar.showMessage("Loading study metadata...") self.window().enableIndefiniteProgess() self.tabWidget.setEnabled(False) # Create data loading thread self._threadPool.append( WorkerThread(self.ocWebServices.getStudyMetadata, self._selectedStudy)) # Connect slots self.connect(self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("finished(QVariant)"), self.loadStudyMetadataFinished) # Start thread self._threadPool[len(self._threadPool) - 1].start()
def reloadStudies(self): """Reload OpenClinica studies (in working thread) """ # Setup loading UI self.window().statusBar.showMessage( "Loading list of clinical studies...") self.window().enableIndefiniteProgess() self.tabWidget.setEnabled(False) # Create data loading thread self._threadPool.append(WorkerThread( self.ocWebServices.listAllStudies)) # Connect slots self.connect(self._threadPool[len(self._threadPool) - 1], QtCore.SIGNAL("finished(QVariant)"), self.loadStudiesFinished) # Start thread self._threadPool[len(self._threadPool) - 1].start()