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

View File

@@ -18,6 +18,7 @@
#include "dialogs/TimeSelectDialog.h"
#include "dialogs/SelectDialog.h"
#include "dialogs/GetWorkListDialog.h"
#include "dialogs/PatientConfirmDialog.h"
#include "network/DicomCfgDialog.h"
#include "network/GetAdminPsw.h"
@@ -319,6 +320,17 @@ DialogResult DialogManager::requestEditRouteInfo(const QStringList& aEditData)
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)
{
GetWorkListDialog dialog(aModel, aTableView, mTopWidget);

View File

@@ -62,6 +62,7 @@ public:
int requestInputAdminPasswd();
int requestEditNetworkConfig();
int requestGetWorkList(QSqlTableModel* aModel, QTableView* aTableView);
int requestPatientConfirm(PatientInformation* patientInf, int type);
DialogResult requestEditIpAndNetMask();
DialogResult requestEditIpAndNetMask(const QStringList& aEditData);
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()
{
delete mUI;
delete mInfo;
delete mJsonStr;
}
@@ -33,6 +32,11 @@ void PatientInformationForm::setPatientInformation(PatientInformation* informati
mInfo = information;
}
PatientInformation* PatientInformationForm::getPatientInformation()
{
return mInfo->Copy();
}
void PatientInformationForm::setProtocol(int type) {
mCurrentProtocol = type;
switch (type)
@@ -47,6 +51,11 @@ void PatientInformationForm::setProtocol(int type) {
}
}
int PatientInformationForm::getProtocol()
{
return mCurrentProtocol;
}
QString PatientInformationForm::getPatientID()
{
return mUI->lbl_ID->text();
@@ -55,12 +64,12 @@ QString PatientInformationForm::getPatientID()
const char* PatientInformationForm::getCurrentPatientJsonString(bool empty)
{
cJSON* patientInfoObject = cJSON_CreateObject();
cJSON_AddItemToObject(patientInfoObject, "PatientName", cJSON_CreateString(mUI->lbl_Name->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientID", cJSON_CreateString(mUI->lbl_ID->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "AccessionNumber", cJSON_CreateString(mUI->lbl_Acc->text().toStdString().data()));
cJSON_AddItemToObject(patientInfoObject, "PatientSex", cJSON_CreateString(mUI->lbl_Sex->text().toStdString().data()));
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, "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, "IsEmptyData", cJSON_CreateNumber(empty ? 1 : 0));
cJSON_AddItemToObject(patientInfoObject, "OperatorName", cJSON_CreateString(User::Current()->getUserName().toStdString().c_str()));

View File

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

View File

@@ -14,6 +14,7 @@
#include "forms/scan/PatientInformationForm.h"
#include "event/EventCenter.h"
#include "dialogs/DialogManager.h"
#include "log/UserOperationLog.h"
#include "json/jsonobject.h"
#include "device/DeviceManager.h"
@@ -180,6 +181,11 @@ void ScanFormWidget::initScanControlBar(QHBoxLayout *layout){
});
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()){

View File

@@ -15,15 +15,11 @@ QWidget(parent),
mUI(new Ui::PatientDetailForm)
, mBtnEdit(new QToolButton())
, mBtnDelete(new QToolButton())
, mBtnPlaceWidget(new QWidget(this))
, mLblMessage(new QLabel(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->lblIcon->setObjectName("PatIcon");
mUI->lbl_DOB->setObjectName("displayDetail");
@@ -33,13 +29,13 @@ mUI(new Ui::PatientDetailForm)
mUI->lblAccno->setObjectName("displayDetail");
mUI->lblAddDate->setObjectName("displayDetail");
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this,&PatientDetailForm::reloadLanguage);
QWidget * widget = new QWidget(this);
widget->setFixedHeight(120);
mBtnPlaceWidget->setFixedHeight(120);
mUI->verticalLayout_2->setSpacing(50);
mUI->verticalLayout_3->insertWidget(5, widget);
QHBoxLayout * layout = new QHBoxLayout(widget);
mUI->verticalLayout_3->insertWidget(5, mBtnPlaceWidget);
mUI->verticalLayout_3->insertWidget(5, mLblMessage);
mLblMessage->setVisible(false);
QHBoxLayout * layout = new QHBoxLayout(mBtnPlaceWidget);
mBtnEdit->setObjectName("btnPatEdit");
mBtnDelete->setObjectName("btnPatDelete");
mBtnEdit->setText(tr("Edit"));
@@ -88,6 +84,16 @@ void PatientDetailForm::clearPatientInformation() {
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() {
}

View File

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

View File

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

View File

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