Change dialog style, add Scan Patient confirm

This commit is contained in:
kradchen
2023-09-08 17:09:49 +08:00
parent 0634b1b68e
commit 89c86c3bfd
12 changed files with 149 additions and 35 deletions

View File

@@ -12,8 +12,8 @@ AlertDialog::AlertDialog(QWidget *parent, Qt::WindowFlags f)
, mLblMsg(new QLabel(this)) , mLblMsg(new QLabel(this))
, mLblTitle (new QLabel(this)) , mLblTitle (new QLabel(this))
{ {
this->setFixedHeight(180); this->setMinimumHeight(180);
this->setFixedWidth(400); this->setMinimumWidth(400);
auto layout = new QVBoxLayout(mFormWidget); auto layout = new QVBoxLayout(mFormWidget);
layout->setSpacing(10); layout->setSpacing(10);
// add title // add title
@@ -21,7 +21,8 @@ AlertDialog::AlertDialog(QWidget *parent, Qt::WindowFlags f)
mLblTitle->setText(tr("Warning")); mLblTitle->setText(tr("Warning"));
mLblTitle->setObjectName("AlertDialogTitle"); mLblTitle->setObjectName("AlertDialogTitle");
layout->addWidget(mLblTitle); layout->addWidget(mLblTitle);
layout->addWidget(mLblMsg);} layout->addWidget(mLblMsg);
}
void AlertDialog::setAlertMessage(const QString &msg) { void AlertDialog::setAlertMessage(const QString &msg) {
mLblMsg->setText(msg); mLblMsg->setText(msg);

View File

@@ -18,6 +18,7 @@
#include "dialogs/TimeSelectDialog.h" #include "dialogs/TimeSelectDialog.h"
#include "dialogs/SelectDialog.h" #include "dialogs/SelectDialog.h"
#include "dialogs/GetWorkListDialog.h" #include "dialogs/GetWorkListDialog.h"
#include "dialogs/PatientConfirmDialog.h"
#include "network/DicomCfgDialog.h" #include "network/DicomCfgDialog.h"
#include "network/GetAdminPsw.h" #include "network/GetAdminPsw.h"
@@ -319,6 +320,17 @@ DialogResult DialogManager::requestEditRouteInfo(const QStringList& aEditData)
return DialogResult(ret,dialog.getList()); return DialogResult(ret,dialog.getList());
} }
int DialogManager::requestPatientConfirm(PatientInformation* patientInf, int type)
{
PatientConfirmDialog dialog(mTopWidget);
setTopWidget(&dialog);
dialog.setPatientInformation(patientInf, type);
dialog.setWindowModality(Qt::WindowModal);
int ret = dialog.exec();
releaseTopWidget(&dialog);
return ret;
}
int DialogManager::requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView) int DialogManager::requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView)
{ {
GetWorkListDialog dialog(aModel, aTableView, mTopWidget); GetWorkListDialog dialog(aModel, aTableView, mTopWidget);

View File

@@ -62,6 +62,7 @@ public:
int requestInputAdminPasswd(); int requestInputAdminPasswd();
int requestEditNetworkConfig(); int requestEditNetworkConfig();
int requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView); int requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView);
int requestPatientConfirm(PatientInformation* patientInf, int type);
DialogResult requestEditIpAndNetMask(); DialogResult requestEditIpAndNetMask();
DialogResult requestEditIpAndNetMask(const QStringList& aEditData); DialogResult requestEditIpAndNetMask(const QStringList& aEditData);
DialogResult requestEditRouteInfo(); DialogResult requestEditRouteInfo();

View File

@@ -0,0 +1,30 @@
#include "PatientConfirmDialog.h"
#include <QVBoxLayout>
#include "forms/select/PatientDetailForm.h"
PatientConfirmDialog::PatientConfirmDialog(QWidget* parent, Qt::WindowFlags f)
: GUIFormBaseDialog(parent, f)
, mPatientDetail(new PatientDetailForm(this))
{
auto layout = new QVBoxLayout(mFormWidget);
layout->addWidget(mPatientDetail);
layout->setMargin(0);
}
PatientConfirmDialog::~PatientConfirmDialog()
{
}
void PatientConfirmDialog::setPatientInformation(PatientInformation* information, int type)
{
mPatientDetail->setPatientInformation(information);
mPatientDetail->confirmModeOn(type);
}
bool PatientConfirmDialog::updateReferenceData()
{
return true;
}

