Add start scan process from worklist and add scan protocal display in scan page.

This commit is contained in:
sunwen
2024-05-10 15:23:39 +08:00
parent 1f362d0340
commit 2c2b20ee55
7 changed files with 56 additions and 15 deletions

View File

@@ -400,7 +400,7 @@ DialogResult DialogManager::reuqestConfirmStartScan(PatientInformation* aPatient
dialog.setWindowModality(Qt::WindowModal);; dialog.setWindowModality(Qt::WindowModal);;
int ret = dialog.exec(); int ret = dialog.exec();
releaseTopWidget(&dialog); releaseTopWidget(&dialog);
return DialogResult(ret,QVariant("")); return DialogResult(ret,dialog.getSelectedProtocal());
} }
int DialogManager::requestPatientConfirm(PatientInformation* patientInf, int type) int DialogManager::requestPatientConfirm(PatientInformation* patientInf, int type)

View File

@@ -17,6 +17,7 @@
#include "action/GetWorkListAction.h" #include "action/GetWorkListAction.h"
#include "action/ActionCreator.h" #include "action/ActionCreator.h"
#include "log/UserOperationLog.h" #include "log/UserOperationLog.h"
#include "event/EventCenter.h"
GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTableView, QWidget* aParent, Qt::WindowFlags aFlags) GetWorkListDialog::GetWorkListDialog(QSqlTableModel* aSqlModel, QTableView* aTableView, QWidget* aParent, Qt::WindowFlags aFlags)
: AsyncActionDialog(ActionCreator::getAsyncAction<GetWorkListAction>("GetWorkListAction"),"Work List", aParent, aFlags) : AsyncActionDialog(ActionCreator::getAsyncAction<GetWorkListAction>("GetWorkListAction"),"Work List", aParent, aFlags)
@@ -256,6 +257,7 @@ void GetWorkListDialog::insertPatient(PatientInformationPointer aPatient)
mSqlModel->data(mSqlModel->index(i, accessionNumberIndex)) == aPatient->AccessionNumber) mSqlModel->data(mSqlModel->index(i, accessionNumberIndex)) == aPatient->AccessionNumber)
{ {
mTableView->selectRow(i); mTableView->selectRow(i);
EventCenter::Default()->triggerEvent(PatientSelected, nullptr, (QObject*)(aPatient.data()));
return; return;
} }
} }
@@ -276,6 +278,8 @@ void GetWorkListDialog::insertPatient(PatientInformationPointer aPatient)
} }
mTableView->selectRow(0); mTableView->selectRow(0);
LOG_USER_OPERATION(QString("Add Patient, ID:%1").arg(aPatient->ID)); LOG_USER_OPERATION(QString("Add Patient, ID:%1").arg(aPatient->ID));
EventCenter::Default()->triggerEvent(PatientSelected, nullptr, (QObject*)(aPatient.data()));
} }
void GetWorkListDialog::showEvent(QShowEvent *aEvent) void GetWorkListDialog::showEvent(QShowEvent *aEvent)

View File

