Add use scanner.
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "network/GetIPDialog.h"
|
||||
#include "network/GetRouteDialog.h"
|
||||
|
||||
#include "dicom/WorkListManager.h"
|
||||
|
||||
#include "windows/LoginDialog.h"
|
||||
#include "screensaver/ScreenSaverWindow.h"
|
||||
|
||||
@@ -46,6 +48,7 @@ DialogManager::DialogManager()
|
||||
, mOperationMessageDialog(nullptr)
|
||||
, mSyncDialog(nullptr)
|
||||
, mTopWidget(nullptr)
|
||||
, mGetWorkListDialog(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -57,6 +60,7 @@ void DialogManager::init(QWidget* aParent) {
|
||||
connect(EventCenter::Default(), &EventCenter::InvokeOperationProgress,this,&DialogManager::invokeOperationProgress);
|
||||
connect(EventCenter::Default(), &EventCenter::InvokeOperationPending,this,&DialogManager::invokeOperationPending);
|
||||
connect(EventCenter::Default(), &EventCenter::InvokeOperationEnd,this,&DialogManager::invokeOperationEnd);
|
||||
connect(EventCenter::Default(), &EventCenter::InputWorkListSearchValue,this,&DialogManager::receiveWorkListInput);
|
||||
MultyMessageDialogManager::getInstance()->setDialogParent(aParent);
|
||||
mTopWidget = aParent;
|
||||
mScreenSaverWindow = new ScreenSaverWindow();
|
||||
@@ -342,16 +346,40 @@ int DialogManager::requestPatientConfirm(PatientInformation* patientInf, int typ
|
||||
return ret;
|
||||
}
|
||||
|
||||
int DialogManager::requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView)
|
||||
int DialogManager::requestGetWorkList()
|
||||
{
|
||||
GetWorkListDialog dialog(aModel, aTableView, mTopWidget);
|
||||
GetWorkListDialog dialog(WorkListManager::getInstance()->getTableModel(), WorkListManager::getInstance()->getTableView(), mTopWidget);
|
||||
mGetWorkListDialog = &dialog;
|
||||
setTopWidget(&dialog);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
int ret = dialog.exec();
|
||||
releaseTopWidget(&dialog);
|
||||
mGetWorkListDialog = nullptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int DialogManager::requestGetWorkList(const QString& aInputValue)
|
||||
{
|
||||
GetWorkListDialog dialog(WorkListManager::getInstance()->getTableModel(), WorkListManager::getInstance()->getTableView(), mTopWidget);
|
||||
mGetWorkListDialog = &dialog;
|
||||
setTopWidget(&dialog);
|
||||
dialog.setWindowModality(Qt::WindowModal);
|
||||
mGetWorkListDialog->search(aInputValue);
|
||||
int ret = dialog.exec();
|
||||
releaseTopWidget(&dialog);
|
||||
mGetWorkListDialog = nullptr;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DialogManager::receiveWorkListInput(QObject *parent, QObject *msg)
|
||||
{
|
||||
QString inputValue = *(QString*)msg;
|
||||
if(mGetWorkListDialog == nullptr)
|
||||
{
|
||||
requestGetWorkList(inputValue);
|
||||
}
|
||||
}
|
||||
|
||||
void DialogManager::raiseDeviceInfo(QObject* parent, QObject* aInfoData)
|
||||
{
|
||||
QPair<QString, unsigned int>* infoData = (QPair<QString, unsigned int>*)(aInfoData);
|
||||
|
||||
@@ -18,6 +18,7 @@ class QTableView;
|
||||
class PatientInformation;
|
||||
class LoginDialog;
|
||||
class ScreenSaverWindow;
|
||||
class GetWorkListDialog;
|
||||
|
||||
enum MessageLevel:unsigned int;
|
||||
|
||||
@@ -44,8 +45,8 @@ public:
|
||||
|
||||
~DialogManager() override;
|
||||
|
||||
void init(QWidget* aParent);
|
||||
void requestLogin(QWidget* aParent);
|
||||
void init(QWidget* aParent);
|
||||
void requestLogin(QWidget* aParent);
|
||||
void requestScreenSaverPlay();
|
||||
void requestScreenSaverStop(bool aIsStopLocker = false);
|
||||
DialogResult requestResetAdminPwd();
|
||||
@@ -62,7 +63,8 @@ public:
|
||||
int requestEditDicomConfig();
|
||||
DialogResult requestInputAdminPasswd();
|
||||
int requestEditNetworkConfig();
|
||||
int requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView);
|
||||
int requestGetWorkList();
|
||||
int requestGetWorkList(const QString& aInputValue);
|
||||
int requestPatientConfirm(PatientInformation* patientInf, int type);
|
||||
DialogResult requestEditIpAndNetMask();
|
||||
DialogResult requestEditIpAndNetMask(const QStringList& aEditData);
|
||||
@@ -84,6 +86,7 @@ private:
|
||||
void clearMessageDialog();
|
||||
void setTopWidget(QWidget* widget);
|
||||
void releaseTopWidget(QWidget* expectedTopWidget);
|
||||
void receiveWorkListInput(QObject *parent, QObject *msg);
|
||||
|
||||
signals:
|
||||
void loginDialogShown();
|
||||
@@ -95,6 +98,7 @@ private:
|
||||
QPointer<GUIMessageDialog> mSyncDialog;
|
||||
QWidget* mTopWidget;
|
||||
std::mutex mMutex;
|
||||
GetWorkListDialog* mGetWorkListDialog;
|
||||
int mDialogCount = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <QSqlRecord>
|
||||
#include <QRadioButton>
|
||||
#include <QButtonGroup>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include "components/ULineEdit.h"
|
||||
#include "action/GetWorkListAction.h"
|
||||
@@ -27,11 +28,13 @@ GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTa
|
||||
, mEditEndLine(new QLabel(mContentWidget))
|
||||
, mPatientSelectTable(new QTableView(mContentWidget))
|
||||
, mMode(PatientSearchMode)
|
||||
, mSearchMode(ByAccessionNumber)
|
||||
, mPatientSelectModel(new QStandardItemModel(mContentWidget))
|
||||
, mSqlModel(aSqlModel)
|
||||
, mTableView(aTableView)
|
||||
, mSearchedPatients()
|
||||
, mRadioButtonArea(new QWidget(mContentWidget))
|
||||
, mIsAutoSearch(false)
|
||||
{
|
||||
initializeContentWidgets();
|
||||
GetWorkListAction* action = qobject_cast<GetWorkListAction*>(getAction());
|
||||
@@ -70,6 +73,7 @@ void GetWorkListDialog::initializeContentWidgets()
|
||||
mPatientId->setVisible(false);
|
||||
mAccessionNumText->setVisible(true);
|
||||
mAccessionNumber->setVisible(true);
|
||||
mSearchMode = ByAccessionNumber;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -77,6 +81,7 @@ void GetWorkListDialog::initializeContentWidgets()
|
||||
mAccessionNumber->setVisible(false);
|
||||
mPatientIDText->setVisible(true);
|
||||
mPatientId->setVisible(true);
|
||||
mSearchMode = ByPatientId;
|
||||
}
|
||||
});
|
||||
//Accession Nummber
|
||||
@@ -122,6 +127,20 @@ void GetWorkListDialog::initializeContentWidgets()
|
||||
mErrorLabel->hide();
|
||||
}
|
||||
|
||||
void GetWorkListDialog::search(const QString& aInput)
|
||||
{
|
||||
switch(mSearchMode)
|
||||
{
|
||||
case ByAccessionNumber:
|
||||
mAccessionNumber->insert(aInput);
|
||||
break;
|
||||
case ByPatientId:
|
||||
mPatientId->insert(aInput);
|
||||
break;
|
||||
}
|
||||
mIsAutoSearch = true;
|
||||
}
|
||||
|
||||
bool GetWorkListDialog::updateReferenceData()
|
||||
{
|
||||
if(mMode == PatientSelectMode)
|
||||
@@ -257,3 +276,13 @@ void GetWorkListDialog::insertPatient(PatientInformationPointer aPatient)
|
||||
mTableView->selectRow(0);
|
||||
LOG_USER_OPERATION(QString("Add Patient, ID:%1").arg(aPatient->ID));
|
||||
}
|
||||
|
||||
void GetWorkListDialog::showEvent(QShowEvent *aEvent)
|
||||
{
|
||||
if(mIsAutoSearch)
|
||||
{
|
||||
mBtnOk->click();
|
||||
}
|
||||
AsyncActionDialog::showEvent(aEvent);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@ enum GetWorkListDialogMode
|
||||
PatientSearchMode = 0, PatientSelectMode
|
||||
};
|
||||
|
||||
enum WorkListSearchMode
|
||||
{
|
||||
ByAccessionNumber = 0, ByPatientId
|
||||
};
|
||||
|
||||
class GetWorkListDialog : public AsyncActionDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -22,9 +27,11 @@ class GetWorkListDialog : public AsyncActionDialog
|
||||
public:
|
||||
explicit GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTableView, QWidget* aParent = nullptr, Qt::WindowFlags aFlags = Qt::WindowFlags());
|
||||
~GetWorkListDialog() override;
|
||||
void search(const QString& aInput);
|
||||
|
||||
protected:
|
||||
bool updateReferenceData() override;
|
||||
void showEvent(QShowEvent *aEvent) override;
|
||||
|
||||
private:
|
||||
void initializeContentWidgets();
|
||||
@@ -42,11 +49,13 @@ private:
|
||||
QLabel* mEditEndLine;
|
||||
QTableView* mPatientSelectTable;
|
||||
GetWorkListDialogMode mMode;
|
||||
WorkListSearchMode mSearchMode;
|
||||
QStandardItemModel* mPatientSelectModel;
|
||||
QSqlTableModel* mSqlModel;
|
||||
QTableView* mTableView;
|
||||
QList<PatientInformationPointer> mSearchedPatients;
|
||||
QWidget* mRadioButtonArea;
|
||||
bool mIsAutoSearch;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,44 @@
|
||||
#include <QDebug>
|
||||
#include <QDate>
|
||||
|
||||
WorkListManager* WorkListManager::getInstance()
|
||||
{
|
||||
static WorkListManager instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void WorkListManager::setTableModel(QSqlTableModel* aModel)
|
||||
{
|
||||
mTableModel = aModel;
|
||||
}
|
||||
|
||||
void WorkListManager::setTableView(QTableView* aTableView)
|
||||
{
|
||||
mTableView = aTableView;
|
||||
}
|
||||
|
||||
QSqlTableModel* WorkListManager::getTableModel()
|
||||
{
|
||||
return mTableModel;
|
||||
}
|
||||
|
||||
QTableView* WorkListManager::getTableView()
|
||||
{
|
||||
return mTableView;
|
||||
}
|
||||
|
||||
void WorkListManager::setSearchString(const QString& aSearchString)
|
||||
{
|
||||
mSearchString += aSearchString;
|
||||
}
|
||||
|
||||
QString WorkListManager::getSearchString()
|
||||
{
|
||||
QString temp = mSearchString;
|
||||
mSearchString.clear();
|
||||
return temp;
|
||||
}
|
||||
|
||||
WorkListManager::WorkListManager()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -6,14 +6,32 @@
|
||||
|
||||
#include "forms/select/PatientInformation.h"
|
||||
|
||||
class QSqlTableModel;
|
||||
class QTableView;
|
||||
|
||||
class WorkListManager
|
||||
{
|
||||
public:
|
||||
WorkListManager();
|
||||
~WorkListManager();
|
||||
|
||||
static WorkListManager* getInstance();
|
||||
static QList<PatientInformationPointer> getPatientFromWorkList(const QString& aAccessionNum, const QString& aPatientId);
|
||||
|
||||
void setTableModel(QSqlTableModel* aModel);
|
||||
void setTableView(QTableView* aTableView);
|
||||
void setSearchString(const QString& aSearchString);
|
||||
QString getSearchString();
|
||||
QSqlTableModel* getTableModel();
|
||||
QTableView* getTableView();
|
||||
|
||||
|
||||
private:
|
||||
WorkListManager();
|
||||
~WorkListManager();
|
||||
|
||||
private:
|
||||
QSqlTableModel* mTableModel;
|
||||
QTableView* mTableView;
|
||||
QString mSearchString;
|
||||
|
||||
};
|
||||
|
||||
#endif //GUI_WORKLISTMANAGER_H
|
||||
|
||||
@@ -38,7 +38,9 @@ ADD_EVENT_VALUE(WarnStateFlagChange)\
|
||||
ADD_EVENT_VALUE(GUIErrorRaise)\
|
||||
ADD_EVENT_VALUE(DeviceInfoRaise)\
|
||||
ADD_EVENT_VALUE(RequestScreenSaver)\
|
||||
ADD_EVENT_VALUE(ReconConnectionUpdated)
|
||||
ADD_EVENT_VALUE(ReconConnectionUpdated)\
|
||||
ADD_EVENT_VALUE(InputWorkListSearchValue)\
|
||||
ADD_EVENT_VALUE(DoWorkListSearch)\
|
||||
|
||||
enum GUIEvents {
|
||||
#define ADD_EVENT_VALUE(val) val,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <QPainter>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
#include <QKeyEvent>
|
||||
#include <qdebug.h>
|
||||
|
||||
#include "forms/scan/PatientInformationForm.h"
|
||||
@@ -19,6 +20,7 @@
|
||||
#include "log/UserOperationLog.h"
|
||||
#include "json/jsonobject.h"
|
||||
#include "device/DeviceManager.h"
|
||||
#include "dicom/WorkListManager.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#else
|
||||
@@ -30,7 +32,7 @@ namespace{
|
||||
const size_t PREVIEW_COL = 140;
|
||||
const float PIXEL_SPACING = 1.5f;
|
||||
const float HALF_ROI_WIDTH = 100.0f;
|
||||
const unsigned int DRAINAGE_TIME = 30000;
|
||||
const unsigned int DRAINAGE_TIME = 180000; //3 minitues
|
||||
}
|
||||
|
||||
ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||
@@ -359,4 +361,59 @@ void ScanFormWidget::reloadLanguage(){
|
||||
mBtnDrainage->isChecked() ? mBtnDrainage->setText(tr("Drainaging")) : mBtnDrainage->setText(tr("Drainage"));
|
||||
}
|
||||
|
||||
|
||||
void ScanFormWidget::keyPressEvent(QKeyEvent* aEvent)
|
||||
{
|
||||
switch (aEvent->key())
|
||||
{
|
||||
case Qt::Key_0:
|
||||
case Qt::Key_1:
|
||||
case Qt::Key_2:
|
||||
case Qt::Key_3:
|
||||
case Qt::Key_4:
|
||||
case Qt::Key_5:
|
||||
case Qt::Key_6:
|
||||
case Qt::Key_7:
|
||||
case Qt::Key_8:
|
||||
case Qt::Key_9:
|
||||
case Qt::Key_A:
|
||||
case Qt::Key_B:
|
||||
case Qt::Key_C:
|
||||
case Qt::Key_D:
|
||||
case Qt::Key_E:
|
||||
case Qt::Key_F:
|
||||
case Qt::Key_G:
|
||||
case Qt::Key_H:
|
||||
case Qt::Key_I:
|
||||
case Qt::Key_J:
|
||||
case Qt::Key_K:
|
||||
case Qt::Key_L:
|
||||
case Qt::Key_M:
|
||||
case Qt::Key_N:
|
||||
case Qt::Key_O:
|
||||
case Qt::Key_P:
|
||||
case Qt::Key_Q:
|
||||
case Qt::Key_R:
|
||||
case Qt::Key_S:
|
||||
case Qt::Key_T:
|
||||
case Qt::Key_U:
|
||||
case Qt::Key_V:
|
||||
case Qt::Key_W:
|
||||
case Qt::Key_X:
|
||||
case Qt::Key_Y:
|
||||
case Qt::Key_Z:
|
||||
{
|
||||
WorkListManager::getInstance()->setSearchString(aEvent->text());
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Enter:
|
||||
case Qt::Key_Return:
|
||||
{
|
||||
QString text = WorkListManager::getInstance()->getSearchString();
|
||||
EventCenter::Default()->triggerEvent(InputWorkListSearchValue, nullptr, (QObject*)&text);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QWidget::keyPressEvent(aEvent);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ public:
|
||||
explicit ScanFormWidget(QWidget *parent = nullptr);
|
||||
~ScanFormWidget() override = default;
|
||||
void setPreviewing(bool val);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
PatientInformationForm* mPatInf= nullptr;
|
||||
bool mUnInited = true;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "log/UserOperationLog.h"
|
||||
#include "components/VerticalTextToolButton.h"
|
||||
#include "PatientAddDateDelegate.h"
|
||||
#include "dicom/WorkListManager.h"
|
||||
|
||||
SelectFormWidget::SelectFormWidget(QWidget* parent)
|
||||
: TabFormWidget(parent)
|
||||
@@ -73,6 +74,9 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
|
||||
|
||||
//first prepare buttons!
|
||||
prepareButtons(false);
|
||||
|
||||
//init WorkListManager table view
|
||||
WorkListManager::getInstance()->setTableView(mPatTable);
|
||||
}
|
||||
|
||||
void SelectFormWidget::prepareButtons(bool disableALL) {
|
||||
@@ -106,7 +110,7 @@ void SelectFormWidget::initGeneralButtons(QHBoxLayout *layout) {
|
||||
});
|
||||
connect(mBtnWorklist, &QToolButton::clicked, [&]()
|
||||
{
|
||||
DialogManager::Default()->requestGetWorkList(mModel, mPatTable);
|
||||
DialogManager::Default()->requestGetWorkList();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -248,6 +252,7 @@ void SelectFormWidget::initTableView(QHBoxLayout *contentLayout)
|
||||
|
||||
void SelectFormWidget::initDataModel() {//TODO:单独初始化预防SQL错误
|
||||
mModel = SQLHelper::getTable("Patient");
|
||||
WorkListManager::getInstance()->setTableModel(mModel);
|
||||
mModel->sort(mModel->record().indexOf("AddDate"), Qt::DescendingOrder);
|
||||
mModel->setEditStrategy(QSqlTableModel::OnManualSubmit);
|
||||
bool anonymousMode = JsonObject::Instance()->getAnonymousMode();
|
||||
|
||||
@@ -92,6 +92,14 @@ MainWindow::MainWindow(QWidget* aParent)
|
||||
this->update();
|
||||
QApplication::processEvents();
|
||||
});
|
||||
|
||||
connect(mTabWidget, &QTabWidget::currentChanged, this, [this](int aIndex)
|
||||
{
|
||||
if(aIndex == 1)
|
||||
{
|
||||
mTabWidget->widget(1)->setFocus();
|
||||
}
|
||||
});
|
||||
|
||||
GUIErrorHandle::Default()->init();
|
||||
QApplication::setActiveWindow(centralWidget());
|
||||
|
||||
Reference in New Issue
Block a user