View File

@@ -0,0 +1,20 @@
#ifndef GUI_PATIENTDIALOG_H
#define GUI_PATIENTDIALOG_H
#include "GUIFormBaseDialog.h"
class PatientDetailForm;
class PatientInformation;
class PatientConfirmDialog : public GUIFormBaseDialog
{
Q_OBJECT
private:
PatientDetailForm* mPatientDetail;
public:
PatientConfirmDialog(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
~PatientConfirmDialog();
void setPatientInformation(PatientInformation* information, int type);
protected:
bool updateReferenceData() override;
};
#endif /* GUI_PATIENTDIALOG_H */

View File

@@ -20,7 +20,6 @@ PatientInformationForm::PatientInformationForm(QWidget* parent)
PatientInformationForm::~PatientInformationForm() PatientInformationForm::~PatientInformationForm()
{ {
delete mUI; delete mUI;
delete mInfo;
delete mJsonStr; delete mJsonStr;
} }
@@ -33,6 +32,11 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
mInfo = information; mInfo = information;
} }
PatientInformation* PatientInformationForm::getPatientInformation()
{
return mInfo->Copy();
}
void PatientInformationForm::setProtocol(int type) { void PatientInformationForm::setProtocol(int type) {
mCurrentProtocol = type; mCurrentProtocol = type;
switch (type) switch (type)
@@ -47,6 +51,11 @@ void PatientInformationForm::setProtocol(int type) {
} }
} }
int PatientInformationForm::getProtocol()
{
return mCurrentProtocol;
}
QString PatientInformationForm::getPatientID() QString PatientInformationForm::getPatientID()
{ {
return mUI->lbl_ID->text(); return mUI->lbl_ID->text();
@@ -55,12 +64,12 @@ QString PatientInformationForm::getPatientID()
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty) const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
{ {
cJSON* patientInfoObject = cJSON_CreateObject(); cJSON* patientInfoObject = cJSON_CreateObject();
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mUI->lbl_Name->text().toStdString().data())); cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mInfo->Name.toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mUI->lbl_ID->text().toStdString().data())); cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mInfo->ID.toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mUI->lbl_Acc->text().toStdString().data())); cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mInfo->AccessionNumber.toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mUI->lbl_Sex->text().toStdString().data())); cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mInfo->Sex.toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientBirthDate", cJSON_AddItemToObject(patientInfoObject, "PatientBirthDate",
cJSON_CreateString(mUI->lbl_Date->text().replace("/", "").replace("-", "").replace(' ', '.').toStdString().data())); cJSON_CreateString(mInfo->BirthDate.replace("/", "").replace("-", "").replace(' ', '.').toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "Laterality", cJSON_CreateString(mCurrentProtocol ? "R" : "L")); cJSON_AddItemToObject(patientInfoObject, "Laterality", cJSON_CreateString(mCurrentProtocol ? "R" : "L"));
cJSON_AddItemToObject(patientInfoObject, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0)); cJSON_AddItemToObject(patientInfoObject, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
cJSON_AddItemToObject(patientInfoObject, "OperatorName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str())); cJSON_AddItemToObject(patientInfoObject, "OperatorName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str()));

View File

@@ -15,9 +15,13 @@ public:
explicit PatientInformationForm(QWidget *parent = nullptr); explicit PatientInformationForm(QWidget *parent = nullptr);
~PatientInformationForm() override; ~PatientInformationForm() override;
void setPatientInformation(PatientInformation* information); void setPatientInformation(PatientInformation* information);
PatientInformation* getPatientInformation();
void setProtocol(int type); void setProtocol(int type);
int getProtocol();
const char * getCurrentPatientJsonString(bool emptyScan); const char * getCurrentPatientJsonString(bool emptyScan);
QString getPatientID(); QString getPatientID();
private: private:
Ui::PatientInformationForm *mUI; Ui::PatientInformationForm *mUI;
PatientInformation* mInfo = nullptr; PatientInformation* mInfo = nullptr;

