Using SQLHelper to retrieve data to dataView, add simple control to edit patient panel.
This commit is contained in:
@@ -6,7 +6,31 @@
|
||||
namespace Ui {
|
||||
class EditPatientForm;
|
||||
}
|
||||
#define EDIT_PATIENT()\
|
||||
ADD_PATIENT_PROPERTY(PatientUID)\
|
||||
ADD_PATIENT_PROPERTY(ID)\
|
||||
ADD_PATIENT_PROPERTY(Name)\
|
||||
ADD_PATIENT_PROPERTY(BirthDate)\
|
||||
ADD_PATIENT_PROPERTY(Sex)\
|
||||
ADD_PATIENT_PROPERTY(Comment)\
|
||||
|
||||
|
||||
|
||||
|
||||
enum PatientInformationEnum{
|
||||
#define ADD_PATIENT_PROPERTY(val) val,
|
||||
EDIT_PATIENT()
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
};
|
||||
|
||||
class PatientInformation{
|
||||
public:
|
||||
#define ADD_PATIENT_PROPERTY(val) QString val;
|
||||
EDIT_PATIENT();
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
};
|
||||
|
||||
class QToolButton;
|
||||
class EditPatientForm : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -14,9 +38,18 @@ class EditPatientForm : public QWidget
|
||||
public:
|
||||
explicit EditPatientForm(QWidget *parent = nullptr);
|
||||
~EditPatientForm();
|
||||
|
||||
void setPatientInformation(PatientInformation * information);
|
||||
void clearPatientInformation();
|
||||
void storePatientInformation();
|
||||
void restorePatientInformation();
|
||||
void setEditEnable(bool enable);
|
||||
private:
|
||||
Ui::EditPatientForm *ui;
|
||||
QString currentPatientUID;
|
||||
PatientInformation store;
|
||||
bool editEnable=false;
|
||||
QToolButton* btnEditAccept;
|
||||
QToolButton* btnEditCancel;
|
||||
};
|
||||
|
||||
#endif // EDITPATIENTFORM_H
|
||||
|
||||
Reference in New Issue
Block a user