问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

哪家公司的电子病历系统能自主开发功能?

发布网友 发布时间:2022-04-08 00:57

我来回答

2个回答

懂视网 时间:2022-04-08 05:19

RFID读卡界面相关代码:

reader.h

#ifndef    READER_H

#define READER_H

//#include "function.h"         

#include <QLibrary>

#include <QDebug>

#include "function.h"    

class Reader

{

public:

    Reader(QWidget *parent);

    ~Reader();

    bool LoadDll();

    bool CloseDll();

    MF_Read_Func MF_Read;

    MF_Write_Func MF_Write;

    MF_InitValue_Func MF_InitValue;

    MF_Dec_Func MF_Dec;

    MF_Inc_Func MF_Inc;

    MF_Halt_Func MF_Halt;

    MF_Getsnr_Func MF_Getsnr;

    ControlBuzzer_Func ControlBuzzer;

    ControlLED_Func ControlLED;

    GetVersionNum_Func GetVersionNum;

    SetSerNum_Func SetSerNum;

    GetSerNum_Func GetSerNum;    

    TypeB_Request_Func TypeB_Request;

    TYPEB_SFZSNR_Func TYPEB_SFZSNR;

       TypeB_TransCOS_Func TypeB_TransCOS;

    UL_Request_Func UL_Request;

    UL_HLRead_Func UL_HLRead;

    UL_HLWrite_Func UL_HLWrite;

    ISO15693_Inventory_Func ISO15693_Inventory;

    ISO15693_Read_Func ISO15693_Read;

    ISO15693_Write_Func ISO15693_Write;

       ISO15693_GetSysInfo_Func ISO15693_GetSysInfo;

       ISO15693_Lock_Func ISO15693_Lock;

       ISO15693_Select_Func ISO15693_Select;

       ISO15693_WriteAFI_Func ISO15693_WriteAFI;

       ISO15693_LockAFI_Func ISO15693_LockAFI;

       ISO15693_WriteDSFID_Func ISO15693_WriteDSFID;

       ISO15693_LockDSFID_Func ISO15693_LockDSFID;

       ISO15693_GetMulSecurity_Func ISO15693_GetMulSecurity;

private:

    QLibrary *functionLib;

    int DeviceAddress;

};

#endif

reader.cpp

#include "reader.h"

#include<QMessageBox>

 

Reader::Reader(QWidget *parent)

{

       DeviceAddress = 0;

       functionLib = new QLibrary("function.dll");

       if (!LoadDll())

       {

              QMessageBox::critical(parent,"Error",QString::fromLocal8Bit("???function.dll???"));

       }

}

Reader::~Reader()

{

       CloseDll();

}

 

bool Reader::LoadDll()

