From 298e6c6c531d33450c83392f8cdd275acbe362b2 Mon Sep 17 00:00:00 2001 From: sunwen Date: Tue, 19 Sep 2023 14:59:51 +0800 Subject: [PATCH] Fix auto delete patient list bug. --- src/forms/select/SelectFormWidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/forms/select/SelectFormWidget.cpp b/src/forms/select/SelectFormWidget.cpp index c657488..7b4ce57 100644 --- a/src/forms/select/SelectFormWidget.cpp +++ b/src/forms/select/SelectFormWidget.cpp @@ -26,12 +26,16 @@ SelectFormWidget::SelectFormWidget(QWidget* parent) , mBtnAccount(new QToolButton(this)) , mBtnWorklist(new QToolButton(this)) , mBtnAdd(new QToolButton(this)) -, mBtnTurnOff(new QToolButton(this)) , mBtnSelect(new QToolButton(this)) +, mBtnTurnOff(new QToolButton(this)) , mPatTable(new SlideTableView(this)) , mModel(nullptr) , patientDetailForm(new PatientDetailForm(this)) { + //process expired patient list + QDate date = QDate::currentDate().addDays(-JsonObject::Instance()->getPatientListExpireDays()); + SQLHelper::exec(QString("DELETE FROM Patient WHERE AddDate <= '%1'").arg(date.toString("yyyy-MM-dd"))); + //init command bar auto layout = new QHBoxLayout(); ui->commandWidget->setLayout(layout);