feat: Add delete policy in recon page and system operation log.
This commit is contained in:
@@ -116,5 +116,8 @@
|
|||||||
},
|
},
|
||||||
"patientlist": {
|
"patientlist": {
|
||||||
"expire": "7"
|
"expire": "7"
|
||||||
|
},
|
||||||
|
"reconlist": {
|
||||||
|
"expire": "30"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,6 +269,11 @@ void DeviceManager::initGUI(bool aIsInitSucceed)
|
|||||||
//process expired patient list
|
//process expired patient list
|
||||||
QDate date = QDate::currentDate().addDays(-JsonObject::Instance()->getPatientListExpireDays());
|
QDate date = QDate::currentDate().addDays(-JsonObject::Instance()->getPatientListExpireDays());
|
||||||
SQLHelper::exec(QString("DELETE FROM Patient WHERE AddDate <= %1").arg(date.toString("yyyy-MM-dd")));
|
SQLHelper::exec(QString("DELETE FROM Patient WHERE AddDate <= %1").arg(date.toString("yyyy-MM-dd")));
|
||||||
|
|
||||||
|
//process expired scan list
|
||||||
|
date = QDate::currentDate().addDays(-JsonObject::Instance()->getScanListExpireDays());
|
||||||
|
SQLHelper::exec(QString("DELETE FROM Scan WHERE ScanDateTime <= \"%1\"").arg(date.toString("yyyy-MM-dd")));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceManager::processInitializeProgress(const QString& aProgress)
|
void DeviceManager::processInitializeProgress(const QString& aProgress)
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ ScanSearchCriteriaForm::ScanSearchCriteriaForm(QWidget *parent)
|
|||||||
ui->mLBBeginDate->setUpdatesEnabled(true);
|
ui->mLBBeginDate->setUpdatesEnabled(true);
|
||||||
ui->mLBBeginDate->setText(QDate::currentDate().toString("yyyy-MM-dd"));
|
ui->mLBBeginDate->setText(QDate::currentDate().toString("yyyy-MM-dd"));
|
||||||
|
|
||||||
|
ui->mBtnAll->setText(tr("Last %1 days").arg(JsonObject::Instance()->getScanListExpireDays()));
|
||||||
|
|
||||||
auto endBox = new ListBox(this);
|
auto endBox = new ListBox(this);
|
||||||
// endBox->setSmallBox(true);
|
// endBox->setSmallBox(true);
|
||||||
ui->verticalLayoutDate->replaceWidget(ui->mLBEndDate,endBox);
|
ui->verticalLayoutDate->replaceWidget(ui->mLBEndDate,endBox);
|
||||||
@@ -139,6 +141,7 @@ ScanSearchCriteriaForm::ScanSearchCriteriaForm(QWidget *parent)
|
|||||||
});
|
});
|
||||||
connect(EventCenter::Default(),&EventCenter::ReloadLanguage,[=](){
|
connect(EventCenter::Default(),&EventCenter::ReloadLanguage,[=](){
|
||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
|
ui->mBtnAll->setText(tr("Last %1 days").arg(JsonObject::Instance()->getScanListExpireDays()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ void JsonObject::init()
|
|||||||
mDmsSimulator = getBool("dms","simulator");
|
mDmsSimulator = getBool("dms","simulator");
|
||||||
mOperationLogExpireDays = QString(getJsonString("operatorlog", "expire")).toInt();
|
mOperationLogExpireDays = QString(getJsonString("operatorlog", "expire")).toInt();
|
||||||
mPatientListExpireDays = QString(getJsonString("patientlist", "expire")).toInt();
|
mPatientListExpireDays = QString(getJsonString("patientlist", "expire")).toInt();
|
||||||
|
mScanListExpireDays = QString(getJsonString("reconlist", "expire")).toInt();
|
||||||
|
|
||||||
mWorklistHost.ae = QString(getJsonString("worklist", "ae"));
|
mWorklistHost.ae = QString(getJsonString("worklist", "ae"));
|
||||||
mWorklistHost.ip = QString(getJsonString("worklist", "ip"));
|
mWorklistHost.ip = QString(getJsonString("worklist", "ip"));
|
||||||
@@ -647,6 +648,11 @@ int JsonObject::getPatientListExpireDays()
|
|||||||
return mPatientListExpireDays;
|
return mPatientListExpireDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int JsonObject::getScanListExpireDays()
|
||||||
|
{
|
||||||
|
return mScanListExpireDays;
|
||||||
|
}
|
||||||
|
|
||||||
bool JsonObject::getMppsOpen()
|
bool JsonObject::getMppsOpen()
|
||||||
{
|
{
|
||||||
return mMppsOpen;
|
return mMppsOpen;
|
||||||
|
|||||||
@@ -124,6 +124,8 @@ public:
|
|||||||
int getOperationLogExpireDays();
|
int getOperationLogExpireDays();
|
||||||
int getPatientListExpireDays();
|
int getPatientListExpireDays();
|
||||||
|
|
||||||
|
int getScanListExpireDays();
|
||||||
|
|
||||||
QString getReconTransferPath();
|
QString getReconTransferPath();
|
||||||
|
|
||||||
bool getScanCanWithoutRecon();
|
bool getScanCanWithoutRecon();
|
||||||
@@ -179,6 +181,7 @@ private:
|
|||||||
int mDefaultProtocal;
|
int mDefaultProtocal;
|
||||||
int mOperationLogExpireDays;
|
int mOperationLogExpireDays;
|
||||||
int mPatientListExpireDays;
|
int mPatientListExpireDays;
|
||||||
|
int mScanListExpireDays;
|
||||||
|
|
||||||
host mWorklistHost;
|
host mWorklistHost;
|
||||||
host mPacsHost;
|
host mPacsHost;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "SystemOperationLog.h"
|
#include "SystemOperationLog.h"
|
||||||
|
|
||||||
#include "appvals/AppGlobalValues.h"
|
#include "appvals/AppGlobalValues.h"
|
||||||
|
#include "json/jsonobject.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
|
||||||
@@ -63,3 +64,23 @@ void SystemOperationLog::log(const QString &aOperationText, const QDateTime& aOp
|
|||||||
reloadFile();
|
reloadFile();
|
||||||
mStreamOut << aOperationDate.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<aOperationText<<endl;
|
mStreamOut << aOperationDate.toString(Qt::DateFormat::ISODateWithMs).replace("T","\t")<<"\t"<<aOperationText<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SystemOperationLog::cleanHistoryLog()
|
||||||
|
{
|
||||||
|
int expireDays = JsonObject::Instance()->getOperationLogExpireDays();
|
||||||
|
QDateTime currentDate = QDateTime::currentDateTime();
|
||||||
|
QDateTime deleteDate = currentDate.addDays(-expireDays);
|
||||||
|
|
||||||
|
QDir dir(LOG_DIR);
|
||||||
|
QStringList logFiles = dir.entryList(QStringList() << "*.log", QDir::Files);
|
||||||
|
for(const QString &logFile : logFiles)
|
||||||
|
{
|
||||||
|
QString filePath = LOG_DIR + "/" + logFile;
|
||||||
|
QFileInfo fileInfo(filePath);
|
||||||
|
QDateTime fileDate = fileInfo.created();
|
||||||
|
if (fileDate <= deleteDate)
|
||||||
|
{
|
||||||
|
QFile::remove(filePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public:
|
|||||||
SystemOperationLog();
|
SystemOperationLog();
|
||||||
~SystemOperationLog();
|
~SystemOperationLog();
|
||||||
void reloadFile();
|
void reloadFile();
|
||||||
|
static void cleanHistoryLog();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void log(const QString& aOperationText, const QDateTime& aOperationDate);
|
void log(const QString& aOperationText, const QDateTime& aOperationDate);
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ int main(int argc, char* argv[])
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
KeyboardManager::getInstance();
|
KeyboardManager::getInstance();
|
||||||
UserOperationLog::cleanHistoryLog();
|
UserOperationLog::cleanHistoryLog();
|
||||||
|
SystemOperationLog::cleanHistoryLog();
|
||||||
bool sqlConnected= SQLHelper::Open();
|
bool sqlConnected= SQLHelper::Open();
|
||||||
if (sqlConnected)
|
if (sqlConnected)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1655,6 +1655,10 @@ progress:99%</source>
|
|||||||
<source>Refresh</source>
|
<source>Refresh</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Last %1 days</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectFormWidget</name>
|
<name>SelectFormWidget</name>
|
||||||
|
|||||||
@@ -469,27 +469,27 @@
|
|||||||
<name>DeviceManager</name>
|
<name>DeviceManager</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="168"/>
|
<location filename="../device/DeviceManager.cpp" line="168"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="832"/>
|
<location filename="../device/DeviceManager.cpp" line="837"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="840"/>
|
<location filename="../device/DeviceManager.cpp" line="845"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1444"/>
|
<location filename="../device/DeviceManager.cpp" line="1449"/>
|
||||||
<source>DMS connection error</source>
|
<source>DMS connection error</source>
|
||||||
<translation type="unfinished">DMS失去连接</translation>
|
<translation type="unfinished">DMS失去连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="362"/>
|
<location filename="../device/DeviceManager.cpp" line="367"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="371"/>
|
<location filename="../device/DeviceManager.cpp" line="376"/>
|
||||||
<source>progress:%1%</source>
|
<source>progress:%1%</source>
|
||||||
<translation type="unfinished">进度:%1%</translation>
|
<translation type="unfinished">进度:%1%</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="376"/>
|
<location filename="../device/DeviceManager.cpp" line="381"/>
|
||||||
<source>Patient can leave.
|
<source>Patient can leave.
|
||||||
progress:%1%</source>
|
progress:%1%</source>
|
||||||
<translation type="unfinished">检查对象可以起身
|
<translation type="unfinished">检查对象可以起身
|
||||||
进度:%1%</translation>
|
进度:%1%</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="383"/>
|
<location filename="../device/DeviceManager.cpp" line="388"/>
|
||||||
<source>Data quality assessment in progress
|
<source>Data quality assessment in progress
|
||||||
progress:99%</source>
|
progress:99%</source>
|
||||||
<translation type="unfinished">数据质量判断中
|
<translation type="unfinished">数据质量判断中
|
||||||
@@ -497,8 +497,8 @@ progress:99%</source>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="257"/>
|
<location filename="../device/DeviceManager.cpp" line="257"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="893"/>
|
<location filename="../device/DeviceManager.cpp" line="898"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="901"/>
|
<location filename="../device/DeviceManager.cpp" line="906"/>
|
||||||
<source>Initialize Failed.</source>
|
<source>Initialize Failed.</source>
|
||||||
<translation type="unfinished">初始化失败</translation>
|
<translation type="unfinished">初始化失败</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -508,101 +508,101 @@ progress:99%</source>
|
|||||||
<translation type="unfinished">数据库连接失败,请重启设备后再试!</translation>
|
<translation type="unfinished">数据库连接失败,请重启设备后再试!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="318"/>
|
<location filename="../device/DeviceManager.cpp" line="323"/>
|
||||||
<source>Device is not ready, start scan operation failed!</source>
|
<source>Device is not ready, start scan operation failed!</source>
|
||||||
<translation type="unfinished">设备状态错误,无法开始检查流程</translation>
|
<translation type="unfinished">设备状态错误,无法开始检查流程</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="318"/>
|
<location filename="../device/DeviceManager.cpp" line="323"/>
|
||||||
<source>Device is not ready, start empty scan operation failed!</source>
|
<source>Device is not ready, start empty scan operation failed!</source>
|
||||||
<translation type="unfinished">设备状态错误,无法开始空水扫查</translation>
|
<translation type="unfinished">设备状态错误,无法开始空水扫查</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="436"/>
|
<location filename="../device/DeviceManager.cpp" line="441"/>
|
||||||
<source>Scan completed!</source>
|
<source>Scan completed!</source>
|
||||||
<translation type="unfinished">扫查结束</translation>
|
<translation type="unfinished">扫查结束</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="783"/>
|
<location filename="../device/DeviceManager.cpp" line="788"/>
|
||||||
<source>Error: </source>
|
<source>Error: </source>
|
||||||
<translation type="unfinished">错误: </translation>
|
<translation type="unfinished">错误: </translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="867"/>
|
<location filename="../device/DeviceManager.cpp" line="872"/>
|
||||||
<source>Start scan failed. Reason:time out.</source>
|
<source>Start scan failed. Reason:time out.</source>
|
||||||
<translation type="unfinished">扫查启动失败,原因:超时</translation>
|
<translation type="unfinished">扫查启动失败,原因:超时</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="878"/>
|
<location filename="../device/DeviceManager.cpp" line="883"/>
|
||||||
<source>Start scan failed. Reason:%1</source>
|
<source>Start scan failed. Reason:%1</source>
|
||||||
<translation type="unfinished">扫查启动失败,原因:%1</translation>
|
<translation type="unfinished">扫查启动失败,原因:%1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="903"/>
|
<location filename="../device/DeviceManager.cpp" line="908"/>
|
||||||
<source>Start CE Scan Failed.</source>
|
<source>Start CE Scan Failed.</source>
|
||||||
<translation type="unfinished">CE扫查启动失败</translation>
|
<translation type="unfinished">CE扫查启动失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="935"/>
|
<location filename="../device/DeviceManager.cpp" line="940"/>
|
||||||
<source>Data is currently being transmitted, please shut down later.</source>
|
<source>Data is currently being transmitted, please shut down later.</source>
|
||||||
<translation type="unfinished">数据传输中,请稍后再执行关机。</translation>
|
<translation type="unfinished">数据传输中,请稍后再执行关机。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="942"/>
|
<location filename="../device/DeviceManager.cpp" line="947"/>
|
||||||
<source>Shut down failed, please push emergency button to shutdown.</source>
|
<source>Shut down failed, please push emergency button to shutdown.</source>
|
||||||
<translation type="unfinished">关机失败,请按紧急按钮进行关机。</translation>
|
<translation type="unfinished">关机失败,请按紧急按钮进行关机。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1033"/>
|
<location filename="../device/DeviceManager.cpp" line="1038"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1043"/>
|
<location filename="../device/DeviceManager.cpp" line="1048"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1119"/>
|
<location filename="../device/DeviceManager.cpp" line="1124"/>
|
||||||
<source>Scan data transfer failed.</source>
|
<source>Scan data transfer failed.</source>
|
||||||
<translation type="unfinished">扫查数据上传失败</translation>
|
<translation type="unfinished">扫查数据上传失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1097"/>
|
<location filename="../device/DeviceManager.cpp" line="1102"/>
|
||||||
<source>Scan data transfer Succeeded!</source>
|
<source>Scan data transfer Succeeded!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1139"/>
|
<location filename="../device/DeviceManager.cpp" line="1144"/>
|
||||||
<source>Create empty scan data failed</source>
|
<source>Create empty scan data failed</source>
|
||||||
<translation type="unfinished">空水数据新增失败</translation>
|
<translation type="unfinished">空水数据新增失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1161"/>
|
<location filename="../device/DeviceManager.cpp" line="1166"/>
|
||||||
<source>Create scan data failed</source>
|
<source>Create scan data failed</source>
|
||||||
<translation type="unfinished">扫查数据新增失败</translation>
|
<translation type="unfinished">扫查数据新增失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1228"/>
|
<location filename="../device/DeviceManager.cpp" line="1233"/>
|
||||||
<source>Recon disconnected.</source>
|
<source>Recon disconnected.</source>
|
||||||
<translation type="unfinished">重建服务器已断开连接</translation>
|
<translation type="unfinished">重建服务器已断开连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1293"/>
|
<location filename="../device/DeviceManager.cpp" line="1298"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1308"/>
|
<location filename="../device/DeviceManager.cpp" line="1313"/>
|
||||||
<source>Open pump failed.</source>
|
<source>Open pump failed.</source>
|
||||||
<translation type="unfinished">排水阀打开失败</translation>
|
<translation type="unfinished">排水阀打开失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1325"/>
|
<location filename="../device/DeviceManager.cpp" line="1330"/>
|
||||||
<source>Recon error, can't start scan process</source>
|
<source>Recon error, can't start scan process</source>
|
||||||
<translation type="unfinished">重建服务器错误,无法开始检查流程</translation>
|
<translation type="unfinished">重建服务器错误,无法开始检查流程</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1366"/>
|
<location filename="../device/DeviceManager.cpp" line="1371"/>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1418"/>
|
<location filename="../device/DeviceManager.cpp" line="1423"/>
|
||||||
<source>Start auto locate failed</source>
|
<source>Start auto locate failed</source>
|
||||||
<translation type="unfinished">自动化定位启动失败</translation>
|
<translation type="unfinished">自动化定位启动失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1438"/>
|
<location filename="../device/DeviceManager.cpp" line="1443"/>
|
||||||
<source>The data quality is low, please restart the data scan.</source>
|
<source>The data quality is low, please restart the data scan.</source>
|
||||||
<translation type="unfinished">扫查数据质量较低,请重新开始检查流程</translation>
|
<translation type="unfinished">扫查数据质量较低,请重新开始检查流程</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../device/DeviceManager.cpp" line="1466"/>
|
<location filename="../device/DeviceManager.cpp" line="1471"/>
|
||||||
<source>Device reset failed, please contact maintenance person</source>
|
<source>Device reset failed, please contact maintenance person</source>
|
||||||
<translation type="unfinished">设备复位失败,请联系维修人员</translation>
|
<translation type="unfinished">设备复位失败,请联系维修人员</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -2540,6 +2540,12 @@ parameters
|
|||||||
<source>Clear Fields</source>
|
<source>Clear Fields</source>
|
||||||
<translation type="unfinished">清空</translation>
|
<translation type="unfinished">清空</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../forms/recon/ScanSearchCriteriaForm.cpp" line="31"/>
|
||||||
|
<location filename="../forms/recon/ScanSearchCriteriaForm.cpp" line="144"/>
|
||||||
|
<source>Last %1 days</source>
|
||||||
|
<translation type="unfinished">过去%1天</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SelectFormWidget</name>
|
<name>SelectFormWidget</name>
|
||||||
|
|||||||
Reference in New Issue
Block a user