{

       if ( !functionLib->load() )

       {

              qDebug()<<"Failed to load function.dll";

              return false;

       }    

       qDebug()<<"Succeed to load function.dll";

       MF_Read        = (MF_Read_Func)functionLib->resolve("MF_Read");

       MF_Write       = (MF_Write_Func)functionLib->resolve("MF_Write");

       MF_InitValue   = (MF_InitValue_Func)functionLib->resolve("MF_InitValue");

       MF_Dec         = (MF_Dec_Func)functionLib->resolve("MF_Dec");

       MF_Inc         = (MF_Inc_Func)functionLib->resolve("MF_Inc");

       MF_Halt        = (MF_Halt_Func)functionLib->resolve("MF_Halt");

    MF_Getsnr      = (MF_Getsnr_Func)functionLib->resolve("MF_Getsnr");

       ControlLED           = (ControlLED_Func)functionLib->resolve("ControlLED");

    ControlBuzzer        = (ControlBuzzer_Func)functionLib->resolve("ControlBuzzer");

       GetVersionNum        = (GetVersionNum_Func)functionLib->resolve("GetVersionNum");

    SetSerNum            = (SetSerNum_Func)functionLib->resolve("SetSerNum");

       GetSerNum            = (GetSerNum_Func)functionLib->resolve("GetSerNum");

       TypeB_Request        = (TypeB_Request_Func)functionLib->resolve("TypeB_Request");

    TYPEB_SFZSNR         = (TYPEB_SFZSNR_Func)functionLib->resolve("TYPEB_SFZSNR");

       TypeB_TransCOS          = (TypeB_TransCOS_Func)functionLib->resolve("TypeB_TransCOS");

    ISO15693_Inventory            = (ISO15693_Inventory_Func)functionLib->resolve("ISO15693_Inventory");

    ISO15693_Read                   = (ISO15693_Read_Func)functionLib->resolve("ISO15693_Read");

       ISO15693_Write                  = (ISO15693_Write_Func)functionLib->resolve("ISO15693_Write");

       ISO15693_GetSysInfo   = (ISO15693_GetSysInfo_Func)functionLib->resolve("ISO15693_GetSysInfo");

       ISO15693_Lock                   = (ISO15693_Lock_Func)functionLib->resolve("ISO15693_Lock");

       ISO15693_Select                 = (ISO15693_Select_Func)functionLib->resolve("ISO15693_Select");

       ISO15693_WriteAFI            = (ISO15693_WriteAFI_Func)functionLib->resolve("ISO15693_WriteAFI");

       ISO15693_LockAFI             = (ISO15693_LockAFI_Func)functionLib->resolve("ISO15693_LockAFI");

       ISO15693_WriteDSFID = (ISO15693_WriteDSFID_Func)functionLib->resolve("ISO15693_WriteDSFID");

       ISO15693_LockDSFID  = (ISO15693_LockDSFID_Func)functionLib->resolve("ISO15693_LockDSFID");

ISO15693_GetMulSecurity=(ISO15693_GetMulSecurity_Func)functionLib->resolve("ISO15693_GetMulSecurity");

    UL_Request           = (UL_Request_Func)functionLib->resolve("UL_Request");

       UL_HLRead            = (UL_HLRead_Func)functionLib->resolve("UL_HLRead");

    UL_HLWrite           = (UL_HLWrite_Func)functionLib->resolve("UL_HLWrite");

    if(//14443A

              MF_Read        == NULL       ||

           MF_Write            == NULL       ||

           MF_InitValue       == NULL       ||

           MF_Dec              == NULL       ||     

           MF_Inc               == NULL       ||

           MF_Getsnr          == NULL       ||

           MF_Halt             == NULL       ||

           SetSerNum            == NULL       ||

           GetSerNum           == NULL       ||

        ControlLED           == NULL       ||

           ControlBuzzer        == NULL       ||

           GetVersionNum      == NULL       ||

           TypeB_Request      == NULL       ||

           TYPEB_SFZSNR   == NULL       ||

           TypeB_TransCOS   == NULL       ||

         ISO15693_Inventory     == NULL ||

           ISO15693_Read            == NULL||

           ISO15693_Write           == NULL ||

           ISO15693_GetSysInfo == NULL ||

              ISO15693_Lock            == NULL ||

              ISO15693_Select          == NULL ||

              ISO15693_WriteAFI     == NULL ||

              ISO15693_LockAFI      == NULL ||

              ISO15693_WriteDSFID == NULL ||

              ISO15693_LockDSFID  == NULL ||

           UL_Request                 == NULL  ||

           UL_HLRead                 == NULL  ||

           UL_HLWrite                 == NULL)

       {

              qDebug()<<"Failed to resolve function";

              return false;

       }

  qDebug()<<"Succeed to resolve function";

  return true;

}

 

bool Reader::CloseDll()

{

       if(functionLib)

       {

              functionLib->unload();

              return true;

       }

       return false;

}

                                                                                           

showsick.h

#ifndef SHOWALLSICK_H

#define SHOWALLSICK_H

#include <QDialog>

#include <QtSql>

namespace Ui {

class ShowAllSick;

}

 

class ShowAllSick : public QDialog

{

    Q_OBJECT

 

public:

    explicit ShowAllSick(QWidget *parent = 0);

    ~ShowAllSick();

    void connectMySql();

private slots:

    void on_delete_2_clicked();

    void on_update_clicked();

    void on_insert_clicked();

    void gettotalrecords();

    void showdata();

    void on_select_clicked();

    void on_first_clicked();

    void on_next_clicked();

    void on_pre_clicked();

    void on_last_clicked();

    void on_go_clicked();

private:

    Ui::ShowAllSick *ui;

    QSqlTableModel *tablemodel;

    int page;

    int records;

    int totalrecords;

    int totalpages;};

