refactor: Modify the display and interaction related to worklist.
This commit is contained in:
@@ -8,8 +8,10 @@
|
||||
PatientInformationForm::PatientInformationForm(QWidget* parent)
|
||||
: QWidget(parent)
|
||||
, mUI(new Ui::PatientInformationForm)
|
||||
, mInfo(nullptr)
|
||||
, mJsonStr(nullptr)
|
||||
, mStudyUID()
|
||||
, mModality()
|
||||
, mMPPSUID()
|
||||
{
|
||||
mUI->setupUi(this);
|
||||
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, [=]() {
|
||||
@@ -23,15 +25,13 @@ PatientInformationForm::~PatientInformationForm()
|
||||
delete mJsonStr;
|
||||
}
|
||||
|
||||
void PatientInformationForm::setPatientInformation(PatientInformationPointer information, ScanProtocal aProtocal) {
|
||||
if(information)
|
||||
void PatientInformationForm::setPatientInformation(PatientInformation* information) {
|
||||
if(information != nullptr)
|
||||
{
|
||||
mUI->mPatientID->setText(information->ID);
|
||||
mUI->mPatientBirthday->setText(information->BirthDate);
|
||||
mUI->mPatientName->setText(information->Name);
|
||||
mUI->mPatientGender->setText(information->Sex);
|
||||
mUI->mPaitenAccessionNumber->setText(information->AccessionNumber);
|
||||
mUI->mScanProtocol->setText(getProtocolString(aProtocal));
|
||||
mUI->mPatientGender->setText(information->Sex == "F" ? tr("Female") : (information->Sex == "M" ? tr("Male") : tr("Other")));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -40,15 +40,26 @@ void PatientInformationForm::setPatientInformation(PatientInformationPointer inf
|
||||
mUI->mPatientName->clear();
|
||||
mUI->mPatientGender->clear();
|
||||
mUI->mPaitenAccessionNumber->clear();
|
||||
mUI->mScanProtocol->clear();
|
||||
mStudyUID.clear();
|
||||
mModality.clear();
|
||||
mMPPSUID.clear();
|
||||
}
|
||||
|
||||
mInfo = information;
|
||||
}
|
||||
|
||||
PatientInformationPointer PatientInformationForm::getPatientInformation()
|
||||
void PatientInformationForm::setAccessionNumber(AccessionInformation* aAccession)
|
||||
{
|
||||
return mInfo->Copy();
|
||||
if(aAccession == nullptr)
|
||||
{
|
||||
mUI->mPaitenAccessionNumber->setText("");
|
||||
mStudyUID.clear();
|
||||
mModality.clear();
|
||||
mMPPSUID.clear();
|
||||
return;
|
||||
}
|
||||
mUI->mPaitenAccessionNumber->setText(aAccession->mAccessionNumber);
|
||||
mStudyUID = aAccession->mStudyUID;
|
||||
mModality = aAccession->mModality;
|
||||
mMPPSUID = aAccession->mMPPSUID;
|
||||
}
|
||||
|
||||
int PatientInformationForm::getProtocol()
|
||||
@@ -75,6 +86,14 @@ QString PatientInformationForm::getPatientID()
|
||||
void PatientInformationForm::setExecuteProtocol(bool aIsLeft)
|
||||
{
|
||||
mIsExecuteProtocolLeft = aIsLeft;
|
||||
if(mIsExecuteProtocolLeft)
|
||||
{
|
||||
mUI->mScanProtocol->setText(tr("Left"));
|
||||
}
|
||||
else
|
||||
{
|
||||
mUI->mScanProtocol->setText(tr("Right"));
|
||||
}
|
||||
}
|
||||
|
||||
void PatientInformationForm::clear()
|
||||
@@ -85,24 +104,29 @@ void PatientInformationForm::clear()
|
||||
mUI->mPatientGender->clear();
|
||||
mUI->mPaitenAccessionNumber->clear();
|
||||
mUI->mScanProtocol->clear();
|
||||
mStudyUID.clear();
|
||||
mModality.clear();
|
||||
mMPPSUID.clear();
|
||||
}
|
||||
|
||||
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
|
||||
{
|
||||
cJSON* patientInfoObject = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mInfo->Name.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mInfo->ID.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mInfo->AccessionNumber.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mInfo->Sex.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mUI->mPatientName->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mUI->mPatientID->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mUI->mPaitenAccessionNumber->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mUI->mPatientGender->text().toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "PatientBirthDate",
|
||||
cJSON_CreateString(mInfo->BirthDate.replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
|
||||
cJSON_CreateString(mUI->mPatientBirthday->text().replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "Laterality", cJSON_CreateString(mIsExecuteProtocolLeft ? "L" : "R"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
|
||||
cJSON_AddItemToObject(patientInfoObject, "OperatorName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "ReferringPhysicianName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "InstitutionName", cJSON_CreateString("EQ9"));
|
||||
cJSON_AddItemToObject(patientInfoObject, "InstitutionAddress", cJSON_CreateString("HZ"));
|
||||
|
||||
cJSON_AddItemToObject(patientInfoObject, "StudyUID", cJSON_CreateString(mStudyUID.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "Modality", cJSON_CreateString(mModality.toStdString().data()));
|
||||
cJSON_AddItemToObject(patientInfoObject, "MPPSUID", cJSON_CreateString(mMPPSUID.toStdString().data()));
|
||||
cJSON* rootObject = cJSON_CreateObject();
|
||||
cJSON_AddItemToObject(rootObject, "Patient Info", patientInfoObject);
|
||||
delete mJsonStr;
|
||||
|
||||
@@ -19,8 +19,8 @@ class PatientInformationForm : public QWidget
|
||||
public:
|
||||
explicit PatientInformationForm(QWidget *parent = nullptr);
|
||||
~PatientInformationForm() override;
|
||||
void setPatientInformation(PatientInformationPointer information, ScanProtocal aProtocal);
|
||||
PatientInformationPointer getPatientInformation();
|
||||
void setPatientInformation(PatientInformation* information);
|
||||
void setAccessionNumber(AccessionInformation* aAccession);
|
||||
int getProtocol();
|
||||
QString getProtocolString(ScanProtocal aProtocal);
|
||||
void setExecuteProtocol(bool aIsLeft);
|
||||
@@ -31,10 +31,12 @@ public:
|
||||
|
||||
private:
|
||||
Ui::PatientInformationForm *mUI;
|
||||
PatientInformationPointer mInfo;
|
||||
bool mIsExecuteProtocolLeft = false;
|
||||
ScanProtocal mCurrentProtocol = LSTAND;
|
||||
char * mJsonStr = nullptr;
|
||||
QString mStudyUID;
|
||||
QString mModality;
|
||||
QString mMPPSUID;
|
||||
};
|
||||
|
||||
#endif // PATIENTINFORMATIONFORM_H
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="mPatientInfomation" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout" columnstretch="2,3">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="mPatientNameLabel">
|
||||
<property name="text">
|
||||
@@ -73,14 +73,14 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="mPatientID">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="mPatientGender">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -101,7 +101,7 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="mPatientBirthday">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -115,7 +115,7 @@
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="mPaitenAccessionNumber">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -129,7 +129,7 @@
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="mPatientName">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -143,7 +143,7 @@
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="mScanProtocol">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -29,11 +29,11 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
const size_t PREVIEW_ROW = 140;
|
||||
const size_t PREVIEW_COL = 140;
|
||||
const float PIXEL_SPACING = 1.5f;
|
||||
const float HALF_ROI_WIDTH = 100.0f;
|
||||
const unsigned int DRAINAGE_TIME = 180000; // 3 minitues
|
||||
const size_t PREVIEW_ROW = 140;
|
||||
const size_t PREVIEW_COL = 140;
|
||||
const float PIXEL_SPACING = 1.5f;
|
||||
const float HALF_ROI_WIDTH = 100.0f;
|
||||
const unsigned int DRAINAGE_TIME = 180000; // 3 minitues
|
||||
}
|
||||
|
||||
ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||
@@ -41,7 +41,6 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||
, mPatInf(new PatientInformationForm(this))
|
||||
, mAccountButton(new QToolButton(this))
|
||||
, mShutdownButton(new QToolButton(this))
|
||||
, mWorklistButton(new QToolButton(this))
|
||||
, mStartScanButton(new QToolButton(this))
|
||||
, mDrainageButton(new QToolButton(this))
|
||||
, mXYLabel(new CoordinateXYWidget(this))
|
||||
@@ -59,14 +58,13 @@ ScanFormWidget::ScanFormWidget(QWidget* parent)
|
||||
initEvents();
|
||||
mDrainageTimer->setSingleShot(true);
|
||||
connect(mDrainageTimer, &QTimer::timeout, this, [this]()
|
||||
{
|
||||
{
|
||||
mDrainageButton->click();
|
||||
});
|
||||
}
|
||||
|
||||
void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
{
|
||||
bool anonymousMode = JsonObject::Instance()->getAnonymousMode();
|
||||
mAccountButton->setObjectName("btnAccount");
|
||||
mAccountButton->setText(tr("Account"));
|
||||
layout->addWidget(mAccountButton);
|
||||
@@ -75,11 +73,6 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
mShutdownButton->setText(tr("ShutDown"));
|
||||
layout->addWidget(mShutdownButton);
|
||||
|
||||
mWorklistButton->setObjectName("btnWorklist");
|
||||
mWorklistButton->setText(tr("Worklist"));
|
||||
mWorklistButton->setEnabled(!anonymousMode);
|
||||
layout->addWidget(mWorklistButton);
|
||||
|
||||
mStartScanButton->setObjectName("btnScan");
|
||||
mStartScanButton->setText(tr("Start Scan"));
|
||||
layout->addWidget(mStartScanButton);
|
||||
@@ -95,7 +88,7 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
layout->addWidget(mDrainageButton);
|
||||
|
||||
connect(mDrainageButton, &QToolButton::clicked, [=](bool aSatus)
|
||||
{
|
||||
{
|
||||
//Drainage
|
||||
if(aSatus && DialogManager::Default()->requestAlertMessage(tr("Make sure to open the drain valve ?"), DialogButtonMode::OkAndCancel, tr("Confirm Drainage")) == QDialog::Rejected)
|
||||
{
|
||||
@@ -122,7 +115,7 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
});
|
||||
|
||||
connect(DeviceManager::Default(), &DeviceManager::startPumpControlResult, [this](bool aIsSucessful)
|
||||
{
|
||||
{
|
||||
mDrainageButton->setEnabled(true);
|
||||
if(!aIsSucessful)
|
||||
{
|
||||
@@ -143,23 +136,16 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
connect(mAccountButton, &QToolButton::clicked, DialogManager::Default(),&DialogManager::requestEditSelfAccount);
|
||||
|
||||
connect(mShutdownButton, &QToolButton::clicked, []()
|
||||
{
|
||||
{
|
||||
if(DialogManager::Default()->requestAlertMessage(QString(tr("Shut down now ?")), DialogButtonMode::OkAndCancel,tr("Shut Down")) == QDialog::Accepted)
|
||||
{
|
||||
LOG_USER_OPERATION("Shut Down")
|
||||
EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr);
|
||||
EventCenter::Default()->triggerEvent(GUIEvents::RequestShutdown, nullptr, nullptr);
|
||||
}
|
||||
});
|
||||
|
||||
connect(mWorklistButton, &QToolButton::clicked, [&]()
|
||||
{
|
||||
DialogManager::Default()->requestGetWorkList();
|
||||
});
|
||||
|
||||
connect(EventCenter::Default(), &EventCenter::AnonymousModeChanged, this, &ScanFormWidget::updateDataByAnonymousMode);
|
||||
|
||||
connect(mStartScanButton, &QToolButton::clicked, [this]()
|
||||
{
|
||||
{
|
||||
if(mStartScanButton->isChecked())
|
||||
{
|
||||
LOG_USER_OPERATION(QString("Start Scan Process, ID: %1").arg(mPatInf->getPatientID()));
|
||||
@@ -173,19 +159,24 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
}
|
||||
});
|
||||
|
||||
connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this]()
|
||||
{
|
||||
mWorklistButton->setEnabled(false);
|
||||
mAccountButton->setEnabled(false);
|
||||
mDrainageButton->setEnabled(false);
|
||||
mShutdownButton->setEnabled(false);
|
||||
mStartScanButton->setText(tr("Stop Scan Process"));
|
||||
mScanProcessLabel->setText(getAutoLocateMessage());
|
||||
connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aResult)
|
||||
{
|
||||
if(aResult)
|
||||
{
|
||||
mAccountButton->setEnabled(false);
|
||||
mDrainageButton->setEnabled(false);
|
||||
mShutdownButton->setEnabled(false);
|
||||
mStartScanButton->setText(tr("Stop Scan Process"));
|
||||
mScanProcessLabel->setText(getAutoLocateMessage());
|
||||
}
|
||||
|
||||
QPair<AccessionInformation*, ScanPosition> accession = ScanProcessSequence::getInstance()->topAccession();
|
||||
mPatInf->setExecuteProtocol(accession.second == ScanPosition::Left);
|
||||
mPatInf->setAccessionNumber(accession.first);
|
||||
});
|
||||
|
||||
connect(EventCenter::Default(), &EventCenter::StopScanProcess, [this]()
|
||||
{
|
||||
mWorklistButton->setEnabled(true);
|
||||
{
|
||||
mAccountButton->setEnabled(true);
|
||||
mDrainageButton->setEnabled(true);
|
||||
mShutdownButton->setEnabled(true);
|
||||
@@ -200,12 +191,12 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
|
||||
});
|
||||
|
||||
connect(EventCenter::Default(), &EventCenter::RequestPatientScan, [this]()
|
||||
{
|
||||
{
|
||||
mScanProcessLabel->setText(tr("Data scanning, please keep the current position and don't move."));
|
||||
});
|
||||
|
||||
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::fullScanDataExport, [this]()
|
||||
{
|
||||
{
|
||||
mScanProcessLabel->setText(tr("Data exporting, patient can leave the holder"));
|
||||
});
|
||||
|
||||
@@ -250,44 +241,6 @@ void ScanFormWidget::initScanContent()
|
||||
|
||||
}
|
||||
|
||||
void ScanFormWidget::initScanControlBar(QHBoxLayout *layout)
|
||||
{
|
||||
// connect(mBtnEScan, &QToolButton::clicked, [=]() {
|
||||
// int result = DialogManager::Default()->requestAlertMessage(tr("Please make sure the holder is only contain water!"),DialogButtonMode::OkAndCancel,tr("Confirm Scan"));
|
||||
// if (result != QDialog::Accepted)return;
|
||||
// QString patientInf(mPatInf->getCurrentPatientJsonString(true));
|
||||
// LOG_USER_OPERATION("Start Empty Scan")
|
||||
// EventCenter::Default()->triggerEvent(RequestEmptyScan, nullptr, (QObject*)(&patientInf));
|
||||
// });
|
||||
// connect(mBtnPreview, &QToolButton::clicked, [=]() {
|
||||
// LOG_USER_OPERATION(QString("Start Preview, ID: %1").arg(mPatInf->getPatientID()))
|
||||
// EventCenter::Default()->triggerEvent(RequestPreviewScan, nullptr, nullptr);
|
||||
|
||||
// });
|
||||
|
||||
|
||||
// connect(mBtnScan, &QToolButton::clicked, [=]() {
|
||||
// if(JsonObject::Instance()->getScanConfirm())
|
||||
// {
|
||||
// int ret = DialogManager::Default()->requestPatientConfirm(mPatInf->getPatientInformation(),mPatInf->getProtocol());
|
||||
// if (ret != QDialog::Accepted) return;
|
||||
// }
|
||||
// QString patientInf(mPatInf->getCurrentPatientJsonString(false));
|
||||
// LOG_USER_OPERATION(QString("Start Scan, ID: %1").arg(mPatInf->getPatientID()))
|
||||
// if (!DeviceManager::Default()->hasValidEmptyScan()){
|
||||
// QString msg(tr("No refresh data exists, please do Refresh operation first."));
|
||||
// EventCenter::Default()->triggerEvent(DeviceErrorRaise, nullptr, (QObject*)(&msg));
|
||||
// return;
|
||||
// }
|
||||
// EventCenter::Default()->triggerEvent(RequestPatientScan, nullptr, (QObject*)(&patientInf));
|
||||
// });
|
||||
// connect(mBtnStop, &QToolButton::clicked, [=]() {
|
||||
// LOG_USER_OPERATION("Stop Preview")
|
||||
// EventCenter::Default()->triggerEvent(RequestPreviewStop, nullptr, nullptr);
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
void ScanFormWidget::protocolChanged(int type)
|
||||
{
|
||||
LOG_USER_OPERATION(QString("Select Laterality %1").arg(type == 0 ? "Left" : "Right"));
|
||||
@@ -295,8 +248,6 @@ void ScanFormWidget::protocolChanged(int type)
|
||||
|
||||
void ScanFormWidget::prepareStartFullScan()
|
||||
{
|
||||
ScanPosition position = ScanProcessSequence::getInstance()->topPosition();
|
||||
mPatInf->setExecuteProtocol(position == ScanPosition::Left);
|
||||
QString patientInf(mPatInf->getCurrentPatientJsonString(false));
|
||||
LOG_USER_OPERATION(QString("Start Scan, ID: %1").arg(mPatInf->getPatientID()))
|
||||
EventCenter::Default()->triggerEvent(RequestPatientScan, nullptr, (QObject*)(&patientInf));
|
||||
@@ -379,34 +330,19 @@ void ScanFormWidget::initEvents()
|
||||
connect(EventCenter::Default(), &EventCenter::PatientSelected, [=](QObject* sender, QObject* data) {
|
||||
if (data)
|
||||
{
|
||||
PatientInformation* patientInfo = (PatientInformation*)data;
|
||||
DialogResult result = DialogManager::Default()->reuqestConfirmStartScan(patientInfo);
|
||||
if(result.ResultCode == QDialog::Accepted)
|
||||
{
|
||||
ScanProtocal protocal = static_cast<ScanProtocal>(result.ResultData.toInt());
|
||||
mPatInf->setPatientInformation(patientInfo->Copy(), protocal);
|
||||
setScanProtocal(protocal);
|
||||
LOG_USER_OPERATION(QString("Select Patient, ID: %1").arg(patientInfo->ID))
|
||||
if (JsonObject::Instance()->getMppsOpen() && !patientInfo->SPSID.isEmpty() && patientInfo->MPPSUID.isEmpty())
|
||||
{
|
||||
MPPSManager::getInstance()->setPatientUID(patientInfo->PatientUID);
|
||||
}
|
||||
mStartScanButton->setEnabled(true);
|
||||
EventCenter::Default()->triggerEvent(SetSelectedPatient, nullptr, patientInfo);
|
||||
mStartScanButton->click();
|
||||
PatientInformation* patientInfo = (PatientInformation*)data;
|
||||
DialogResult result = DialogManager::Default()->reuqestConfirmStartScan(patientInfo);
|
||||
if(result.ResultCode == QDialog::Accepted)
|
||||
{
|
||||
ScanProtocal protocal = static_cast<ScanProtocal>(result.ResultData.toInt());
|
||||
mPatInf->setPatientInformation(patientInfo);
|
||||
setScanProtocal(patientInfo, protocal);
|
||||
LOG_USER_OPERATION(QString("Select Patient, ID: %1").arg(patientInfo->ID))
|
||||
mStartScanButton->setEnabled(true);
|
||||
EventCenter::Default()->triggerEvent(SetSelectedPatient, nullptr, (QObject*)patientInfo);
|
||||
mStartScanButton->click();
|
||||
|
||||
}
|
||||
|
||||
// mBtnScan->setEnabled(true);
|
||||
// mBtnEScan->setEnabled(true);
|
||||
// mBtnPreview->setEnabled(true);
|
||||
// mBtnStop->setEnabled(true);
|
||||
}
|
||||
else{
|
||||
// mBtnScan->setEnabled(false);
|
||||
// mBtnEScan->setEnabled(false);
|
||||
// mBtnPreview->setEnabled(false);
|
||||
// mBtnStop->setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
connect(EventCenter::Default(), &EventCenter::ResponseStopPreview, [=](QObject* sender, QObject* data) {
|
||||
@@ -424,18 +360,11 @@ void ScanFormWidget::reloadLanguage()
|
||||
{
|
||||
mAccountButton->setText(tr("Account"));
|
||||
mShutdownButton->setText(tr("ShutDown"));
|
||||
mWorklistButton->setText(tr("Worklist"));
|
||||
mStartScanButton->setText(tr("Start Scan"));
|
||||
mScanProcessLabel->setText(tr("Please confirm checking patient information to start the process"));
|
||||
mDrainageButton->isChecked() ? mDrainageButton->setText(tr("Drainaging")) : mDrainageButton->setText(tr("Drainage"));
|
||||
}
|
||||
|
||||
void ScanFormWidget::updateDataByAnonymousMode()
|
||||
{
|
||||
bool anonymousMode = JsonObject::Instance()->getAnonymousMode();
|
||||
mWorklistButton->setEnabled(!anonymousMode);
|
||||
}
|
||||
|
||||
QString ScanFormWidget::getAutoLocateMessage()
|
||||
{
|
||||
ScanPosition position = ScanProcessSequence::getInstance()->topPosition();
|
||||
@@ -449,84 +378,26 @@ QString ScanFormWidget::getAutoLocateMessage()
|
||||
return QString("");
|
||||
}
|
||||
|
||||
void ScanFormWidget::setScanProtocal(int aProtocal)
|
||||
void ScanFormWidget::setScanProtocal(PatientInformation* aPatient, int aProtocal)
|
||||
{
|
||||
ScanProcessSequence::getInstance()->clear();
|
||||
switch (aProtocal)
|
||||
{
|
||||
case ScanProtocal::LSTAND:
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Right);
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Left);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanRight, false), ScanPosition::Right);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanLeft, true), ScanPosition::Left);
|
||||
return;
|
||||
case ScanProtocal::RSTAND:
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Left);
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Right);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanLeft, false), ScanPosition::Left);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanRight, true), ScanPosition::Right);
|
||||
return;
|
||||
case ScanProtocal::LONE:
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Left);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanLeft, true), ScanPosition::Left);
|
||||
return;
|
||||
case ScanProtocal::RONE:
|
||||
ScanProcessSequence::getInstance()->pushPosition(ScanPosition::Right);
|
||||
ScanProcessSequence::getInstance()->pushAccession(aPatient->findSelectedAccession(ScanRight, true), ScanPosition::Right);
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QStack>
|
||||
|
||||
class PatientInformationForm;
|
||||
class PatientInformation;
|
||||
class QToolButton;
|
||||
class CoordinateXYWidget;
|
||||
class CoordinateZWidget;
|
||||
@@ -18,16 +19,12 @@ public:
|
||||
~ScanFormWidget() override = default;
|
||||
void setPreviewing(bool val);
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
private:
|
||||
PatientInformationForm* mPatInf= nullptr;
|
||||
bool mUnInited = true;
|
||||
int mCurrentFrame = 0;
|
||||
QToolButton* mAccountButton;
|
||||
QToolButton* mShutdownButton;
|
||||
QToolButton* mWorklistButton;
|
||||
QToolButton* mStartScanButton;
|
||||
QToolButton* mDrainageButton;
|
||||
CoordinateXYWidget* mXYLabel;
|
||||
@@ -36,19 +33,16 @@ private:
|
||||
QTimer* mDrainageTimer;
|
||||
|
||||
void initCommandWidget(QHBoxLayout *layout);
|
||||
void initScanControlBar(QHBoxLayout *layout);
|
||||
void initScanContent();
|
||||
void renderLoading();
|
||||
void renderPreviewData(const QObject* sender, const QObject *data);
|
||||
void reloadLanguage();
|
||||
void setScanProtocal(int aProtocal);
|
||||
void setScanProtocal(PatientInformation* aPatient, int aProtocal);
|
||||
QString getAutoLocateMessage();
|
||||
|
||||
private slots:
|
||||
void protocolChanged(int type);
|
||||
void updateDataByAnonymousMode();
|
||||
void prepareStartFullScan();
|
||||
//void updateScanProcessLabel(const QString& aText);
|
||||
|
||||
void initEvents();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user