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
#include "dialogs/GUIFormBaseDialog.h"
#include "forms/select/editpatientform.h"
#include "forms/select/PatientDetailForm.h"
class ULineEdit;
class UTextEdit;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

View File

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