#endif // SHOWALLSICK_H

showsick.cpp

#include "showsick.h"

#include "ui_showsick.h"

#include<QMessageBox>

showsick::showsick(QWidget *parent) :

    QDialog(parent),

    ui(new Ui::showsick)

{

    ui->setupUi(this);

 

    //timer read rfid

    timer=new QTimer;

    connect(timer,SIGNAL(timeout()),this,SLOT(readcardid()));

   //rfid

    cardReader = new Reader(this);

    //mysql

    connectMySql();

}

showsick::~ showsick ()

{

    delete ui;

}

 

void showsick::on_read_clicked()

{

    if(ui->id->text()=="")

    {

    timer->start(1000);

    ui->read->setEnabled(false);

    }

    QSqlQuery query;

    query.prepare("select no,sex,intro intro,image from tbl_sick where id=?");

    query.addBindValue(ui->id->text());

    query.exec();

    if(query.next())

    {

        ui->no->setText(query.value(0).toString());

        ui->sex->setText(query.value(1).toString());

        ui->intro->setText(query.value(2).toString());

        QPixmap photo;

        photo.loadFromData(query.value(3).toByteArray());

        ui->img->setPixmap(photo.scaled(ui->img->size()));

    }}

void showsick::on_stop_clicked()

{

    timer->stop();

    ui->read->setEnabled(true);

}

//读取卡号

void showsick::readcardid()

{

    unsigned int cardid;

    unsigned char snr[7];

    unsigned char mode =00;

    int result = cardReader->UL_Request(mode, snr);

    if(result==0)

    {

    cardid= (snr[0]<<24) |(snr[1]<<16) | (snr[2]<<8) | (snr[3]);

    //根据读出的卡号查询数据

    showdata(cardid);    }}

//rfid beer

void showsick::beer()

{

    int freq =20;

    int duration = 1;

    unsigned char buffer;

    int result = cardReader->ControlBuzzer(freq, duration, &buffer);}

//mysql

void showsick::connectMySql()

{

    QSqlDatabase db =QSqlDatabase::addDatabase("QMYSQL"); // becomes the new default connection

    db.setUserName("root");//用户名

    db.setPassword("root");//密码

    db.setHostName("172.16.170.47");

    db.setDatabaseName("book");//数据库名

    db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");//使用SSL

    db.setPort(3306);//端口

    if(db.open())

    {

          QMessageBox::information(this,"open","OK!");

    }

    else

    {

        QMessageBox::information(this,"open","False");

    }

}

//mysql

void showsick::showdata(unsigned int cardid)

{

    //根据读出的卡号查询数据

    QSqlQuery query;

    query.prepare("SELECT id,no,sex,intro,image FROM tbl_sick WHERE rfidno = ?");

    query.addBindValue(QString::number(cardid,16));

    query.exec();

    while (query.next())

     {

         if (query.isNull(0) == false)

         {

         //显示病人数据

         ui->id->setText(query.value(0).toString());//身份证

         ui->no->setText(query.value(1).toString());//姓名

         ui->intro->setText(query.value(2).toString());//病症

         ui->sex->setText(query.value(3).toString());//性别

        //显示病人头像

         QPixmap photo;

         photo.loadFromData(query.value(3).toByteArray());

         ui->img->setPixmap(photo.scaled(ui->img->size()));

          qDebug()<<"Query success";

          beer();         }

         else

         {

             qDebug()<<"Query failed";

         }     }}

                                                                                            显示全部病人信息界面:

showallsick.h

#ifndef SHOWALLSICK_H

#define SHOWALLSICK_H

#include <QDialog>

//mysql

#include <QtSql>

namespace Ui {

class ShowAllSick;}

class ShowAllSick : public QDialog

{

    Q_OBJECT

 

public:

    explicit ShowAllSick(QWidget *parent = 0);

    ~ShowAllSick();

    void connectMySql();

private slots:

    void on_delete_2_clicked();

    void on_update_clicked();

    void on_insert_clicked();

    void gettotalrecords();

    void showdata();

    void on_select_clicked();

    void on_first_clicked();

    void on_next_clicked();

    void on_pre_clicked();

    void on_last_clicked();

    void on_go_clicked();

private:

    Ui::ShowAllSick *ui;