@@ -8,7 +8,8 @@
StartScanProcessDialog::StartScanProcessDialog(QWidget *aParent) : StartScanProcessDialog::StartScanProcessDialog(QWidget *aParent) :
QDialog(aParent), QDialog(aParent),
mUI(new Ui::StartScanProcessDialog) mUI(new Ui::StartScanProcessDialog),
mScanProtocal(LSTAND)
{ {
mUI->setupUi(this); mUI->setupUi(this);
setObjectName("formDialog"); setObjectName("formDialog");
@@ -27,28 +28,33 @@ void StartScanProcessDialog::initButtons()
connect(mUI->mCancelButton, &QPushButton::clicked, this, &QDialog::reject); connect(mUI->mCancelButton, &QPushButton::clicked, this, &QDialog::reject);
QButtonGroup* buttonGroup = new QButtonGroup(this); QButtonGroup* buttonGroup = new QButtonGroup(this);
connect(buttonGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), this, &StartScanProcessDialog::setSelectedScanProtocal);
buttonGroup->setExclusive(true); buttonGroup->setExclusive(true);
buttonGroup->addButton(mUI->mLeftToRightButton); buttonGroup->addButton(mUI->mLeftToRightButton, LSTAND);
buttonGroup->addButton(mUI->mRightToLeftButton); buttonGroup->addButton(mUI->mRightToLeftButton, RSTAND);
buttonGroup->addButton(mUI->mOnlyLeftButton); buttonGroup->addButton(mUI->mOnlyLeftButton, LONE);
buttonGroup->addButton(mUI->mOnlyRightButton); buttonGroup->addButton(mUI->mOnlyRightButton, RONE);
QString protocol = JsonObject::Instance()->defaultProtocal(); QString protocol = JsonObject::Instance()->defaultProtocal();
if(protocol == "LSTAND") if(protocol == "LSTAND")
{ {
mUI->mLeftToRightButton->setChecked(true); mUI->mLeftToRightButton->setChecked(true);
mScanProtocal = LSTAND;
} }
else if(protocol == "RSTAND") else if(protocol == "RSTAND")
{ {
mUI->mRightToLeftButton->setChecked(true); mUI->mRightToLeftButton->setChecked(true);
mScanProtocal = RSTAND;
} }
else if(protocol == "LONE") else if(protocol == "LONE")
{ {
mUI->mOnlyLeftButton->setChecked(true); mUI->mOnlyLeftButton->setChecked(true);
mScanProtocal = LONE;
} }
else else
{ {
mUI->mOnlyRightButton->setChecked(true); mUI->mOnlyRightButton->setChecked(true);
mScanProtocal = RONE;
} }
} }
@@ -65,3 +71,14 @@ void StartScanProcessDialog::accept()
{ {
QDialog::accept(); QDialog::accept();
} }
ScanProtocal StartScanProcessDialog::getSelectedProtocal()
{
return mScanProtocal;
}
void StartScanProcessDialog::setSelectedScanProtocal(int aButtonIndex)
{
mScanProtocal = static_cast<ScanProtocal>(aButtonIndex);
}

View File

@@ -2,6 +2,7 @@
#define STARTSCANPROCESSDIALOG_H #define STARTSCANPROCESSDIALOG_H
#include <QDialog> #include <QDialog>
#include "forms/scan/PatientInformationForm.h"
class PatientInformation; class PatientInformation;
@@ -17,15 +18,18 @@ public:
explicit StartScanProcessDialog(QWidget *aParent = nullptr); explicit StartScanProcessDialog(QWidget *aParent = nullptr);
~StartScanProcessDialog() override; ~StartScanProcessDialog() override;
void setPatientDetailForm(PatientInformation* aPatient); void setPatientDetailForm(PatientInformation* aPatient);
ScanProtocal getSelectedProtocal();
public slots: public slots:
void accept() override; void accept() override;
void setSelectedScanProtocal(int aButtonIndex);
private: private:
void initButtons(); void initButtons();
private: private:
Ui::StartScanProcessDialog *mUI; Ui::StartScanProcessDialog *mUI;
ScanProtocal mScanProtocal;
}; };
#endif // STARTSCANPROCESSDIALOG_H #endif // STARTSCANPROCESSDIALOG_H

View File

