Add use scanner.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user