    QSqlTableModel *tablemodel;

    int page;

    int records;

    int totalrecords;

    int totalpages;};

#endif // SHOWALLSICK_H

showallsick.cpp

#include "showallsick.h"

#include "ui_showallsick.h"

#include"sickinfo.h"

#include"updatesickinfo.h"

#include<QMessageBox>

QString globaldata;

ShowAllSick::ShowAllSick(QWidget *parent) :

    QDialog(parent),

    ui(new Ui::ShowAllSick)

{

 

    ui->setupUi(this);

    ui->tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);

    connectMySql();

    tablemodel=new QSqlTableModel(this);

    tablemodel->setTable("tbl_sick");

    tablemodel->setEditStrategy(QSqlTableModel::OnFieldChange);

    tablemodel->select();

    tablemodel->removeColumn(8);

    tablemodel->setHeaderData(0,Qt::Horizontal,QObject::tr("卡号"));

    tablemodel->setHeaderData(1,Qt::Horizontal,QObject::tr("姓名"));

    tablemodel->setHeaderData(2,Qt::Horizontal,QObject::tr("身份证号"));

    tablemodel->setHeaderData(3,Qt::Horizontal,QObject::tr("性别"));

    tablemodel->setHeaderData(4,Qt::Horizontal,QObject::tr("出生日期"));

    tablemodel->setHeaderData(5,Qt::Horizontal,QObject::tr("病症"));

    tablemodel->setHeaderData(6,Qt::Horizontal,QObject::tr("照片"));

    tablemodel->setHeaderData(7,Qt::Horizontal,QObject::tr("余额"));

    ui->tableView->setModel(tablemodel);}

ShowAllSick::~ShowAllSick()

{

    delete ui;

}

//mysql

void ShowAllSick::connectMySql()

{

    QSqlDatabase db =QSqlDatabase::addDatabase("QMYSQL"); // becomes the new default connection

    db.setUserName("root");//用户名

    db.setPassword("root");//密码

    db.setHostName("172.16.170.47");

    db.setDatabaseName("book");//数据库名

    db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");//使用SSL

    db.setPort(3306);//端口

    if(!db.open())

    {

       QMessageBox::information(this,"open","False");

    }}

void ShowAllSick::on_delete_2_clicked()

{

    QItemSelectionModel *selections = ui->tableView->selectionModel();

    QModelIndexList selected = selections->selectedIndexes();

    QSqlQuery query;

    int ok = QMessageBox::warning(this,QObject::tr("删除当前行!"),QObject::tr("确定删除当前行?"),

            QMessageBox::Yes,QMessageBox::No);

    if(ok==QMessageBox::Yes)

    {

        foreach (QModelIndex index, selected)

        {

            QString no=index.sibling(index.row(),0).data().toString();

            query.prepare("delete from tbl_sick where rfidno =?");

            query.addBindValue(no);

            query.exec();        }

        tablemodel->select();

    }}

void ShowAllSick::on_update_clicked()

{

    int curRow = ui->tableView->currentIndex().row();

    QModelIndex index = ui->tableView->currentIndex();

    globaldata=index.sibling(curRow,2).data().toString();

    UpdateSickInfo *updatesickinfo=new UpdateSickInfo;

    updatesickinfo->show();}

void ShowAllSick::on_insert_clicked()

{

   SickInfo *sickinfo=new SickInfo;

   sickinfo->show();

   sickinfo->resize(600,450);

}

void ShowAllSick::on_select_clicked(){

    QString id=ui->id->text().trimmed();

    if(id!="")    {

        tablemodel->setFilter(QString("id=%1").arg(id));

        tablemodel->select();

    }else{

        tablemodel->setTable("tbl_sick");

        tablemodel->select();

    }}

void ShowAllSick::gettotalrecords()

{

    QSqlQuery query;

    query.clear();

    query.exec("select count(*) from tbl_sick");

    query.next();

    totalrecords=query.value(0).toInt();

    records=ui->record->text().toInt();

    totalpages=(totalrecords%records)?(totalrecords/records)+1:(totalrecords/records);

    ui->totalpage->setText("totalpage:"+QString::number(totalpages));}

void ShowAllSick::showdata()