View File

@@ -14,6 +14,7 @@
#include "forms/scan/PatientInformationForm.h" #include "forms/scan/PatientInformationForm.h"
#include "event/EventCenter.h" #include "event/EventCenter.h"
#include "dialogs/DialogManager.h"
#include "log/UserOperationLog.h" #include "log/UserOperationLog.h"
#include "json/jsonobject.h" #include "json/jsonobject.h"
#include "device/DeviceManager.h" #include "device/DeviceManager.h"
@@ -180,6 +181,11 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
}); });
connect(mBtnScan, &QToolButton::clicked, [=]() { 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)); QString patientInf(mPatInf->getCurrentPatientJsonString(false));
LOG_USER_OPERATION(QString("Start Scan, ID: %1").arg(mPatInf->getPatientID())) LOG_USER_OPERATION(QString("Start Scan, ID: %1").arg(mPatInf->getPatientID()))
if (!DeviceManager::Default()->hasValidEmptyScan()){ if (!DeviceManager::Default()->hasValidEmptyScan()){

View File

@@ -15,15 +15,11 @@ QWidget(parent),
mUI(new Ui::PatientDetailForm) mUI(new Ui::PatientDetailForm)
, mBtnEdit(new QToolButton()) , mBtnEdit(new QToolButton())
, mBtnDelete(new QToolButton()) , mBtnDelete(new QToolButton())
, mBtnPlaceWidget(new QWidget(this))
, mLblMessage(new QLabel(this))
{ {
mUI->setupUi(this); mUI->setupUi(this);
mUI->hideBtn->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Preferred);
mUI->hideBtn->setObjectName("btnHidePanel");
mUI->hideBtn->setText(tr(" Hide Panel"));
mUI->hideBtn->setVisible(false);
connect(mUI->hideBtn, &QToolButton::clicked, [=](){
emit hideBtnClicked();
});
mUI->lblPatInfPanel->setObjectName("PatInfTitle"); mUI->lblPatInfPanel->setObjectName("PatInfTitle");
mUI->lblIcon->setObjectName("PatIcon"); mUI->lblIcon->setObjectName("PatIcon");
mUI->lbl_DOB->setObjectName("displayDetail"); mUI->lbl_DOB->setObjectName("displayDetail");
@@ -33,13 +29,13 @@ mUI(new Ui::PatientDetailForm)
mUI->lblAccno->setObjectName("displayDetail"); mUI->lblAccno->setObjectName("displayDetail");
mUI->lblAddDate->setObjectName("displayDetail"); mUI->lblAddDate->setObjectName("displayDetail");
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this,&PatientDetailForm::reloadLanguage); connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this,&PatientDetailForm::reloadLanguage);
QWidget * widget = new QWidget(this); mBtnPlaceWidget->setFixedHeight(120);
widget->setFixedHeight(120);
mUI->verticalLayout_2->setSpacing(50); mUI->verticalLayout_2->setSpacing(50);
mUI->verticalLayout_3->insertWidget(5, widget); mUI->verticalLayout_3->insertWidget(5, mBtnPlaceWidget);
mUI->verticalLayout_3->insertWidget(5, mLblMessage);
QHBoxLayout * layout = new QHBoxLayout(widget); mLblMessage->setVisible(false);
QHBoxLayout * layout = new QHBoxLayout(mBtnPlaceWidget);
mBtnEdit->setObjectName("btnPatEdit"); mBtnEdit->setObjectName("btnPatEdit");
mBtnDelete->setObjectName("btnPatDelete"); mBtnDelete->setObjectName("btnPatDelete");
mBtnEdit->setText(tr("Edit")); mBtnEdit->setText(tr("Edit"));
@@ -88,6 +84,16 @@ void PatientDetailForm::clearPatientInformation() {
mUI->lblAccno->clear(); mUI->lblAccno->clear();
} }
void PatientDetailForm::confirmModeOn(int protocol)
{
mBtnPlaceWidget->setVisible(false);
mLblMessage->setVisible(true);
mUI->lblPatInfPanel->setText(tr("Scan with this Patient?"));
mUI->lblAddDate->setText(tr("Protocol: ")+(protocol==0?tr("Left"):tr("Right")));
}
void PatientDetailForm::storePatientInformation() { void PatientDetailForm::storePatientInformation() {
} }

