newnotes = unicode( self.om_gui.ui.notesEnter_textEdit.toPlainText().toUtf8()) if newnotes != "" and newnotes[-1] != "\n": newnotes += "\n" newnotes += "%s %s %s\n" % ( self.trt, _("performed by"), self.dent) self.om_gui.ui.notesEnter_textEdit.setText(newnotes) return True else: self.om_gui.advise("Hyg Treatment not applied", 2) return False if __name__ == "__main__": localsettings.initiate() localsettings.loadFeeTables() localsettings.station = "reception" from openmolar.qt4gui import maingui from openmolar.dbtools import patient_class app = QtGui.QApplication([]) mw = maingui.OpenmolarGui() mw.getrecord(11956) dl = HygTreatWizard(mw) print dl.perform_tx()
form.set_data(dl.data) form.printer.setDocName(form.NAME) form.set_testing_mode(dl.print_boxes) form.set_background_mode(dl.print_background) if form.controlled_print() and not test: commitPDFtoDB(self.om_gui, form.NAME) self.om_gui.pt.addHiddenNote( "printed", "%s %s" % (form.NAME, dl.dent_inits)) self.om_gui.updateHiddenNotesLabel() if __name__ == "__main__": from openmolar.settings import localsettings from openmolar.qt4gui import maingui from openmolar.dbtools import patient_class os.chdir(os.path.expanduser("~")) # for save pdf localsettings.initiate() localsettings.station = "reception" # prevent no clinician popup app = QtGui.QApplication([]) om_gui = maingui.OpenmolarGui() om_gui.pt = patient_class.patient(2981) p = GP17Printer(om_gui) p.test_print()