Rename editpatientform to PatientDetailForm

This commit is contained in:
Krad
2022-06-14 14:43:41 +08:00
parent 1a410e4ba4
commit df7676b8f0
12 changed files with 32 additions and 30 deletions

View File

@@ -6,7 +6,7 @@
#define GUI_EDITPATIENTDIALOG_H #define GUI_EDITPATIENTDIALOG_H
#include "dialogs/GUIFormBaseDialog.h" #include "dialogs/GUIFormBaseDialog.h"
#include "forms/select/editpatientform.h" #include "forms/select/PatientDetailForm.h"
class ULineEdit; class ULineEdit;
class UTextEdit; class UTextEdit;

View File

@@ -2,7 +2,7 @@
#define PATIENTINFORMATIONFORM_H #define PATIENTINFORMATIONFORM_H
#include <QWidget> #include <QWidget>
#include "src/forms/select/editpatientform.h" #include "src/forms/select/PatientDetailForm.h"
namespace Ui { namespace Ui {
class PatientInformationForm; class PatientInformationForm;
} }

View File

@@ -1,5 +1,6 @@
#include "editpatientform.h" #include "PatientDetailForm.h"
#include "ui_editpatientform.h" #include "ui_PatientDetailForm.h"
#include <QListView> #include <QListView>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QToolButton> #include <QToolButton>
@@ -8,9 +9,9 @@
#include <qdebug.h> #include <qdebug.h>
#include "event/EventCenter.h" #include "event/EventCenter.h"
EditPatientForm::EditPatientForm(QWidget* parent) : PatientDetailForm::PatientDetailForm(QWidget* parent) :
QWidget(parent), QWidget(parent),
mUI(new Ui::EditPatientForm) mUI(new Ui::PatientDetailForm)
{ {
mUI->setupUi(this); mUI->setupUi(this);
mUI->hideBtn->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Preferred); mUI->hideBtn->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Preferred);
@@ -35,21 +36,21 @@ EditPatientForm::EditPatientForm(QWidget* parent) :
mUI->rtbxComment->setEnabled(false); mUI->rtbxComment->setEnabled(false);
mUI->rtbxComment->setObjectName("display_tbx"); mUI->rtbxComment->setObjectName("display_tbx");
connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this,&EditPatientForm::reloadLanguage); connect(EventCenter::Default(), &EventCenter::ReloadLanguage, this,&PatientDetailForm::reloadLanguage);
} }
void EditPatientForm::reloadLanguage() { void PatientDetailForm::reloadLanguage() {
mUI->retranslateUi(this); mUI->retranslateUi(this);
mUI->tbxSex->setText(mStore.Sex == "F" ? tr("Female") : (mStore.Sex == "M" ? tr("Male") : tr("Other"))); mUI->tbxSex->setText(mStore.Sex == "F" ? tr("Female") : (mStore.Sex == "M" ? tr("Male") : tr("Other")));
} }
EditPatientForm::~EditPatientForm() PatientDetailForm::~PatientDetailForm()
{ {
delete mUI; delete mUI;
} }
void EditPatientForm::setPatientInformation(PatientInformation* information) { void PatientDetailForm::setPatientInformation(PatientInformation* information) {
if (information) if (information)
{ {
mUI->tbxID->setText(information->ID); mUI->tbxID->setText(information->ID);
@@ -64,7 +65,7 @@ void EditPatientForm::setPatientInformation(PatientInformation* information) {
} }
} }
void EditPatientForm::clearPatientInformation() { void PatientDetailForm::clearPatientInformation() {
mUI->tbxID->clear(); mUI->tbxID->clear();
mUI->tbxDob->setDate(QDate::currentDate()); mUI->tbxDob->setDate(QDate::currentDate());
mUI->tbxName->clear(); mUI->tbxName->clear();
@@ -74,7 +75,7 @@ void EditPatientForm::clearPatientInformation() {
mAddDate.clear(); mAddDate.clear();
} }
void EditPatientForm::storePatientInformation() { void PatientDetailForm::storePatientInformation() {
mStore.PatientUID = mCurrentPatientUID; mStore.PatientUID = mCurrentPatientUID;
mStore.AddDate = mAddDate; mStore.AddDate = mAddDate;
mStore.ID = mUI->tbxID->text(); mStore.ID = mUI->tbxID->text();

View File

@@ -1,17 +1,17 @@
#ifndef EDITPATIENTFORM_H #ifndef EDITPATIENTFORM_H
#define EDITPATIENTFORM_H #define EDITPATIENTFORM_H
namespace Ui { namespace Ui {
class EditPatientForm; class PatientDetailForm;
} }
#include <QWidget> #include <QWidget>
#include "PatientInformation.h" #include "PatientInformation.h"
class QToolButton; class QToolButton;
class EditPatientForm : public QWidget class PatientDetailForm : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit EditPatientForm(QWidget *parent = nullptr); explicit PatientDetailForm(QWidget *parent = nullptr);
~EditPatientForm(); ~PatientDetailForm();
void setPatientInformation(PatientInformation * information); void setPatientInformation(PatientInformation * information);
PatientInformation * getPatientInformation(){ PatientInformation * getPatientInformation(){
return &mStore; return &mStore;
@@ -23,7 +23,7 @@ signals:
private: private:
void storePatientInformation(); void storePatientInformation();
void reloadLanguage(); void reloadLanguage();
Ui::EditPatientForm *mUI; Ui::PatientDetailForm *mUI;
QString mCurrentPatientUID; QString mCurrentPatientUID;
QString mAddDate; QString mAddDate;
PatientInformation mStore; PatientInformation mStore;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>EditPatientForm</class> <class>PatientDetailForm</class>
<widget class="QWidget" name="EditPatientForm"> <widget class="QWidget" name="PatientDetailForm">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@@ -32,12 +32,13 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
, mBtnSelect(new QToolButton(this)) , mBtnSelect(new QToolButton(this))
, mPatTable(new SlideTableView(this)) , mPatTable(new SlideTableView(this))
, mModel(nullptr) , mModel(nullptr)
, mEditPatForm(new EditPatientForm(this)) , mEditPatForm(new PatientDetailForm(this))
{ {
//init command bar //init command bar
auto layout = new QHBoxLayout(); auto layout = new QHBoxLayout();
ui->commandWidget->setLayout(layout); ui->commandWidget->setLayout(layout);
initGeneralButtons(layout); initGeneralButtons(layout);
layout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding)); layout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
addVerticalLine(layout); addVerticalLine(layout);
initPatEditButtons(layout); initPatEditButtons(layout);
@@ -47,7 +48,7 @@ SelectFormWidget::SelectFormWidget(QWidget* parent)
contentLayout->setContentsMargins(5, 5, 0, 5); contentLayout->setContentsMargins(5, 5, 0, 5);
this->ui->contentWidget->setLayout(contentLayout); this->ui->contentWidget->setLayout(contentLayout);
initTableView(contentLayout); initTableView(contentLayout);
addVerticalLine(layout); addVerticalLine(contentLayout);
initDetailPanel(contentLayout); initDetailPanel(contentLayout);
//select default row 0 //select default row 0
if (mModel->rowCount() > 0) if (mModel->rowCount() > 0)
@@ -205,7 +206,7 @@ void SelectFormWidget::initDetailPanel(QHBoxLayout *contentLayout) {// prepare e
btnShowEdit->hide(); btnShowEdit->hide();
}); });
//btn hide slot //btn hide slot
connect(mEditPatForm, &EditPatientForm::hideBtnClicked, [=]() { connect(mEditPatForm, &PatientDetailForm::hideBtnClicked, [=]() {
mEditPatForm->hide(); mEditPatForm->hide();
btnShowEdit->show(); btnShowEdit->show();
}); });
@@ -266,7 +267,7 @@ void SelectFormWidget::initDataModel() {//TODO:单独初始化预防SQL错误
} }
void SelectFormWidget::setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, void SelectFormWidget::setPatientDetail(const SlideTableView *table, const QSqlTableModel *model,
EditPatientForm *edit_patient) const { PatientDetailForm *edit_patient) const {
PatientInformation pat; PatientInformation pat;
#define ADD_PATIENT_PROPERTY(val)\ #define ADD_PATIENT_PROPERTY(val)\
pat. val = model->data(model->index(table->currentIndex().row(),PatientInformationEnum:: val),Qt::EditRole).toString(); pat. val = model->data(model->index(table->currentIndex().row(),PatientInformationEnum:: val),Qt::EditRole).toString();

View File

@@ -8,7 +8,7 @@
#include "forms/tabformwidget.h" #include "forms/tabformwidget.h"
#include "EditPatientDialog.h" #include "EditPatientDialog.h"
class EditPatientForm; class PatientDetailForm;
class SlideTableView; class SlideTableView;
class QToolButton; class QToolButton;
class SelectFormWidget: public TabFormWidget { class SelectFormWidget: public TabFormWidget {
@@ -19,7 +19,7 @@ public:
private: private:
QString selectedPatientUID; QString selectedPatientUID;
void setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, EditPatientForm *edit_patient) const; void setPatientDetail(const SlideTableView *table, const QSqlTableModel *model, PatientDetailForm *edit_patient) const;
QToolButton* mBtnAccount; QToolButton* mBtnAccount;
QToolButton* mBtnWorklist; QToolButton* mBtnWorklist;
QToolButton* mBtnAdd; QToolButton* mBtnAdd;
@@ -28,7 +28,7 @@ private:
QToolButton* mBtnSelect; QToolButton* mBtnSelect;
SlideTableView* mPatTable; SlideTableView* mPatTable;
QSqlTableModel* mModel; QSqlTableModel* mModel;
EditPatientForm* mEditPatForm; PatientDetailForm* mEditPatForm;
void prepareButtons(bool disableALL); void prepareButtons(bool disableALL);
void initGeneralButtons(QHBoxLayout *layout); void initGeneralButtons(QHBoxLayout *layout);

View File

@@ -244,7 +244,7 @@
</message> </message>
</context> </context>
<context> <context>
<name>EditPatientForm</name> <name>PatientDetailForm</name>
<message> <message>
<source>Form</source> <source>Form</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

View File

@@ -244,7 +244,7 @@
</message> </message>
</context> </context>
<context> <context>
<name>EditPatientForm</name> <name>PatientDetailForm</name>
<message> <message>
<source>Form</source> <source>Form</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>

Binary file not shown.

View File

@@ -360,7 +360,7 @@
</message> </message>
</context> </context>
<context> <context>
<name>EditPatientForm</name> <name>PatientDetailForm</name>
<message> <message>
<location filename="../../out/build/x64-Debug/ui_editpatientform.h" line="142"/> <location filename="../../out/build/x64-Debug/ui_editpatientform.h" line="142"/>
<source>Form</source> <source>Form</source>

View File

@@ -360,7 +360,7 @@
</message> </message>
</context> </context>
<context> <context>
<name>EditPatientForm</name> <name>PatientDetailForm</name>
<message> <message>
<location filename="../../out/build/x64-Debug/ui_editpatientform.h" line="142"/> <location filename="../../out/build/x64-Debug/ui_editpatientform.h" line="142"/>
<source>Form</source> <source>Form</source>