{

    QString strFilter = QString("1=1 LIMIT %1,%2;").arg(0).arg(records);

    tablemodel->setFilter(strFilter);

    tablemodel->select();

    ui->tableView->setModel(tablemodel);

}

 

void ShowAllSick::on_first_clicked()

{

    showdata();

    ui->page->setText("1");}

void ShowAllSick::on_next_clicked()

{

    page=ui->page->text().trimmed().toInt();

    records=ui->record->text().trimmed().toInt();

    if(page<totalpages)

    {

        QString strFilter = QString("1=1 LIMIT %1,%2;").arg(page*records).arg(records);

        tablemodel->setFilter(strFilter);

        tablemodel->select();

        ui->tableView->setModel(tablemodel);

        ui->page->setText(QString::number(page+1));

    }}

void ShowAllSick::on_pre_clicked()

{

    page=ui->page->text().trimmed().toInt();

    records=ui->record->text().trimmed().toInt();

    if(page>1)    {

        QString strFilter = QString("1=1 LIMIT %1,%2;").arg((page-2)*records).arg(records);

        tablemodel->setFilter(strFilter);

        tablemodel->select();

        ui->tableView->setModel(tablemodel);

        ui->page->setText(QString::number(page-1));

    }}

void ShowAllSick::on_last_clicked(){

    records=ui->record->text().trimmed().toInt();

    int lastpages=(totalrecords%records)?(totalrecords/records):(totalrecords/records)-1;

    QString strFilter=QString("1=1 LIMIT %1,%2").arg((lastpages)*records).arg(records);

    tablemodel->setFilter(strFilter);

    tablemodel->select();

    ui->tableView->setModel(tablemodel);

    ui->page->setText(QString::number(lastpages+1));}

void ShowAllSick::on_go_clicked(){

    page=ui->page->text().trimmed().toInt();

    records=ui->record->text().trimmed().toInt();

    totalpages=(totalrecords%records)?(totalrecords/records)+1:(totalrecords/records);

    if(page<=totalpages)    {

        QString strFilter=QString("1=1 LIMIT %1,%2").arg((page-1)*records).arg(records);

        tablemodel->setFilter(strFilter);

        tablemodel->select();

        ui->tableView->setModel(tablemodel);

    }else{

        QString strFilter=QString("1=1 LIMIT %1,%2;").arg(0).arg(records);

        tablemodel->setFilter(strFilter);

        tablemodel->select();

        ui->tableView->setModel(tablemodel);

        ui->page->setText("1");    }

    ui->totalpage->setText(tr("totalpage:")+QString::number(totalpages));}

                                                                                            

增加用户数据:

sickinfo.c

#ifndef SICKINFO_H

#define SICKINFO_H

#include <QDialog>

//rfid

#include"reader.h"

//mysql

#include <QtSql>

namespace Ui {

class SickInfo;}

class SickInfo : public QDialog{

    Q_OBJECT

public:

    explicit SickInfo(QWidget *parent = 0);

    ~SickInfo();

    //rfid

    void beer();

    //mysql

    void connectMySql();

private slots:

    void on_ok_clicked();

    void on_openimage_clicked();

    void on_readcard_clicked();

private:

    Ui::SickInfo *ui;

    QString fileName;

    //rfid

    Reader *cardReader;

    //mysql

    QSqlDatabase db;

};

sickinfo.cpp

#endif // SICKINFO_H

#include "sickinfo.h"

#include "ui_sickinfo.h"

#include<QMessageBox>

#include<QFileDialog>

SickInfo::SickInfo(QWidget *parent) :

    QDialog(parent),

    ui(new Ui::SickInfo){

    ui->setupUi(this);

    //rfid

    cardReader = new Reader(this);

    //mysql

    connectMySql();}

SickInfo::~SickInfo()

{

    delete ui;

}

//mysql的save

void SickInfo::on_ok_clicked()

