Refactor forms select package.
This commit is contained in:
51
src/forms/select/PatientInformation.h
Normal file
51
src/forms/select/PatientInformation.h
Normal file
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Created by Krad on 2022/6/14.
|
||||
//
|
||||
|
||||
#ifndef GUI_PATIENTINFORMATION_H
|
||||
#define GUI_PATIENTINFORMATION_H
|
||||
#define ADD_PATIENT()\
|
||||
ADD_PATIENT_PROPERTY(ID)\
|
||||
ADD_PATIENT_PROPERTY(Name)\
|
||||
ADD_PATIENT_PROPERTY(BirthDate)\
|
||||
ADD_PATIENT_PROPERTY(Sex)\
|
||||
ADD_PATIENT_PROPERTY(AddDate)\
|
||||
ADD_PATIENT_PROPERTY(Comment)\
|
||||
ADD_PATIENT_PROPERTY(Flag)
|
||||
|
||||
#define EDIT_PATIENT()\
|
||||
ADD_PATIENT_PROPERTY(PatientUID)\
|
||||
ADD_PATIENT()
|
||||
|
||||
enum PatientInformationEnum{
|
||||
#define ADD_PATIENT_PROPERTY(val) val,
|
||||
EDIT_PATIENT()
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief this class was designed to be a edit form,
|
||||
* but now has been change to a detail display class.
|
||||
*/
|
||||
class PatientInformation:public QObject{
|
||||
Q_OBJECT
|
||||
public:
|
||||
#define ADD_PATIENT_PROPERTY(val) QString val;
|
||||
EDIT_PATIENT();
|
||||
#undef ADD_PATIENT_PROPERTY
|
||||
PatientInformation(){
|
||||
this->Flag = QString("0");
|
||||
}
|
||||
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;
|
||||
}
|
||||
};
|
||||
#endif //GUI_PATIENTINFORMATION_H
|
||||
Reference in New Issue
Block a user