Patient table change, add order by add date
This commit is contained in:
@@ -11,12 +11,14 @@ EditPatientForm::EditPatientForm(QWidget *parent) :
|
||||
ui(new Ui::EditPatientForm)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->lbl_Sex->setText(tr("Gender"));
|
||||
QHBoxLayout* sexlayout =new QHBoxLayout(ui->sexpanelwidget);
|
||||
sexlayout->setMargin(6);
|
||||
ADD_TOOL_SIZE_BTN_TO_LAYOUT(F,":/icons/female_d.png",30, sexlayout);
|
||||
ADD_TOOL_SIZE_BTN_TO_LAYOUT(M,":/icons/male_d.png", 30,sexlayout);
|
||||
// btnFemale->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
// btnMale->setToolButtonStyle(Qt::ToolButtonIconOnly);
|
||||
|
||||
btnF->setObjectName("sexBtn");
|
||||
btnM->setObjectName("sexBtn");
|
||||
btnF->setText("Female");
|
||||
@@ -53,8 +55,9 @@ EditPatientForm::EditPatientForm(QWidget *parent) :
|
||||
if (ui->tbx_ID->text().isEmpty())return;
|
||||
if (ui->tbx_Name->text().isEmpty())return;
|
||||
storePatientInformation();
|
||||
this->setEditEnable(false);
|
||||
emit editAccept(getPatientInformation());
|
||||
bool result = true;
|
||||
emit editAccept(getPatientInformation(), result);
|
||||
if (result) this->setEditEnable(false);
|
||||
});
|
||||
ui->tbx_Dob->setDisplayFormat("yyyy/MM/dd");
|
||||
}
|
||||
@@ -74,6 +77,7 @@ void EditPatientForm::setPatientInformation(PatientInformation *information) {
|
||||
btnFemale->setChecked(information->Sex=="F");
|
||||
btnMale->setChecked(information->Sex!="F");
|
||||
currentPatientUID = information->PatientUID;
|
||||
AddDate = information->AddDate;
|
||||
storePatientInformation();
|
||||
}
|
||||
}
|
||||
@@ -86,6 +90,7 @@ void EditPatientForm::clearPatientInformation() {
|
||||
btnMale->setChecked(false);
|
||||
ui->rtbx_Comment->setText("");
|
||||
currentPatientUID = "";
|
||||
AddDate = "";
|
||||
}
|
||||
|
||||
void EditPatientForm::setEditEnable(bool enable) {
|
||||
@@ -108,6 +113,7 @@ void EditPatientForm::setEditEnable(bool enable) {
|
||||
|
||||
void EditPatientForm::storePatientInformation() {
|
||||
store.PatientUID =currentPatientUID;
|
||||
store.AddDate = AddDate;
|
||||
store.ID = ui->tbx_ID->text();
|
||||
store.BirthDate = ui->tbx_Dob->date().toString("yyyy-MM-dd");
|
||||
store.Name = ui->tbx_Name->text();
|
||||
@@ -118,6 +124,7 @@ void EditPatientForm::storePatientInformation() {
|
||||
|
||||
void EditPatientForm::restorePatientInformation() {
|
||||
currentPatientUID = store.PatientUID;
|
||||
AddDate = store.AddDate;
|
||||
ui->tbx_ID->setText(store.ID);
|
||||
ui->tbx_Dob->setDate(QDate::fromString(store.BirthDate,"yyyy-MM-dd"));
|
||||
ui->tbx_Name->setText(store.Name);
|
||||
|
||||
Reference in New Issue
Block a user