{

    QString s="";

    s.append(ui->rfidno->text()+" ");

    s.append(ui->no->text()+" ");

    s.append(ui->id->text()+" ");

    s.append(fileName+" ");

    s.append(ui->sex->checkedButton()->text()+" ");

    s.append(ui->birthday->text()+" ");

    s.append(ui->textEdit->toPlainText());

    QMessageBox::information(this,tr("infromation"),tr("%1").arg(s));    //读取数据  

    QString rfidno=ui->rfidno->text().trimmed();

    QString no=ui->no->text().trimmed();

    QString id=ui->id->text().trimmed();

    QString sex=ui->sex->checkedButton()->text().trimmed();

    QString birthday=ui->birthday->text();

    QString intro=ui->textEdit->toPlainText();

    //读取图片数据为二进制数据

     QByteArray bytes;

     QBuffer buffer(&bytes);

     buffer.open(QIODevice::WriteOnly);

     ui->img->pixmap()->save(&buffer, "PNG");

     QByteArray data;

     QFile* file=new QFile(fileName);

     file->open(QIODevice::ReadOnly);

     data = file->readAll();

     file->close();

     QVariant var(data);

    //mysql的insert操作

    QSqlQuery query;

    bool value;

    query.prepare("insert into tbl_sick(rfidno,no,id,sex,intro,birthday,image) values(?,?,?,?,?,?,?)");

    query.addBindValue(rfidno);

    query.addBindValue(no);

    query.addBindValue(id);

    query.addBindValue(sex);

    query.addBindValue(intro);

    query.addBindValue(birthday);

    query.addBindValue(var);

    value=query.exec();

    if(value)      {

           QMessageBox::information(this,"adduser","Add user successed!");

     }

       else

     {

        QMessageBox::information(this,"adduser","Add user failed!");

     }}

void SickInfo::on_openimage_clicked()

{

    fileName = QFileDialog::getOpenFileName(this,

                                            tr("Open File"), QDir::currentPath());

        if (!fileName.isEmpty())

        {

            QMessageBox::information(this, tr("Image Viewer"),

                                         tr("path: %1.").arg(fileName));

 

            QImage image(fileName);

            if (image.isNull())

            {

                QMessageBox::information(this, tr("Image Viewer"),

                                             tr("Cannot load %1.").arg(fileName));

                return;

            }

            //ui->img->setPixmap(QPixmap::fromImage(image));

            ui->img->setPixmap(QPixmap(fileName).scaled(ui->img->size()));        }}

//rfid

void SickInfo::on_readcard_clicked()

{

    unsigned int cardid;

    unsigned char snr[7];

    unsigned char mode =00;

    int result = cardReader->UL_Request(mode, snr);

    if(result==0)

    {

    cardid= (snr[0]<<24) |(snr[1]<<16) | (snr[2]<<8) | (snr[3]);

    ui->rfidno->setText(QString::number(cardid,16));

    beer();    }}

//rfid

void SickInfo::beer()

{

    int freq =20;

    int duration = 1;

    unsigned char buffer;

    int result = cardReader->ControlBuzzer(freq, duration, &buffer);

}//mysql

void SickInfo::connectMySql(){

    QSqlDatabase db =QSqlDatabase::addDatabase("QMYSQL"); // becomes the new default connection

    db.setUserName("root");//用户名

    db.setPassword("root");//密码

    db.setHostName("172.16.170.47");

    db.setDatabaseName("book");//数据库名

    db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");//使用SSL

    db.setPort(3306);//端口

    if(db.open())    {

          QMessageBox::information(this,"open","OK!");

    }

    else

    {

        QMessageBox::information(this,"open","False");

    }}                                                                                           

更新病人资料:

updatesickinfo.c

#ifndef UPDATESICKINFO_H

#define UPDATESICKINFO_H

#include <QDialog>

//rfid

#include"reader.h"

//mysql

#include <QtSql>

namespace Ui {

class UpdateSickInfo;

}

class UpdateSickInfo : public QDialog

{

    Q_OBJECT

public:

    explicit UpdateSickInfo(QWidget *parent = 0);

    ~UpdateSickInfo();

    void connectMySql();

    void beer();

private slots:

    void on_openimage_clicked();

    void on_readcard_clicked();

    void on_ok_clicked();

private:

    Ui::UpdateSickInfo *ui;

    QString fileName;    //rfid

    Reader *cardReader;

};

 

#endif // UPDATESICKINFO_H

updatesickinfo.cpp

#include "updatesickinfo.h"

#include "ui_updatesickinfo.h"

#include<QDebug>

#include<QMessageBox>

#include<QFileDialog>

extern QString globaldata;

UpdateSickInfo::UpdateSickInfo(QWidget *parent) :

    QDialog(parent),

    ui(new Ui::UpdateSickInfo)

