1 增加检查日期 2 数据成功保存
This commit is contained in:
parent
a25057fa35
commit
e94d92aeec
Binary file not shown.
@ -53,6 +53,7 @@ void DataManager::initTable()
|
||||
map.insert("f_Birthday", "TEXT");
|
||||
map.insert("f_Year", "TEXT");
|
||||
map.insert("f_Laterality", "TEXT");
|
||||
map.insert("f_InspectDate", "TEXT");
|
||||
map.insert("f_Other", "TEXT");
|
||||
SqlGenerate sqlGener;
|
||||
QString sql = sqlGener.createTable("t_RecodManage",map);
|
||||
@ -121,6 +122,7 @@ bool DataManager::updateMedicRecord(
|
||||
QString Birthday,
|
||||
QString Year,
|
||||
QString Laterality,
|
||||
QString InspectDate,
|
||||
QString Other)
|
||||
{
|
||||
QMap<QString, QVariant> map;
|
||||
@ -131,16 +133,17 @@ bool DataManager::updateMedicRecord(
|
||||
map.insert("f_Birthday", Birthday);
|
||||
map.insert("f_Year", Year);
|
||||
map.insert("f_Laterality", Laterality);
|
||||
map.insert("f_InspectDate", InspectDate);
|
||||
map.insert("f_Other", Other);
|
||||
SqlGenerate sqlGener;
|
||||
QString sql = sqlGener.insertData("t_MedicRecords",map);
|
||||
QString sql = sqlGener.insertData("t_RecodManage",map);
|
||||
qDebug()<<sql<<endl;
|
||||
return m_sqlcore.execute(sql);
|
||||
}
|
||||
int DataManager::getMedicRecordCount( QString sName)
|
||||
{
|
||||
int ret = -1;
|
||||
QString querySql = QString("select count(*) from t_MedicRecords where f_Name LIKE '%") + sName + "%';";
|
||||
QString querySql = QString("select count(*) from t_RecodManage where f_Name LIKE '%") + sName + "%';";
|
||||
//qDebug() << "querySql = " << querySql << endl;
|
||||
auto query(m_sqlcore.select(querySql));
|
||||
if (!query.isNull())
|
||||
@ -165,7 +168,7 @@ uint DataManager::getMedicRecordList(const QString& fileName,
|
||||
uint ret = 0;
|
||||
filesInfo.clear();
|
||||
QString tmpFileName = fileName;
|
||||
QString querySql = QString("SELECT f_CheckNum,f_Type,f_Name, f_Sex,f_Birthday,f_Year,f_Laterality,f_Other from t_MedicRecords where f_Name LIKE '%") + tmpFileName + "%'";
|
||||
QString querySql = QString("SELECT f_CheckNum,f_Type,f_Name, f_Sex,f_Birthday,f_Year,f_Laterality,f_Other from t_RecodManage where f_Name LIKE '%") + tmpFileName + "%'";
|
||||
querySql += QString(" LIMIT %1 offset %2;").arg(perPageCnt)
|
||||
.arg(curPage * perPageCnt);
|
||||
|
||||
|
@ -13,6 +13,7 @@ struct MedicRecord
|
||||
QString m_Birthday;
|
||||
QString m_Year;
|
||||
QString m_Laterality;
|
||||
QString InspectDate;
|
||||
QString m_Other;
|
||||
};
|
||||
class DataManager:public QObject
|
||||
@ -39,6 +40,7 @@ public:
|
||||
QString _Birthday,
|
||||
QString Year,
|
||||
QString Laterality,
|
||||
QString InspectDate,
|
||||
QString Other);
|
||||
int getMedicRecordCount(QString sName);
|
||||
uint getMedicRecordList(const QString& fileName,
|
||||
|
@ -411,5 +411,5 @@ void HospitalInfo::slotSave()
|
||||
}
|
||||
void HospitalInfo::slotCancel()
|
||||
{
|
||||
|
||||
//
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QFontMetrics>
|
||||
#include <QDebug>
|
||||
#include <QGroupBox>
|
||||
#include "datamanager.h"
|
||||
MedicalRecordWidget::MedicalRecordWidget(QWidget * parent ):QWidget(parent)
|
||||
{
|
||||
init();
|
||||
@ -212,6 +213,83 @@ void MedicalRecordWidget::initLay()
|
||||
|
||||
}
|
||||
bool MedicalRecordWidget::initConnect()
|
||||
{
|
||||
bool reok;
|
||||
reok = connect(&m_btnOk,SIGNAL(clicked()),this,SLOT(slotSave()));
|
||||
if(!reok)
|
||||
{
|
||||
qDebug()<<"save connect failed"<<endl;
|
||||
}
|
||||
reok = connect(&m_btnCancel,SIGNAL(clicked()),this,SLOT(slotCancel()));
|
||||
if(!reok)
|
||||
{
|
||||
qDebug()<<"save connect failed"<<endl;
|
||||
}
|
||||
}
|
||||
void MedicalRecordWidget::slotSave()
|
||||
{
|
||||
|
||||
QString CheckNum = m_editCheckNum.text();
|
||||
//住院 hospitalized
|
||||
QString Type ;
|
||||
if(m_chHospitalized.isChecked())
|
||||
{
|
||||
Type = m_chHospitalized.text();
|
||||
}
|
||||
else
|
||||
{
|
||||
Type = m_chHospitalized.text();
|
||||
}
|
||||
//姓名
|
||||
QString Name = m_editName.text();
|
||||
//性别
|
||||
QString Sex;
|
||||
if(m_chMan.isChecked())
|
||||
{
|
||||
Sex = m_chMan.text();
|
||||
}
|
||||
else
|
||||
{
|
||||
Sex = m_chWan.text();
|
||||
}
|
||||
//年龄
|
||||
|
||||
QString Year = m_editAge.text();
|
||||
//左右利
|
||||
QString Laterality;
|
||||
if(m_chLeft.isChecked())
|
||||
{
|
||||
Laterality = m_chLeft.text();
|
||||
}
|
||||
else
|
||||
{
|
||||
Laterality = m_chRfight.text();
|
||||
}
|
||||
|
||||
//出生日期
|
||||
QString Birthday = m_dateBirthDay.dateTime().toString("yyyymmdd hh:mm:ss");
|
||||
|
||||
//检查日期
|
||||
|
||||
QString inspectDate = m_dateInspection.dateTime().toString("yyyymmdd hh:mm:ss");;
|
||||
|
||||
//诊断病历
|
||||
|
||||
QString Other = m_textDiagnosticRecord.toPlainText();
|
||||
DataManager::instance().updateMedicRecord(
|
||||
CheckNum ,
|
||||
Type ,
|
||||
Name ,
|
||||
Sex,
|
||||
Birthday,
|
||||
Year,
|
||||
Laterality,
|
||||
inspectDate,
|
||||
Other);
|
||||
|
||||
|
||||
}
|
||||
void MedicalRecordWidget::slotCancel()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,9 @@ public:
|
||||
void init();
|
||||
void initLay();
|
||||
bool initConnect();
|
||||
private slots:
|
||||
void slotSave();
|
||||
void slotCancel();
|
||||
private:
|
||||
|
||||
QGroupBox m_gbx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user