支持医院信息保存
This commit is contained in:
parent
51f7c2a47c
commit
fb49dac74f
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
#include "datamanager.h"
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QFile>
|
||||
DataManager::DataManager(QObject * parent )
|
||||
{
|
||||
init();
|
||||
@ -17,36 +19,70 @@ DataManager::~DataManager()
|
||||
|
||||
void DataManager::init()
|
||||
{
|
||||
QString sFileName = QCoreApplication::applicationDirPath()+"/medicalRecode.db";
|
||||
//bool bexist = QFile::exists(sFileName);
|
||||
//if(bexist)
|
||||
{
|
||||
SqlCore::init("QSQLITE","user","passdwd",sFileName);
|
||||
}
|
||||
initTable();
|
||||
}
|
||||
void DataManager::initTable()
|
||||
{
|
||||
|
||||
/*
|
||||
病历管理
|
||||
检查号
|
||||
类型: 住院或门诊
|
||||
姓名
|
||||
性别 男女
|
||||
出生日期
|
||||
年龄
|
||||
左右利Laterality 左右
|
||||
检查日期 inspection
|
||||
其他信息
|
||||
*/
|
||||
//病例信息
|
||||
{
|
||||
/*
|
||||
病历管理
|
||||
检查号
|
||||
类型: 住院或门诊
|
||||
姓名
|
||||
性别 男女
|
||||
出生日期
|
||||
年龄
|
||||
左右利Laterality 左右
|
||||
检查日期 inspection
|
||||
其他信息
|
||||
*/
|
||||
|
||||
QMap<QString, QString> map;
|
||||
map.insert("f_CheckNum", "TEXT");
|
||||
map.insert("f_Type", "TEXT");
|
||||
map.insert("f_Name", "TEXT");
|
||||
map.insert("f_Sex", "TEXT");
|
||||
map.insert("f_Birthday", "TEXT");
|
||||
map.insert("f_Year", "TEXT");
|
||||
map.insert("f_Laterality", "TEXT");
|
||||
QMap<QString, QString> map;
|
||||
map.insert("f_CheckNum", "TEXT");
|
||||
map.insert("f_Type", "TEXT");
|
||||
map.insert("f_Name", "TEXT");
|
||||
map.insert("f_Sex", "TEXT");
|
||||
map.insert("f_Birthday", "TEXT");
|
||||
map.insert("f_Year", "TEXT");
|
||||
map.insert("f_Laterality", "TEXT");
|
||||
map.insert("f_Other", "TEXT");
|
||||
SqlGenerate sqlGener;
|
||||
QString sql = sqlGener.createTable("t_RecodManage",map);
|
||||
qDebug()<<sql<<endl;
|
||||
m_sqlcore.execute(sql);
|
||||
}
|
||||
//医院信息
|
||||
{
|
||||
/*
|
||||
医院名称
|
||||
用户名称
|
||||
科室
|
||||
用户密码
|
||||
用户人数
|
||||
确认密码
|
||||
数据名称
|
||||
*/
|
||||
QMap<QString, QString> map;
|
||||
map.insert("f_HostpitalName", "TEXT");
|
||||
map.insert("f_UserName", "TEXT");
|
||||
map.insert("f_Section", "TEXT");
|
||||
map.insert("f_UserPasswd", "TEXT");
|
||||
map.insert("f_UserNum", "TEXT");
|
||||
map.insert("f_RePasswd", "TEXT");
|
||||
map.insert("f_DataName", "TEXT");
|
||||
|
||||
SqlGenerate sqlGener;
|
||||
QString sql = sqlGener.createTable("t_RecodManage",map);
|
||||
qDebug()<<sql<<endl;
|
||||
m_sqlcore.execute(sql);
|
||||
SqlGenerate sqlGener;
|
||||
QString sql = sqlGener.createTable("t_Hostpital",map);
|
||||
qDebug()<<sql<<endl;
|
||||
m_sqlcore.execute(sql);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -367,5 +367,38 @@ vlay2->addStretch();
|
||||
}
|
||||
bool HospitalInfo::initConnect()
|
||||
{
|
||||
|
||||
bool reok;
|
||||
reok = connect(&m_btnOK,SIGNAL(clicked()),this,SLOT(slotSave()));
|
||||
if(!reok)
|
||||
{
|
||||
qDebug()<<"save connect failed"<<endl;
|
||||
}
|
||||
}
|
||||
void HospitalInfo::slotSave()
|
||||
{
|
||||
|
||||
//医院名称
|
||||
|
||||
QString sName = m_editHospitalName.text();
|
||||
//科室
|
||||
|
||||
QString sSection = m_editSection.text();
|
||||
//用户人数
|
||||
|
||||
QString sNum = m_editUserNum.text();
|
||||
|
||||
//数据名称
|
||||
|
||||
QString sDataNAme = m_editDataBaseName.text();
|
||||
|
||||
//用户名称
|
||||
QString sUserName = m_editUser.text();
|
||||
//用户密码
|
||||
QString sUserPasswd = m_editPasswd.text();
|
||||
//确认密码
|
||||
QString sRePasswwd = m_editRePasswd.text();
|
||||
}
|
||||
void HospitalInfo::slotCancel()
|
||||
{
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user