{

    ui->setupUi(this);

    //rfid

    cardReader = new Reader(this);

    //mysql读数据

    QSqlQuery query;

    query.prepare("select * from tbl_sick where id=?");

    query.addBindValue(globaldata);

    if(query.exec())    {

        query.next();

        ui->rfidno->setText(query.value(0).toString());

        ui->no->setText(query.value(1).toString());

        ui->id->setText(query.value(2).toString());

        ui->birthday->setDateTime(query.value(4).toDateTime());

        ui->textEdit->setText(query.value(5).toString());        //显示学生头像

        QPixmap photo;

        photo.loadFromData(query.value(6).toByteArray());

        ui->img->setPixmap(photo.scaled(ui->img->size()));  }}

UpdateSickInfo::~UpdateSickInfo()

{

    delete ui;

}

 

//mysql的save

void UpdateSickInfo::on_ok_clicked()

{

    QString s="";

    s.append(ui->rfidno->text()+" ");

    s.append(ui->no->text()+" ");

    s.append(ui->id->text()+" ");

    s.append(fileName+" ");

    s.append(ui->sex->checkedButton()->text()+" ");

    s.append(ui->birthday->text()+" ");

    s.append(ui->textEdit->toPlainText());

    QMessageBox::information(this,tr("infromation"),tr("%1").arg(s));

    //读取数据

    QString rfidno=ui->rfidno->text().trimmed();

    QString no=ui->no->text().trimmed();

    QString id=ui->id->text().trimmed();

    QString sex=ui->sex->checkedButton()->text().trimmed();

    QString birthday=ui->birthday->text();

    QString intro=ui->textEdit->toPlainText();

    //读取图片数据为二进制数据

     QByteArray bytes;

     QBuffer buffer(&bytes);

     buffer.open(QIODevice::WriteOnly);

     ui->img->pixmap()->save(&buffer, "PNG");

     QByteArray data;

     QFile* file=new QFile(fileName);

     file->open(QIODevice::ReadOnly);

     data = file->readAll();

     file->close();

     QVariant var(data);

    //mysql的insert操作

    QSqlQuery query;

    bool value;

    query.prepare("update tbl_sick set rfidno=?,no=?,sex=?,birthday=?,intro=?,image=? where id=?");

    query.addBindValue(rfidno);

    query.addBindValue(no);

    query.addBindValue(sex);

    query.addBindValue(birthday);

    query.addBindValue(intro);

    query.addBindValue(var);

    query.addBindValue(id);

    value=query.exec();

    if(value)    {

        QMessageBox::information(this,"adduser","update user successed!");

    }else{

        QMessageBox::information(this,"adduser","update user failed!");

    }}

void UpdateSickInfo::on_openimage_clicked()

{

    fileName = QFileDialog::getOpenFileName(this,

                                            tr("Open File"), QDir::currentPath());

        if (!fileName.isEmpty())

        {

            QMessageBox::information(this, tr("Image Viewer"),

                                         tr("path: %1.").arg(fileName));

 

            QImage image(fileName);

            if (image.isNull())

            {

                QMessageBox::information(this, tr("Image Viewer"),

                                             tr("Cannot load %1.").arg(fileName));

                return;

            }

            //ui->img->setPixmap(QPixmap::fromImage(image));

            ui->img->setPixmap(QPixmap(fileName).scaled(ui->img->size()));        }}

//rfid

void UpdateSickInfo::on_readcard_clicked()

{

    unsigned int cardid;

    unsigned char snr[7];

    unsigned char mode =00;

    int result = cardReader->UL_Request(mode, snr);

    if(result==0)    {

    cardid= (snr[0]<<24) |(snr[1]<<16) | (snr[2]<<8) | (snr[3]);

    ui->rfidno->setText(QString::number(cardid,16));

    beer();

    }}

//rfid

void UpdateSickInfo::beer()

{

    int freq =20;

    int duration = 1;

    unsigned char buffer;

    int result = cardReader->ControlBuzzer(freq, duration, &buffer);}

//mysql

void UpdateSickInfo::connectMySql()

