def raise_new_appt_dialog(self):
     dl = NewApptDialog(self)
     if dl.exec_():
         print "insert new appointment"
         ix = self.model.insert_appointment(
             SETTINGS.current_patient.patient_id, dl.trt1, dl.trt2,
             dl.length, dl.memo, dl.selected_clinician_id)
         self.model.refresh()
         if dl.schedule_now:
             print "and schedule appointment where ix='%s' now" % ix
 def raise_new_appt_dialog(self):
     dl = NewApptDialog(self)
     if dl.exec_():
         print "insert new appointment"
         ix = self.model.insert_appointment(
             SETTINGS.current_patient.patient_id,
             dl.trt1,
             dl.trt2,
             dl.length,
             dl.memo,
             dl.selected_clinician_id
             )
         self.model.refresh()
         if dl.schedule_now:
             print "and schedule appointment where ix='%s' now"% ix
 def raise_modify_appt_dialog(self):
     appt = self.selected_appointment()
     if appt is None:
         return
     dl = NewApptDialog(self)
     dl.set_appt_params(appt)
     if dl.exec_():
         print "modify appointment", appt
         result = self.model.modify_appointment(appt.apptix, dl.trt1,
                                                dl.trt2, dl.length, dl.memo,
                                                dl.selected_clinician_id)
         self.model.refresh()
         if not result:
             raise IOError("unable to modify appointment")
         if dl.schedule_now:
             print "and schedule appointment where ix='%s' now" % ix
 def raise_modify_appt_dialog(self):
     appt = self.selected_appointment()
     if appt is None:
         return
     dl = NewApptDialog(self)
     dl.set_appt_params(appt)
     if dl.exec_():
         print "modify appointment", appt
         result = self.model.modify_appointment(
             appt.apptix,
             dl.trt1,
             dl.trt2,
             dl.length,
             dl.memo,
             dl.selected_clinician_id
             )
         self.model.refresh()
         if not result:
             raise IOError ("unable to modify appointment")
         if dl.schedule_now:
             print "and schedule appointment where ix='%s' now"% ix