View File

@@ -6,6 +6,8 @@ class PatientDetailForm;
#include <QWidget> #include <QWidget>
#include "PatientInformation.h" #include "PatientInformation.h"
class QToolButton; class QToolButton;
class QLabel;
class PatientDetailForm : public QWidget class PatientDetailForm : public QWidget
{ {
Q_OBJECT Q_OBJECT
@@ -17,7 +19,7 @@ public:
return &mStore; return &mStore;
} }
void clearPatientInformation(); void clearPatientInformation();
void confirmModeOn(int protocol);
signals: signals:
void hideBtnClicked(); void hideBtnClicked();
void editClicked(); void editClicked();
@@ -30,8 +32,10 @@ private:
QString mCurrentPatientUID; QString mCurrentPatientUID;
QString mAddDate; QString mAddDate;
PatientInformation mStore; PatientInformation mStore;
QWidget * mBtnPlaceWidget;
QToolButton *mBtnEdit; QToolButton *mBtnEdit;
QToolButton *mBtnDelete; QToolButton *mBtnDelete;
QLabel* mLblMessage;
}; };
#endif // EDITPATIENTFORM_H #endif // EDITPATIENTFORM_H

View File

@@ -14,9 +14,18 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="frameShape"> <property name="frameShape">
@@ -29,13 +38,18 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item> <property name="leftMargin">
<widget class="QToolButton" name="hideBtn"> <number>0</number>
<property name="text"> </property>
<string>...</string> <property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property> </property>
</widget>
</item>
<item> <item>
<widget class="QLabel" name="lblPatInfPanel"> <widget class="QLabel" name="lblPatInfPanel">
<property name="text"> <property name="text">
@@ -144,7 +158,7 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>10</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="lblPatID"> <widget class="QLabel" name="lblPatID">

View File

@@ -12,8 +12,9 @@ QPushButton {
padding-left: 50px; padding-left: 50px;
padding-right: 50px; padding-right: 50px;
border-radius: 5px; border-radius: 5px;
min-height: 28px; min-height: 60px;
max-height: 28px; max-height: 60px;
font-size: 32px;
background: qlineargradient(spread:pad, background: qlineargradient(spread:pad,
x1: 0.50, x1: 0.50,
y1: 0, y1: 0,
@@ -245,7 +246,9 @@ QLabel#title {
QLabel#AlertDialogTitle QLabel#AlertDialogTitle
{ {
font-size: 30px; color:darkgoldenrod;
font-size: 32px;
border-bottom: 1px solid grey;
} }
/*------LoginWindow----------------------------------------------------------*/ /*------LoginWindow----------------------------------------------------------*/
@@ -412,7 +415,7 @@ QWidget#commandWidget QToolButton{
QWidget#patientDetailWidget { QWidget#patientDetailWidget {
min-width: 680px; min-width: 680px;
max-width: 680px; max-width: 680px;
margin-top: 5; /* margin-top: 5; */
} }
QToolButton#btnShowPanel { QToolButton#btnShowPanel {
@@ -484,7 +487,7 @@ QLabel#PatInfTitle {
max-height: 80px; max-height: 80px;
font-size: 50px; font-size: 50px;
font-weight: Bold; font-weight: Bold;
margin-top: 20px; /* margin-top: 20px; */
margin-bottom: 30px; margin-bottom: 30px;
} }
@@ -689,6 +692,10 @@ QWidget#formWidget {
font-size: 30px; font-size: 30px;
} }
QWidget#formWidget QLabel{
font-size: 32px;
}
GUIFormBaseDialog QToolButton{ GUIFormBaseDialog QToolButton{
min-height: 36px; min-height: 36px;
max-height: 36px; max-height: 36px;