{

    QSqlDatabase db =QSqlDatabase::addDatabase("QMYSQL"); // becomes the new default connection

    db.setUserName("root");//用户名

    db.setPassword("root");//密码

    db.setHostName("172.16.170.47");

    db.setDatabaseName("book");//数据库名

    db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1");//使用SSL

    db.setPort(3306);//端口

    if(!db.open())    {

          QMessageBox::information(this,"open","False");    }

}

 

1)        管理者登录页面:

技术分享 

2)        系统首界面:

技术分享 

3)        增加用户资料界面:

技术分享 

4)        RFID读取用户资料界面:

技术分享 

 

5)        操作全部用户资料界面:

技术分享 

6)        用户充值扣费界面:

技术分享 

基于RFID,QT,MYSQL开发的医疗电子病历系统

标签:

热心网友 时间:2022-04-08 02:27

现在医疗市场中做电子病历系统的厂商有很多,各个厂商都有自己独特的特色,楼主可以去搜索一下。如果说是需要系统能够实现独立自主开发的功能的公司,指的是实现个性化需求吧!搜索一下,南京一丹公司的电子病历就是结构化的、工具型的,可以对医院的需求进行个性化定制........当然还有很多做电子病历做的比较好的公司,像东软、上海金仕达等等,如果楼主这边预算充足的话,很好的推荐呢!
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
找专业防水队做完还漏水怎么维权 法院会受理房屋漏水造成的纠纷吗? 巴西龟最长活多久,家养!!! 养胃的药最好的是什么啊 婴儿积食发烧不愿吃药怎么办 板门穴位在哪个部位 手机设置放偷看的方法? 凝结水回收器生产厂家? 个人账户养老金预测公式:现有5万元,缴费20年,能领多少钱? 临沂比较有名的男装品牌 双绞线的网线只连了4根芯会不会对网速有影响? - 信息提示 京东不实名认证抢不到卷吗 为什么在电脑里下载快手搜索一个主播点开他为什么没有他正在直播的直播间? 京东购物领新人券要实名认证,为啥要银行卡账号,不是货到付款吗? 京东钱包实名认证输完了手机验证码了,点了确定,还没用,去领红包还是要我实名制认证艹怎么破 出去踩水玩穿帆布鞋怎样,干的应该比一般鞋子快吧,不用捂一整天了 京东账号是以前的账号,但忘密码了,登不上,现在换新号重新注册了,那怎样再绑定新号,实名认证呢 aj3可以踩水嘛? 自己在网上刷单,刷那个注册京东账号然后去领新人优惠券的,上面实名认证到没有绑卡,然后把账号给他们, 京东怎么实名制 初二男生赤脚穿人字拖去学校的小池边踩水怎么样? 初二男生能穿一双黑色人字拖踩水 突发奇想,皮靴能当水鞋穿吗?今早看到几个妹子穿着靴子在小区公园的水池子里玩,真想问她们难道防水的吗 一个手机可以登录两个码吗 穿湿鞋子什么感觉有喜欢踩水玩的吗? 过分哦,雨天女朋友穿靴子就可以随便踩水吗 20岁以下女生进: 如果穿鞋子能游泳吗? 我记得喜欢上穿湿鞋是在同桌的诱导下。她经常拉我去踩水说好玩,鞋子经常*一天,结果发现感觉不错就喜 希芸酵素的作用和吃法 希芸酵素好不好到底怎么样能不能减肥 希芸酵素能减肥吗怎么服用能减肥 我喝了希芸酵素半个多月了加上膳食纤维怎么减肥一点也没效果? 希芸酵素黑糖轻断食减肥效果好不好 希芸酵素黑糖轻断食减肥效果好不好多少钱 希芸酵素得喝多久便秘彻底改善 希芸酵素可以治疗便秘可以减肥吗 小孩可以喝希芸酵素嘛希芸护肤品怎么样 希芸酵素好不好可以减肥吗能长期喝吗来月经能喝吗 希芸酵素减肥怎么样成分 希芸的酵素有作用么? 希芸酵素怎样辨认真假?除了可以扫码还可以怎样? - 信息提示 手机寻色app打不开,里面有好的文章怎么找回? 奔驰金融先享后选 车属于谁 听人说的享开车“先享后买,可买可退”什么意思? 奔驰星智享方案是什么 买奔驰0首付0月供0尾款是什么意思 怎样才能在视频网站上看到视频的真实地址??