2021-10-09 16:38:34 +08:00
|
|
|
#ifndef EDITPATIENTFORM_H
|
|
|
|
|
#define EDITPATIENTFORM_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class EditPatientForm;
|
|
|
|
|
}
|
2021-10-12 14:11:19 +08:00
|
|
|
|
|
|
|
|
#define ADD_PATIENT()\
|
2021-10-12 10:28:30 +08:00
|
|
|
ADD_PATIENT_PROPERTY(ID)\
|
|
|
|
|
ADD_PATIENT_PROPERTY(Name)\
|
|
|
|
|
ADD_PATIENT_PROPERTY(BirthDate)\
|
|
|
|
|
ADD_PATIENT_PROPERTY(Sex)\
|
2021-12-03 14:21:21 +08:00
|
|
|
ADD_PATIENT_PROPERTY(AddDate)\
|
2021-10-12 10:28:30 +08:00
|
|
|
ADD_PATIENT_PROPERTY(Comment)\
|
2021-11-03 16:19:11 +08:00
|
|
|
ADD_PATIENT_PROPERTY(Flag)
|
2021-10-09 16:38:34 +08:00
|
|
|
|
2021-10-12 14:11:19 +08:00
|
|
|
#define EDIT_PATIENT()\
|
|
|
|
|
ADD_PATIENT_PROPERTY(PatientUID)\
|
|
|
|
|
ADD_PATIENT()
|
|
|
|
|
|
2021-10-12 10:28:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum PatientInformationEnum{
|
|
|
|
|
#define ADD_PATIENT_PROPERTY(val) val,
|
|
|
|
|
EDIT_PATIENT()
|
|
|
|
|
#undef ADD_PATIENT_PROPERTY
|
|
|
|
|
};
|
|
|
|
|
|
2022-04-02 14:49:10 +08:00
|
|
|
/**
|
|
|
|
|
* @brief this class was designed to be a edit form,
|
|
|
|
|
* but now has been change to a detail display class.
|
|
|
|
|
*/
|
2021-10-12 17:40:23 +08:00
|
|
|
class PatientInformation:public QObject{
|
|
|
|
|
Q_OBJECT
|
2021-10-12 10:28:30 +08:00
|
|
|
public:
|
|
|
|
|
#define ADD_PATIENT_PROPERTY(val) QString val;
|
|
|
|
|
EDIT_PATIENT();
|
|
|
|
|
#undef ADD_PATIENT_PROPERTY
|
2021-11-03 16:19:11 +08:00
|
|
|
PatientInformation(){
|
|
|
|
|
this->Flag = QString("0");
|
|
|
|
|
}
|
2021-10-12 17:40:23 +08:00
|
|
|
PatientInformation* Copy()
|
|
|
|
|
{
|
|
|
|
|
PatientInformation* n=new PatientInformation;
|
|
|
|
|
n->PatientUID = this->PatientUID;
|
|
|
|
|
n->ID = this->ID;
|
|
|
|
|
n->Name = this->Name;
|
|
|
|
|
n->BirthDate = this->BirthDate;
|
|
|
|
|
n->Sex = this->Sex;
|
|
|
|
|
n->Comment = this->Comment;
|
|
|
|
|
return n;
|
|
|
|
|
}
|
2021-10-12 10:28:30 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class QToolButton;
|
2021-10-09 16:38:34 +08:00
|
|
|
class EditPatientForm : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit EditPatientForm(QWidget *parent = nullptr);
|
|
|
|
|
~EditPatientForm();
|
2021-10-12 10:28:30 +08:00
|
|
|
void setPatientInformation(PatientInformation * information);
|
2021-10-12 10:55:51 +08:00
|
|
|
PatientInformation * getPatientInformation(){
|
|
|
|
|
return &store;
|
|
|
|
|
}
|
2021-10-12 10:28:30 +08:00
|
|
|
void clearPatientInformation();
|
|
|
|
|
void storePatientInformation();
|
2022-04-02 14:49:10 +08:00
|
|
|
|
|
|
|
|
signals:
|
2021-12-03 14:21:21 +08:00
|
|
|
void editAccept(PatientInformation * detail,bool & accept);
|
2021-11-03 16:19:11 +08:00
|
|
|
void editCancel();
|
2022-01-12 11:24:37 +08:00
|
|
|
signals:
|
|
|
|
|
void hideBtnClicked();
|
2021-10-09 16:38:34 +08:00
|
|
|
private:
|
|
|
|
|
Ui::EditPatientForm *ui;
|
2021-10-12 10:28:30 +08:00
|
|
|
QString currentPatientUID;
|
2021-12-03 14:21:21 +08:00
|
|
|
QString AddDate;
|
2021-10-12 10:28:30 +08:00
|
|
|
PatientInformation store;
|
2021-10-09 16:38:34 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // EDITPATIENTFORM_H
|