更新支持模糊查询,并可以成功查询
This commit is contained in:
parent
e94d92aeec
commit
b9e7314042
Binary file not shown.
@ -150,7 +150,7 @@ int DataManager::getMedicRecordCount( QString sName)
|
|||||||
{
|
{
|
||||||
if (query->first())
|
if (query->first())
|
||||||
{
|
{
|
||||||
ret = query->value(0).toUInt();
|
ret = query->value(0).toInt();
|
||||||
}
|
}
|
||||||
query->finish();
|
query->finish();
|
||||||
query->clear();
|
query->clear();
|
||||||
@ -168,7 +168,7 @@ uint DataManager::getMedicRecordList(const QString& fileName,
|
|||||||
uint ret = 0;
|
uint ret = 0;
|
||||||
filesInfo.clear();
|
filesInfo.clear();
|
||||||
QString tmpFileName = fileName;
|
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_RecodManage where f_Name LIKE '%") + tmpFileName + "%'";
|
QString querySql = QString("SELECT f_CheckNum,f_Type,f_Name, f_Sex,f_Birthday,f_Year,f_Laterality,f_InspectDate,f_Other from t_RecodManage where f_Name LIKE '%") + tmpFileName + "%'";
|
||||||
querySql += QString(" LIMIT %1 offset %2;").arg(perPageCnt)
|
querySql += QString(" LIMIT %1 offset %2;").arg(perPageCnt)
|
||||||
.arg(curPage * perPageCnt);
|
.arg(curPage * perPageCnt);
|
||||||
|
|
||||||
@ -180,9 +180,6 @@ uint DataManager::getMedicRecordList(const QString& fileName,
|
|||||||
}
|
}
|
||||||
while (query->next())
|
while (query->next())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MedicRecord info;
|
MedicRecord info;
|
||||||
info.m_CheckNum= query->value(0).toString();
|
info.m_CheckNum= query->value(0).toString();
|
||||||
info.m_Type = query->value(1).toString();
|
info.m_Type = query->value(1).toString();
|
||||||
@ -191,7 +188,8 @@ uint DataManager::getMedicRecordList(const QString& fileName,
|
|||||||
info.m_Birthday = query->value(4).toString();
|
info.m_Birthday = query->value(4).toString();
|
||||||
info.m_Year = query->value(5).toString();
|
info.m_Year = query->value(5).toString();
|
||||||
info.m_Laterality = query->value(6).toString();
|
info.m_Laterality = query->value(6).toString();
|
||||||
info.m_Other = query->value(7).toString();
|
info.m_InspectDate= query->value(7).toString();
|
||||||
|
info.m_Other = query->value(8).toString();
|
||||||
|
|
||||||
filesInfo.append(info);
|
filesInfo.append(info);
|
||||||
++ret;
|
++ret;
|
||||||
|
@ -13,7 +13,7 @@ struct MedicRecord
|
|||||||
QString m_Birthday;
|
QString m_Birthday;
|
||||||
QString m_Year;
|
QString m_Year;
|
||||||
QString m_Laterality;
|
QString m_Laterality;
|
||||||
QString InspectDate;
|
QString m_InspectDate;
|
||||||
QString m_Other;
|
QString m_Other;
|
||||||
};
|
};
|
||||||
class DataManager:public QObject
|
class DataManager:public QObject
|
||||||
|
@ -279,12 +279,14 @@ bool MedicalRecordManager::initConnect()
|
|||||||
void MedicalRecordManager::slotSearch()
|
void MedicalRecordManager::slotSearch()
|
||||||
{
|
{
|
||||||
qDebug()<<"search"<<endl;
|
qDebug()<<"search"<<endl;
|
||||||
|
m_currentPage = 0;
|
||||||
|
updateContext();
|
||||||
|
|
||||||
}
|
}
|
||||||
void MedicalRecordManager::initTable()
|
void MedicalRecordManager::initTable()
|
||||||
{
|
{
|
||||||
m_tableWidget.setFocusPolicy(Qt::NoFocus);
|
m_tableWidget.setFocusPolicy(Qt::NoFocus);
|
||||||
m_tableWidget.setColumnCount(8);
|
m_tableWidget.setColumnCount(9);
|
||||||
m_tableWidget.setRowCount(100);
|
m_tableWidget.setRowCount(100);
|
||||||
//m_tableWidget.setShowGrid(false);
|
//m_tableWidget.setShowGrid(false);
|
||||||
QFont font;
|
QFont font;
|
||||||
@ -322,6 +324,7 @@ void MedicalRecordManager::initTable()
|
|||||||
QTableWidgetItem *item_hash6 = new QTableWidgetItem;
|
QTableWidgetItem *item_hash6 = new QTableWidgetItem;
|
||||||
QTableWidgetItem *item_butt7 = new QTableWidgetItem;
|
QTableWidgetItem *item_butt7 = new QTableWidgetItem;
|
||||||
QTableWidgetItem *item_createDate8 = new QTableWidgetItem;
|
QTableWidgetItem *item_createDate8 = new QTableWidgetItem;
|
||||||
|
QTableWidgetItem *item_createDate9 = new QTableWidgetItem;
|
||||||
item_id->setData(Qt::DisplayRole, "");
|
item_id->setData(Qt::DisplayRole, "");
|
||||||
item_fileName->setData(Qt::DisplayRole, "");
|
item_fileName->setData(Qt::DisplayRole, "");
|
||||||
|
|
||||||
@ -342,13 +345,14 @@ void MedicalRecordManager::initTable()
|
|||||||
m_tableWidget.setItem(row, 5, item_hash6);
|
m_tableWidget.setItem(row, 5, item_hash6);
|
||||||
m_tableWidget.setItem(row, 6, item_butt7);
|
m_tableWidget.setItem(row, 6, item_butt7);
|
||||||
m_tableWidget.setItem(row, 7, item_createDate8);
|
m_tableWidget.setItem(row, 7, item_createDate8);
|
||||||
|
m_tableWidget.setItem(row, 8, item_createDate9);
|
||||||
|
|
||||||
//m_tableWidget.item(row, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
//m_tableWidget.item(row, 4)->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
}
|
}
|
||||||
QStringList lstHHead;
|
QStringList lstHHead;
|
||||||
/*("序号") "文件") << "修改日期"*/
|
/*("序号") "文件") << "修改日期"*/
|
||||||
lstHHead << tr("序号") << tr("检查号") << tr("类别") << tr("姓名") <<tr("性别")
|
lstHHead << tr("序号") << tr("检查号") << tr("类别") << tr("姓名") <<tr("性别")
|
||||||
<< tr("年龄") <<tr("左右利")<<tr("其他信息");
|
<< tr("年龄") <<tr("左右利")<<tr("检查日期")<<tr("其他信息");
|
||||||
m_tableWidget.setHorizontalHeaderLabels(lstHHead);//setWordWrap(true)
|
m_tableWidget.setHorizontalHeaderLabels(lstHHead);//setWordWrap(true)
|
||||||
//m_tableWidget.show();
|
//m_tableWidget.show();
|
||||||
}
|
}
|
||||||
@ -405,6 +409,7 @@ void MedicalRecordManager::updateContext()
|
|||||||
QTableWidgetItem *item_Sex = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Sex = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_Age = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Age = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_Laterality = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Laterality = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_inspectDate = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_other = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_other = m_tableWidget.item(row, col++);
|
||||||
item_id->setCheckState(Qt::Unchecked);
|
item_id->setCheckState(Qt::Unchecked);
|
||||||
item_id->setFlags(Qt::ItemIsEditable| Qt::ItemIsSelectable| Qt::ItemIsUserCheckable| Qt::ItemIsEnabled| Qt::ItemIsDragEnabled| Qt::ItemIsDropEnabled);
|
item_id->setFlags(Qt::ItemIsEditable| Qt::ItemIsSelectable| Qt::ItemIsUserCheckable| Qt::ItemIsEnabled| Qt::ItemIsDragEnabled| Qt::ItemIsDropEnabled);
|
||||||
@ -419,7 +424,14 @@ void MedicalRecordManager::updateContext()
|
|||||||
}
|
}
|
||||||
item_id->setData(Qt::DisplayRole, row + 1 + (id_page - 1) * 100);
|
item_id->setData(Qt::DisplayRole, row + 1 + (id_page - 1) * 100);
|
||||||
//设置数据
|
//设置数据
|
||||||
|
item_m_CheckNum->setData(Qt::DisplayRole, lstInfo.at(row).m_CheckNum);
|
||||||
|
item_type->setData(Qt::UserRole, lstInfo.at(row).m_Type);
|
||||||
|
item_Name->setData(Qt::DisplayRole, lstInfo.at(row).m_Name);
|
||||||
|
item_Sex->setData(Qt::DisplayRole, lstInfo.at(row).m_Sex);
|
||||||
|
item_Age->setData(Qt::DisplayRole, lstInfo.at(row).m_Year);
|
||||||
|
item_Laterality->setData(Qt::DisplayRole, lstInfo.at(row).m_Laterality);
|
||||||
|
item_inspectDate->setData(Qt::DisplayRole, lstInfo.at(row).m_InspectDate);
|
||||||
|
item_other->setData(Qt::DisplayRole, lstInfo.at(row).m_Other);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row < m_tableWidget.rowCount())
|
if (row < m_tableWidget.rowCount())
|
||||||
@ -434,6 +446,7 @@ void MedicalRecordManager::updateContext()
|
|||||||
QTableWidgetItem *item_Sex = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Sex = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_Age = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Age = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_Laterality = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_Laterality = m_tableWidget.item(row, col++);
|
||||||
|
QTableWidgetItem *item_inspectDate = m_tableWidget.item(row, col++);
|
||||||
QTableWidgetItem *item_other = m_tableWidget.item(row, col++);
|
QTableWidgetItem *item_other = m_tableWidget.item(row, col++);
|
||||||
item_id->setData(Qt::CheckStateRole, QVariant());
|
item_id->setData(Qt::CheckStateRole, QVariant());
|
||||||
item_id->setData(Qt::DisplayRole, "");
|
item_id->setData(Qt::DisplayRole, "");
|
||||||
@ -445,6 +458,7 @@ void MedicalRecordManager::updateContext()
|
|||||||
item_Age->setData(Qt::DisplayRole, "");
|
item_Age->setData(Qt::DisplayRole, "");
|
||||||
item_Age->setData(Qt::DisplayRole, "");
|
item_Age->setData(Qt::DisplayRole, "");
|
||||||
item_Laterality->setData(Qt::DisplayRole, "");
|
item_Laterality->setData(Qt::DisplayRole, "");
|
||||||
|
item_inspectDate->setData(Qt::DisplayRole, "");
|
||||||
item_other->setData(Qt::DisplayRole, "");
|
item_other->setData(Qt::DisplayRole, "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,39 @@ void MedicalRecordWidget::init()
|
|||||||
// m_labName.setFixedWidth(iwidth);
|
// m_labName.setFixedWidth(iwidth);
|
||||||
// m_labLaterality.setFixedWidth(iwidth);
|
// m_labLaterality.setFixedWidth(iwidth);
|
||||||
//m_labDiagnosticRecord.setFixedWidth(iwidth);
|
//m_labDiagnosticRecord.setFixedWidth(iwidth);
|
||||||
|
m_btnOk.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9aab;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
|
|
||||||
|
m_btnCancel.setStyleSheet("QPushButton{\
|
||||||
|
background: white;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:hover{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:pressed{\
|
||||||
|
background: #0d9aab;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}\
|
||||||
|
QPushButton:checked{\
|
||||||
|
background: #0d9ddb;\
|
||||||
|
border-radius:10px;padding:7px 10px;\
|
||||||
|
}");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void MedicalRecordWidget::initLay()
|
void MedicalRecordWidget::initLay()
|
||||||
@ -267,11 +299,11 @@ void MedicalRecordWidget::slotSave()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//出生日期
|
//出生日期
|
||||||
QString Birthday = m_dateBirthDay.dateTime().toString("yyyymmdd hh:mm:ss");
|
QString Birthday = m_dateBirthDay.dateTime().toString("yyyy/MM/dd hh:mm:ss");
|
||||||
|
|
||||||
//检查日期
|
//检查日期
|
||||||
|
|
||||||
QString inspectDate = m_dateInspection.dateTime().toString("yyyymmdd hh:mm:ss");;
|
QString inspectDate = m_dateInspection.dateTime().toString("yyyy/MM/dd hh:mm:ss");;
|
||||||
|
|
||||||
//诊断病历
|
//诊断病历
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user