feat:Change scan confirm dialog from patient selection to button click.

This commit is contained in:
sunwen
2025-02-08 15:18:49 +08:00
parent b2158943ec
commit 80be60042a
5 changed files with 82 additions and 37 deletions

View File

@@ -37,6 +37,7 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
mUI->mPatientName->setText(information->Name);
mDicomGender = information->Sex;
mUI->mPatientGender->setText(GenderHelper::getStringfromDicomGender(mDicomGender));
mPatientInformation.reset(information->copy());
}
else
{
@@ -52,6 +53,11 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
}
}
PatientInformation* PatientInformationForm::getPatientInformationPtr()
{
return mPatientInformation.get();
}
void PatientInformationForm::setAccessionNumber(AccessionInformation* aAccession)
{
if(aAccession == nullptr)

View File

@@ -27,6 +27,7 @@ public:
const char * getCurrentPatientJsonString(bool emptyScan);
QString getPatientID();
PatientInformation* getPatientInformationPtr();
private:
Ui::PatientInformationForm *mUI;
@@ -37,6 +38,7 @@ private:
QString mModality;
QString mMPPSUID;
QString mDicomGender;
QScopedPointer<PatientInformation> mPatientInformation;
};
#endif // PATIENTINFORMATIONFORM_H

View File

@@ -77,7 +77,6 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
mStartScanButton->setText(tr("Start Scan"));
layout->addWidget(mStartScanButton);
mStartScanButton->setEnabled(false);
mStartScanButton->setCheckable(true);
layout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
addVerticalLine(layout);
@@ -146,17 +145,16 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
connect(mStartScanButton, &QToolButton::clicked, [this]()
{
if(mStartScanButton->isChecked())
PatientInformation* patientInfo = mPatInf->getPatientInformationPtr();
DialogResult result = DialogManager::Default()->reuqestConfirmStartScan(patientInfo);
if(result.ResultCode == QDialog::Accepted)
{
ScanProtocal protocal = static_cast<ScanProtocal>(result.ResultData.toInt());
setScanProtocal(patientInfo, protocal);
LOG_USER_OPERATION(QString("Start Scan Process, ID: %1").arg(mPatInf->getPatientID()));
mStartScanButton->setEnabled(false);
EventCenter::Default()->triggerEvent(GUIEvents::StartScanProcess, nullptr, nullptr);
}
else
{
LOG_USER_OPERATION(QString("Stop Scan Process, ID: %1").arg(mPatInf->getPatientID()));
EventCenter::Default()->triggerEvent(GUIEvents::StopScanProcess, nullptr, nullptr);
}
});
connect(DeviceManager::Default(), &DeviceManager::startAutoLocateResult, [this](bool aResult)
@@ -166,7 +164,6 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
mAccountButton->setEnabled(false);
mDrainageButton->setEnabled(false);
mShutdownButton->setEnabled(false);
mStartScanButton->setText(tr("Stop Scan Process"));
mScanProcessLabel->setText(getAutoLocateMessage());
}
@@ -180,13 +177,14 @@ void ScanFormWidget::initCommandWidget(QHBoxLayout *layout)
mAccountButton->setEnabled(true);
mDrainageButton->setEnabled(true);
mShutdownButton->setEnabled(true);
mStartScanButton->setChecked(false);
mStartScanButton->setText(tr("Start Scan"));
if(ScanProcessSequence::getInstance()->getScanPositionSize() == 0)
{
mStartScanButton->setEnabled(false);
mPatInf->clear();
}
else
{
mStartScanButton->setEnabled(true);
}
mScanProcessLabel->setText(tr("Please confirm checking patient information to start the process"));
});
@@ -331,18 +329,10 @@ void ScanFormWidget::initEvents()
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);
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();
}
}
});
connect(EventCenter::Default(), &EventCenter::ResponseStopPreview, [=](QObject* sender, QObject* data) {

View File

@@ -229,6 +229,55 @@ void PatientInformation::operator=(const PatientInformation& aOther)
this->mRecommendAccessions = aOther.mRecommendAccessions;
}
PatientInformation* PatientInformation::copy()
{
PatientInformation* copyPatient = new PatientInformation(ID, Name, Sex, BirthDate, AddDate);
copyPatient->PatientUID = this->PatientUID;
copyPatient->Comment = this->Comment;
for(int i = 1; i < mAccessionList.size(); ++i)
{
AccessionInformation* original = mAccessionList[i];
AccessionInformation* copyAccession = new AccessionInformation(
original->mAccessionNumber,
original->mPosition,
original->mScheduledStartDate,
original->mStudyUID,
original->mRPID,
original->mSPSID,
original->mModality,
original->mMPPSUID,
copyPatient,
copyPatient
);
copyAccession->mScanCount = original->mScanCount;
copyPatient->mAccessionList.append(copyAccession);
}
copyPatient->mSelectedScanProtocol = this->mSelectedScanProtocol;
for(AccessionInformation* selectedAcc : mSelectedAccessions)
{
int index = mAccessionList.indexOf(selectedAcc);
if(index != -1)
{
copyPatient->mSelectedAccessions.append(copyPatient->mAccessionList[index]);
}
}
for(AccessionInformation* recommendedAcc : mRecommendAccessions)
{
int index = mAccessionList.indexOf(recommendedAcc);
if(index != -1)
{
copyPatient->mRecommendAccessions.append(copyPatient->mAccessionList[index]);
}
}
return copyPatient;
}
QList<AccessionInformation*> PatientInformation::getSelectedAccession()
{
return mSelectedAccessions;

View File

@@ -55,7 +55,7 @@ public:
void reloadHeaderLanguage();
QList<AccessionInformation*> getSelectedAccession();
AccessionInformation* findSelectedAccession(ScanProtocol aProtocol, bool aIfEmptyGetTop);
PatientInformation* copy();
AccessionInformation* mHeader;
QList<AccessionInformation*> mAccessionList;
@@ -66,8 +66,6 @@ public:
#define ADD_PATIENT_PROPERTY(val) QString val;
ADD_PATIENT()
#undef ADD_PATIENT_PROPERTY
// QString ScheduledStartDate;
// QString AccessionNumber;
};
typedef QSharedPointer<PatientInformation> PatientInformationPointer;