@@ -23,7 +23,7 @@ PatientInformationForm::~PatientInformationForm()
delete mJsonStr; delete mJsonStr;
} }
void PatientInformationForm::setPatientInformation(PatientInformationPointer information) { void PatientInformationForm::setPatientInformation(PatientInformationPointer information, ScanProtocal aProtocal) {
if(information) if(information)
{ {
mUI->mPatientID->setText(information->ID); mUI->mPatientID->setText(information->ID);
@@ -31,6 +31,7 @@ void PatientInformationForm::setPatientInformation(PatientInformationPointer inf
mUI->mPatientName->setText(information->Name); mUI->mPatientName->setText(information->Name);
mUI->mPatientGender->setText(information->Sex); mUI->mPatientGender->setText(information->Sex);
mUI->mPaitenAccessionNumber->setText(information->AccessionNumber); mUI->mPaitenAccessionNumber->setText(information->AccessionNumber);
mUI->mScanProtocol->setText(getProtocolString(aProtocal));
} }
else else
{ {
@@ -39,11 +40,9 @@ void PatientInformationForm::setPatientInformation(PatientInformationPointer inf
mUI->mPatientName->clear(); mUI->mPatientName->clear();
mUI->mPatientGender->clear(); mUI->mPatientGender->clear();
mUI->mPaitenAccessionNumber->clear(); mUI->mPaitenAccessionNumber->clear();
mUI->mScanProtocol->clear();
} }
if (mInfo)
{
mInfo->deleteLater();
}
mInfo = information; mInfo = information;
} }
@@ -57,6 +56,17 @@ int PatientInformationForm::getProtocol()
return mCurrentProtocol; return mCurrentProtocol;
} }
QString PatientInformationForm::getProtocolString(ScanProtocal aProtocal)
{
switch (aProtocal)
{
case RSTAND: return tr("RSTAND");
case LSTAND: return tr("LSTAND");
case LONE: return tr("LONE");
case RONE: return tr("RONE");
}
}
QString PatientInformationForm::getPatientID() QString PatientInformationForm::getPatientID()
{ {
return mUI->mPatientID->text(); return mUI->mPatientID->text();

View File

@@ -7,6 +7,11 @@ namespace Ui {
class PatientInformationForm; class PatientInformationForm;
} }
enum ScanProtocal
{
LSTAND = 0, RSTAND, LONE, RONE
};
class PatientInformationForm : public QWidget class PatientInformationForm : public QWidget
{ {
Q_OBJECT Q_OBJECT
@@ -14,17 +19,18 @@ class PatientInformationForm : public QWidget
public: public:
explicit PatientInformationForm(QWidget *parent = nullptr); explicit PatientInformationForm(QWidget *parent = nullptr);
~PatientInformationForm() override; ~PatientInformationForm() override;
void setPatientInformation(PatientInformationPointer information); void setPatientInformation(PatientInformationPointer information, ScanProtocal aProtocal);
PatientInformationPointer getPatientInformation(); PatientInformationPointer getPatientInformation();
int getProtocol(); int getProtocol();
QString getProtocolString(ScanProtocal aProtocal);
const char * getCurrentPatientJsonString(bool emptyScan); const char * getCurrentPatientJsonString(bool emptyScan);
QString getPatientID(); QString getPatientID();
private: private:
Ui::PatientInformationForm *mUI; Ui::PatientInformationForm *mUI;
PatientInformationPointer mInfo; PatientInformationPointer mInfo;
int mCurrentProtocol = 0; ScanProtocal mCurrentProtocol = LSTAND;
char * mJsonStr = nullptr; char * mJsonStr = nullptr;
}; };

View File

@@ -329,7 +329,7 @@ void ScanFormWidget::initEvents()
DialogResult result = DialogManager::Default()->reuqestConfirmStartScan(patientInfo); DialogResult result = DialogManager::Default()->reuqestConfirmStartScan(patientInfo);
if(result.ResultCode == QDialog::Accepted) if(result.ResultCode == QDialog::Accepted)
{ {
mPatInf->setPatientInformation(patientInfo->Copy()); mPatInf->setPatientInformation(patientInfo->Copy(), static_cast<ScanProtocal>(result.ResultData.toInt()));
LOG_USER_OPERATION(QString("Select Patient, ID: %1").arg(patientInfo->ID)) LOG_USER_OPERATION(QString("Select Patient, ID: %1").arg(patientInfo->ID))
EventCenter::Default()->triggerEvent(StartScanProcess, nullptr, patientInfo); EventCenter::Default()->triggerEvent(StartScanProcess, nullptr, patientInfo);
} }