fix: Delete patient error while patient finish scan process.
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "components/VerticalTextToolButton.h"
|
||||
#include "PatientAddDateDelegate.h"
|
||||
#include "dicom/WorkListManager.h"
|
||||
#include "utilities/ScanProcessSequence.h"
|
||||
|
||||
SelectFormWidget::SelectFormWidget(QWidget* parent)
|
||||
: TabFormWidget(parent)
|
||||
@@ -84,6 +85,8 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
|
||||
this->setSelectedPatient(patientInfo);
|
||||
});
|
||||
|
||||
connect(ScanProcessSequence::getInstance(), &ScanProcessSequence::ScanProcessSequenceFinished, this, &SelectFormWidget::clearSelectedPatient);
|
||||
|
||||
//first prepare buttons!
|
||||
prepareButtons(false);
|
||||
|
||||
@@ -154,7 +157,7 @@ void SelectFormWidget::delPatient() {
|
||||
if (mPatTable->currentIndex().row() < 0) return;
|
||||
QString pUid = mModel->index(mPatTable->currentIndex().row(), PatientUID).data().toString();
|
||||
// patient has been selected as the scan patient!
|
||||
if (selectedPatientUID == pUid){
|
||||
if (mSelectedPatientUID == pUid){
|
||||
DialogManager::Default()->requestAlertMessage(tr("Can't delete selected Patient !"),DialogButtonMode::OkOnly,tr("Alert"));
|
||||
return;
|
||||
}
|
||||
@@ -187,7 +190,12 @@ void SelectFormWidget::selectPatient() {
|
||||
|
||||
void SelectFormWidget::setSelectedPatient(PatientInformation* aPatient)
|
||||
{
|
||||
selectedPatientUID = aPatient->PatientUID;
|
||||
mSelectedPatientUID = aPatient->PatientUID;
|
||||
}
|
||||
|
||||
void SelectFormWidget::clearSelectedPatient()
|
||||
{
|
||||
mSelectedPatientUID.clear();
|
||||
}
|
||||
|
||||
void SelectFormWidget::initDetailPanel(QHBoxLayout *contentLayout) {// prepare edit panel
|
||||
|
||||
@@ -21,10 +21,21 @@ public:
|
||||
public slots:
|
||||
void updateDataByAnonymousMode();
|
||||
private:
|
||||
QString selectedPatientUID;
|
||||
|
||||
void setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, PatientDetailForm *edit_patient) const;
|
||||
void prepareButtons(bool disableALL);
|
||||
void initPatEditButtons(QHBoxLayout *layout);
|
||||
void editPatient();
|
||||
void delPatient();
|
||||
void selectPatient();
|
||||
void setSelectedPatient(PatientInformation* aPatient);
|
||||
void initDataModel();
|
||||
void initDetailPanel(QHBoxLayout *contentLayout);
|
||||
void initTableView(QLayout *contentLayout);
|
||||
void reloadLanguage();
|
||||
void clearSelectedPatient();
|
||||
|
||||
private:
|
||||
QString mSelectedPatientUID;
|
||||
QToolButton *mBtnEdit;
|
||||
QToolButton *mBtnDelete;
|
||||
QToolButton *mBtnAdd;
|
||||
@@ -33,26 +44,6 @@ private:
|
||||
QSqlTableModel *mModel;
|
||||
PatientDetailForm *patientDetailForm;
|
||||
QLabel* mSelectTabTitle;
|
||||
|
||||
void prepareButtons(bool disableALL);
|
||||
|
||||
void initPatEditButtons(QHBoxLayout *layout);
|
||||
|
||||
void editPatient();
|
||||
|
||||
void delPatient();
|
||||
|
||||
void selectPatient();
|
||||
|
||||
void setSelectedPatient(PatientInformation* aPatient);
|
||||
|
||||
void initDataModel();
|
||||
|
||||
void initDetailPanel(QHBoxLayout *contentLayout);
|
||||
|
||||
void initTableView(QLayout *contentLayout);
|
||||
|
||||
void reloadLanguage();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,12 @@ void ScanProcessSequence::pushPosition(ScanPosition aPostion)
|
||||
|
||||
ScanPosition ScanProcessSequence::popPosition()
|
||||
{
|
||||
return mScanProtocol.pop();
|
||||
ScanPosition result = mScanProtocol.pop();
|
||||
if(mScanProtocol.size() == 0)
|
||||
{
|
||||
emit ScanProcessSequenceFinished();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ScanPosition ScanProcessSequence::topPosition()
|
||||
|
||||
@@ -28,6 +28,7 @@ signals:
|
||||
void fullScanDataExport();
|
||||
void autoLocateXYUpdated(int aX, int aY);
|
||||
void autoLocateZUpdated(int aZ);
|
||||
void ScanProcessSequenceFinished();
|
||||
|
||||
private slots:
|
||||
void updateAutoLocatePosition(int aX, int aY, int aZ);
|
||||
|
||||
Reference in New Issue
Block a user