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

@@ -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()){