class EHR(QtGui.QDialog, Ui_EHRMainWindow): def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.newRecordWindow = None self.searchRecordWindow = None self.dbManager = EHRDBManager() if not self.dbManager.open(): # FIXME: DB problem, messagebox print "db problem" # Load drugs and diseases now for speed-up self.drugs = [unicode(f) for f in cPickle.load(open("data/drugs.db", "r"))] self.icd10 = [unicode("%s:%s" % (k,v)) for k,v in cPickle.load(open("data/icd10.db", "r")).items()] # Connect signals for buttons self.pushButtonNewRecord.clicked.connect(self.createNewRecordWindow) self.pushButtonSearchRecord.clicked.connect(self.createNewSearchWindow) self.pushButtonExit.clicked.connect(QtGui.qApp.quit) def createNewRecordWindow(self): self.newRecordWindow = EHRNewRecordWindow(self) self.newRecordWindow.kactionselectorDrugs.availableListWidget().addItems(self.drugs) self.newRecordWindow.kactionselectorICD.availableListWidget().addItems(sorted(self.icd10)) self.newRecordWindow.show() def createNewSearchWindow(self): self.searchRecordWindow = EHRSearchRecordWindow(self) self.searchRecordWindow.show()
def createNewRecordWindow(self): self.newRecordWindow = EHRNewRecordWindow(self) self.newRecordWindow.kactionselectorDrugs.availableListWidget( ).addItems(self.drugs) self.newRecordWindow.kactionselectorICD.availableListWidget().addItems( sorted(self.icd10)) self.newRecordWindow.show()
def createNewRecordWindow(self): self.newRecordWindow = EHRNewRecordWindow(self) self.newRecordWindow.kactionselectorDrugs.availableListWidget().addItems(self.drugs) self.newRecordWindow.kactionselectorICD.availableListWidget().addItems(sorted(self.icd10)) self.newRecordWindow.show()
class EHR(QtGui.QDialog, Ui_EHRMainWindow): def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setupUi(self) self.newRecordWindow = None self.searchRecordWindow = None self.dbManager = EHRDBManager() if not self.dbManager.open(): # FIXME: DB problem, messagebox print "db problem" # Load drugs and diseases now for speed-up self.drugs = [ unicode(f) for f in cPickle.load(open("data/drugs.db", "r")) ] self.icd10 = [ unicode("%s:%s" % (k, v)) for k, v in cPickle.load(open("data/icd10.db", "r")).items() ] # Connect signals for buttons self.pushButtonNewRecord.clicked.connect(self.createNewRecordWindow) self.pushButtonSearchRecord.clicked.connect(self.createNewSearchWindow) self.pushButtonExit.clicked.connect(QtGui.qApp.quit) def createNewRecordWindow(self): self.newRecordWindow = EHRNewRecordWindow(self) self.newRecordWindow.kactionselectorDrugs.availableListWidget( ).addItems(self.drugs) self.newRecordWindow.kactionselectorICD.availableListWidget().addItems( sorted(self.icd10)) self.newRecordWindow.show() def createNewSearchWindow(self): self.searchRecordWindow = EHRSearchRecordWindow(self) self.searchRecordWindow.show()
def showRecord(self, item, column): showRecordWindow = EHRNewRecordWindow(self, item.text(0)) self.hide() showRecordWindow.show()