377 lines
8.7 KiB
C++
377 lines
8.7 KiB
C++
#ifndef PATIENT_DIALOG_H
|
||
#define PATIENT_DIALOG_H
|
||
|
||
#include <QDialog>
|
||
#include <QDialogButtonBox>
|
||
#include <QComboBox>
|
||
#include <QTextEdit>
|
||
#include <QLabel>
|
||
#include <QPushButton>
|
||
#include <QTableWidget>
|
||
#include <QFormLayout>
|
||
#include <QVBoxLayout>
|
||
#include <QHBoxLayout>
|
||
#include <QGroupBox>
|
||
#include <QHeaderView>
|
||
#include <QMessageBox>
|
||
#include <QDateEdit>
|
||
#include <QTabWidget>
|
||
#include <QList>
|
||
#include <QString>
|
||
#include <QSpinBox>
|
||
#include <QDoubleSpinBox>
|
||
#include <ctime>
|
||
#include <vector>
|
||
#include <string>
|
||
#include <set>
|
||
|
||
// Forward declarations
|
||
namespace core {
|
||
class HisCore;
|
||
}
|
||
class Patient;
|
||
class Ward;
|
||
|
||
// 统一的患者信息添加/编辑对话框
|
||
class PatientAddDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit PatientAddDialog(core::HisCore& core, const QString& patientId = QString(), QWidget* parent = nullptr);
|
||
~PatientAddDialog();
|
||
|
||
// 获取患者信息
|
||
QString getName() const;
|
||
int getAge() const;
|
||
QString getGender() const;
|
||
QString getContact() const;
|
||
QString getStatus() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
void loadPatientData();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
bool isEditMode_;
|
||
|
||
// UI 组件
|
||
QFormLayout* formLayout_;
|
||
QLabel* idLabel_;
|
||
QLineEdit* nameEdit_;
|
||
QSpinBox* ageSpin_;
|
||
QComboBox* genderCombo_;
|
||
QLineEdit* contactEdit_;
|
||
QComboBox* statusCombo_;
|
||
QDialogButtonBox* buttonBox_;
|
||
};
|
||
|
||
// 统一的入院对话框
|
||
class PatientAdmitDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit PatientAdmitDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~PatientAdmitDialog();
|
||
|
||
QString getWardId() const;
|
||
QString getBedId() const;
|
||
QString getReason() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
QComboBox* wardCombo_;
|
||
QComboBox* bedCombo_;
|
||
QTextEdit* reasonEdit_;
|
||
QLabel* dateLabel_;
|
||
QDialogButtonBox* buttonBox_;
|
||
};
|
||
|
||
// 统一的诊断记录添加对话框
|
||
class DiagnosisAddDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit DiagnosisAddDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~DiagnosisAddDialog();
|
||
|
||
QString getDoctorId() const;
|
||
QString getDiagnosis() const;
|
||
QString getPrescription() const;
|
||
QString getRemarks() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
QComboBox* doctorCombo_;
|
||
QLabel* dateLabel_;
|
||
QTextEdit* diagnosisEdit_;
|
||
QTextEdit* prescriptionEdit_;
|
||
QLineEdit* remarksEdit_;
|
||
QDialogButtonBox* buttonBox_;
|
||
};
|
||
|
||
// 统一的药品管理对话框(添加/更新)
|
||
class MedicineManageDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit MedicineManageDialog(core::HisCore& core, const QString& medicineId = QString(), QWidget* parent = nullptr);
|
||
~MedicineManageDialog();
|
||
|
||
QString getGenericName() const;
|
||
QString getBrandName() const;
|
||
QString getDepartment() const;
|
||
int getStock() const;
|
||
double getPrice() const;
|
||
bool isEditMode() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
void loadMedicineData();
|
||
|
||
core::HisCore& core_;
|
||
QString medicineId_;
|
||
bool isEditMode_;
|
||
|
||
QLabel* idLabel_;
|
||
QLineEdit* genericEdit_;
|
||
QLineEdit* brandEdit_;
|
||
QComboBox* deptEdit_;
|
||
QSpinBox* stockSpin_;
|
||
QDoubleSpinBox* priceSpin_;
|
||
QDialogButtonBox* buttonBox_;
|
||
};
|
||
|
||
// 统一的病房床位管理对话框
|
||
class WardBedManageDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit WardBedManageDialog(core::HisCore& core, QWidget* parent = nullptr);
|
||
~WardBedManageDialog();
|
||
|
||
private:
|
||
void setupUI();
|
||
void addWard();
|
||
void addBed();
|
||
void deleteBed();
|
||
void refreshWardTable();
|
||
|
||
core::HisCore& core_;
|
||
|
||
QTabWidget* tabWidget_;
|
||
// 添加病房相关
|
||
QComboBox* wardDeptEdit_;
|
||
QComboBox* wardTypeCombo_;
|
||
QSpinBox* wardMaxBedsSpin_;
|
||
QLabel* wardIdDisplay_;
|
||
QTableWidget* wardTable_;
|
||
|
||
// 添加床位相关
|
||
QComboBox* bedWardCombo_;
|
||
QLabel* bedIdDisplay_;
|
||
|
||
// 删除床位相关
|
||
QComboBox* deleteBedWardCombo_;
|
||
QComboBox* deleteBedCombo_;
|
||
QPushButton* applyDeleteBedBtn_;
|
||
};
|
||
|
||
// 病房使用情况显示对话框
|
||
class WardOccupancyDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit WardOccupancyDialog(core::HisCore& core, QWidget* parent = nullptr);
|
||
~WardOccupancyDialog();
|
||
|
||
private:
|
||
void setupUI();
|
||
void refreshData();
|
||
void showBedDetail();
|
||
|
||
struct WardSummary {
|
||
QString wardId;
|
||
QString department;
|
||
QString type;
|
||
int totalBeds;
|
||
int occupied;
|
||
int free;
|
||
double rate;
|
||
};
|
||
|
||
core::HisCore& core_;
|
||
QComboBox* wardTypeFilter_;
|
||
QComboBox* gradeFilter_;
|
||
QTableWidget* summaryTable_;
|
||
QTableWidget* bedDetailTable_;
|
||
QList<WardSummary> wardSummaries_;
|
||
};
|
||
|
||
// 统一的医生添加/编辑对话框
|
||
class DoctorAddDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit DoctorAddDialog(core::HisCore& core, const QString& doctorId = QString(), QWidget* parent = nullptr);
|
||
~DoctorAddDialog();
|
||
|
||
QString getName() const;
|
||
QString getDepartment() const;
|
||
QString getTitle() const;
|
||
QString getSchedule() const;
|
||
bool isEditMode() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
void loadDoctorData();
|
||
|
||
core::HisCore& core_;
|
||
QString doctorId_;
|
||
bool isEditMode_;
|
||
|
||
QLabel* idLabel_;
|
||
QLineEdit* nameEdit_;
|
||
QComboBox* deptEdit_;
|
||
QComboBox* titleCombo_;
|
||
QLineEdit* scheduleEdit_;
|
||
QDialogButtonBox* buttonBox_;
|
||
};
|
||
|
||
// 病例查看对话框
|
||
class PatientCaseViewDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit PatientCaseViewDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~PatientCaseViewDialog();
|
||
|
||
private:
|
||
void setupUI();
|
||
void refreshCaseDisplay();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
QTabWidget* tabWidget_;
|
||
QComboBox* sortComboBox_;
|
||
QTextEdit* diagnosisTextEdit_;
|
||
QTextEdit* medicineTextEdit_;
|
||
QTextEdit* admissionTextEdit_;
|
||
QTableWidget* diagnosisTable_;
|
||
QTableWidget* medicineTable_;
|
||
QTableWidget* admissionTable_;
|
||
QTableWidget* checkTable_;
|
||
QTableWidget* appointmentTable_;
|
||
};
|
||
|
||
// 添加用药记录对话框
|
||
class MedicineRecordAddDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit MedicineRecordAddDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~MedicineRecordAddDialog();
|
||
|
||
QString getMedicineId() const;
|
||
int getQuantity() const;
|
||
QString getUsage() const;
|
||
QString getDoctorId() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
void onMedicineSelected();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
QComboBox* medicineCombo_;
|
||
QLabel* stockLabel_;
|
||
QLabel* priceLabel_;
|
||
QSpinBox* quantitySpin_;
|
||
QComboBox* usageCombo_;
|
||
QComboBox* doctorCombo_;
|
||
QDialogButtonBox* buttonBox_;
|
||
|
||
QString selectedMedicineId_;
|
||
QString selectedDoctorId_;
|
||
};
|
||
|
||
// 添加检查记录对话框
|
||
class CheckRecordAddDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit CheckRecordAddDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~CheckRecordAddDialog();
|
||
|
||
QString getCheckId() const;
|
||
QString getDoctorId() const;
|
||
|
||
private:
|
||
void setupUI();
|
||
void onCheckSelected();
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
QComboBox* checkCombo_;
|
||
QLabel* priceLabel_;
|
||
QComboBox* doctorCombo_;
|
||
QDialogButtonBox* buttonBox_;
|
||
|
||
QString selectedCheckId_;
|
||
QString selectedDoctorId_;
|
||
};
|
||
|
||
// 挂号对话框
|
||
class RegistrationDialog : public QDialog {
|
||
Q_OBJECT
|
||
|
||
public:
|
||
explicit RegistrationDialog(core::HisCore& core, const QString& patientId, QWidget* parent = nullptr);
|
||
~RegistrationDialog();
|
||
|
||
QString getDepartmentId() const;
|
||
QString getDoctorId() const;
|
||
int getRegistrationType() const; // 获取挂号类型:0=门诊,1=急诊
|
||
|
||
private slots:
|
||
void onDepartmentChanged(int index);
|
||
void onDoctorSelected(int row, int column);
|
||
void onRegistrationTypeChanged(int index); // 挂号类型变化处理
|
||
void confirmRegistration();
|
||
|
||
private:
|
||
void setupUI();
|
||
void loadDepartments();
|
||
void loadDoctorsForDepartment(const QString& deptId);
|
||
|
||
core::HisCore& core_;
|
||
QString patientId_;
|
||
|
||
// UI components
|
||
QComboBox* departmentCombo_;
|
||
QTableWidget* doctorTable_;
|
||
QPushButton* confirmButton_;
|
||
QPushButton* cancelButton_;
|
||
QLabel* dateLabel_;
|
||
QLabel* feeLabel_; // 挂号费提示标签
|
||
QComboBox* registrationTypeCombo_; // 挂号类型选择:门诊/急诊
|
||
|
||
// Selected values
|
||
QString selectedDepartmentId_;
|
||
QString selectedDoctorId_;
|
||
int registrationType_; // 0 = 门诊, 1 = 急诊
|
||
};
|
||
|
||
#endif // PATIENT_DIALOG_H
|