kl800.com省心范文网

医院管理系统


#include "iostream" using namespace std; #include "fstream" #include "string" class doctor; class time; template<class T> void createb(T *p) {p->create2();} class Person {public: Person(int bh,string xm,string ks) {bh=bh;name=xm;subject=ks;} Person(){} int bh; protected: string xingbie; string name; string subject; }; class time { public: int year; int month; int day; int week; void createtime() //创建时间函数 {cout<<"请输入现在时间:__年__月__日 星期__"<<endl; cin>>year>>month>>day>>week; } }; /*-----------------------------------定义药品类-----------------------------------------*/ class medicine { protected: time in_time; time out_time; string name; //定义时间类 //定义人类 //函数模板

string zhonglei; double price; double amount; public: int bh; static medicine *h,*pr; static int n; medicine *next; void create2() pr->next=NULL;} void create(medicine *p) //创建结点 { if(n==0) pr=h; cout<<"输入编号:"; cin>>bh; cout<<"输入名称:"; cin>>name; cout<<"输入种类:"; cin>>zhonglei; if(zhonglei=="中药"||zhonglei=="zhongyao") //判断种类是否为中药/西药 { cout<<"输入价格/斤:"; cin>>price; cout<<"输入重量(斤):"; cin>>amount; cout<<"输入入库时间:"; cin>>in_time.year>>in_time.month>>in_time.day; ofstream storefile1("medicine.txt",ios_base::app); //写入文件操作 storefile1<<bh<<" "<<name<<" "<<zhonglei<<" "<<price<<" " <<amount<<" "<<in_time.year<<" "<<in_time.month<<" "<<in_time.day<<endl; storefile1.close(); } if(zhonglei=="西药"||zhonglei=="xiyao") { cout<<"输入价格:"; cin>>price; cout<<"输入数目:"; //初始化函数 {h->next=NULL;

cin>>amount; cout<<"输入入库时间:"; cin>>in_time.year>>in_time.month>>in_time.day; cout<<"过期时间:"; cin>>out_time.year>>out_time.month>>out_time.day; cout<<endl; ofstream storefile1("medicine.txt",ios_base::app); storefile1<<bh<<" "<<name<<" "<<zhonglei<<" "<<price<<" " <<amount<<" "<<in_time.year<<" "<<in_time.month<<" "<<in_time.day<<" " <<out_time.year<<" "<<out_time.month<<" "<<out_time.day<<" "<<endl; storefile1.close(); } p->next=pr->next; pr->next=p; pr=p; pr->next=NULL; n++; cout<<"*****************添加成功*****************"<<endl; } friend void del(int aDate); //根据编号删除结点 friend void baocun1(); void show() //打印数据 { cout<<"编号:"<<bh<<endl; cout<<"名称:"<<name<<endl; cout<<"输入种类:"<<zhonglei<<endl; if(zhonglei=="中药"||zhonglei=="zhongyao") { cout<<"价格/斤:"<<price<<endl; cout<<"重量(斤):"<<amount<<endl; cout<<"入库时间:"<<in_time.year<<"/"<<in_time.month<<"/"<<in_time.day<<endl; } else { cout<<"价格:"<<price<<endl; cout<<"数目:"<<amount<<endl; cout<<"入库时间:"<<in_time.year<<"/"<<in_time.month<<"/"<<in_time.day<<endl; //保存修改数据函数 //写入文件操作

cout<<" 过期时间 :"<<out_time.year<<"/"<<out_time.month<<"/"<<out_time.day; cout<<endl; } cout<<"*********查找结束*****************"<<endl; } void showall() //打印所有数据 { medicine *q=new medicine; q=h->next; while(q) { q->show(); q=q->next; } } /*--------------------------定义友元函数-----------------*/ friend void search(int aDate); //搜索函数 friend void kouchu(string name2,double shumu); friend void gqcx(int bhy,time &nowtime); friend void create2(int m) ; template<class T> friend void createb(T *p); /*--------------------------定义友元函数------------------*/ string jude(time &nowtime) { if(nowtime.year>out_time.year) return "过期"; else if(out_time.year==nowtime.year&&nowtime.month>out_time.month) return "过期"; else if(out_time.year==nowtime.year&&out_time.month==nowtime.month&&nowtime.day>out_time. day) return "过期"; else return "未过期"; cout<<"**************判断完成****************"<<endl; } }; //判断药品是否过期 //根据药品名称扣除药品函数 //过期查询函数 //从文件导入数据函数 friend double jijia(string name2,double shumu); //根据药品名称计算价格函数

/*-----------------------------------定义药品类-----------------------------------------*/ int panduan1() { char ch; int m=0; ifstream in("medicine.txt",ios::binary); while ((ch=in.get())!=EOF) { if(ch=='\n') m++; } in.close(); return m; } int panduan2() //判断医生文件内函数 { char ch; int m=0; ifstream in("doctor.txt",ios::binary); while ((ch=in.get())!=EOF) { if(ch=='\n') m++; } in.close(); return m; } int panduan3()//判断病人文件内函数 { char ch; int m=0; ifstream in("bingren.txt",ios::binary); while ((ch=in.get())!=EOF) { if(ch=='\n') m++; } in.close(); //判断药品文件内行数

return m; } void create2(int m) //从文件导入数据函数 { string a; ifstream in("medicine.txt",ios::binary); for(int i=0;i<m;i++) { medicine *p=new medicine; if(p->n==0) { p->pr=p->h; } /*----------从文件中读取数据存入结点-------*/ in>>p->bh; getline(in, a, ' '); getline(in, p->name, ' '); getline(in, p->zhonglei, ' '); in>>p->price; getline(in, a, ' '); in>>p->amount; getline(in, a, ' '); if(p->zhonglei=="西药"||p->zhonglei=="xiyao") {in>>p->in_time.year;getline(in, a, ' '); in>>p->in_time.month;getline(in, a, ' '); in>>p->in_time.day;getline(in, a, ' '); in>>p->out_time.year;getline(in, a, ' '); in>>p->out_time.month;getline(in, a, ' '); in>>p->out_time.day; } if(p->zhonglei=="中药"||p->zhonglei=="zhongyao") { in>>p->in_time.year;getline(in, a, ' '); in>>p->in_time.month;getline(in, a, ' '); in>>p->in_time.day; } /*----------从文件中读取数据存入结点-------*/ p->next=p->pr->next;

p->pr->next=p; p->pr=p; p->pr->next=NULL; p->n++; } } void gqcx(int bhy,time &nowtime) //过期查询函数 { medicine *p=new medicine; medicine *q=new medicine; p=p->h; double a=1.1; while(p->bh!=bhy&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==bhy) //若有结点 a { cout<<p->jude(nowtime)<<endl; if(p->jude(nowtime)=="过期") del(bhy); } else throw a; cout<<"*****************查询结束**********************"<<endl; } double jijia(string name2,double shumu) //根据药品名称计算总价 { double jiage; int a=1; medicine *p=new medicine; medicine *q=new medicine; p=p->h; while(p->name!=name2&&p->next!=NULL) //查找结点 a { q=p; p=p->next; }

if(p->name==name2) //若有结点 a { jiage=shumu*p->price; } else throw a; return jiage; cout<<"*****************计价成功*******************"<<endl; } void kouchu(string name2,double shumu) //根据药品名称扣除药品 { medicine *p=new medicine; medicine *q=new medicine; p=p->h; int a=1; while(p->name!=name2&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->name==name2) //若有结点 a { p->amount=p->amount-shumu; } else throw a; } void search(int aDate)//搜索药品信息 { medicine *p=new medicine; medicine *q=new medicine; p=p->h; double a=1.1; while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a {

p->show(); } else throw a; cout<<"*******************查找结束*****************"<<endl; } void del(int aDate) //根据编号删除结点 { medicine *p=new medicine; medicine *q=new medicine; p=p->h; double a=1.1; if(p==NULL) //若是空表 return; if(p->bh==aDate) //若 a 是第一个结点 { p->h=p->next; delete p; p->n--; cout<<"***************删除成功****************"<<endl; } else { while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { q->next=p->next; delete p; p->n--; cout<<"**************删除成功************"<<endl; } else throw a; } } int medicine::n=0;

medicine *medicine::h=new medicine; medicine *medicine::pr=new medicine; class bingren: virtual public Person { protected: int bh; string sgks; string sgys; string yb; string bingqing; double fy; string *yp; string zhuangtai; double *sl; int a; public: static bingren *h,*pr; static int n; bingren *next; void create2() { h->next=NULL; pr->next=NULL; } void create(bingren *p) //创建结点 { if(n==0) pr=h; bh=n; a=0; zhuangtai="未收费"; bingqing="未看病"; sgys="未挂号"; cout<<"编号:"<<bh<<endl; cout<<"输入姓名:"; cin>>name; cout<<"输入性别:"; cin>>xingbie;

cout<<"输入所挂科室:"; cin>>sgks; cout<<"是否医保对象:"; cin>>yb; if(yb=="是"||yb=="shi") fy=2.5; else fy=5; p->next=pr->next; pr->next=p; pr=p; pr->next=NULL; n++; ofstream storefile1("bingren.txt",ios_base::app); storefile1<<bh<<" "<<name<<" "<<xingbie<<" "<<sgks<<" "<<sgys<<" "<<yb<<" "<<zhuangtai<<" "<<bingqing<<" "<<fy<<" "<<p->a; for(int i=0;i<a;i++) storefile1<<yp[i]<<" "<<sl[i]<<" "; storefile1<<endl; cout<<"****************添加成功********************"<<endl; } friend void delbr(int aDate); //根据编号删除结点 friend void searchbr(int aDate);//根据编号查找 friend void kaiyao(int aDate);//根据编号开药 friend void kanbing(int ysbh);//判断病情 friend void shoufei(int aDate);//收费 friend void create4(int m);//从文件中导入数据 friend void baocun2();//将数据保存入文件 void xuanzeys(time &nowtime); void show() //打印数据 { cout<<"编号:"<<bh<<endl; cout<<"姓名:"<<name<<endl; cout<<"性别:"<<xingbie<<endl; cout<<"所挂科室:"<<sgks<<endl; cout<<"所挂医生:"<<sgys<<endl; cout<<"是否医保:"<<yb<<endl; cout<<"病情:"<<bingqing<<endl; cout<<"药品名:";

for(int i=0;i<a;i++) cout<<yp[i]<<" "<<sl[i]<<" "; cout<<endl; cout<<"挂号费(有医保的患者 2.5 元,其余 5 元)"<<endl; cout<<"总费用(医保患者药品 8 折):"<<fy<<endl; cout<<"状态:"<<zhuangtai<<endl; cout<<"******************打印完毕********************"<<endl; } void showall() //打印所有数据 { bingren *q=new bingren; q=h->next; while(q) { q->show(); q=q->next; } cout<<"*******************打印完毕*****************"<<endl; } void yaopin()//写入药品和数量 { int i; cout<<"需要多少种药品:"; cin>>a; yp=new string[a]; sl=new double[a]; for(i=0;i<a;i++) { cout<<"药品名:"; cin>>yp[i]; cout<<"数量:"; cin>>sl[i]; } cout<<"****************记录成功*******************"<<endl; } }; void create4(int m) {

string b; ifstream in("bingren.txt",ios::binary); for(int i=0;i<m;i++) { bingren *p=new bingren; if(p->n==0) p->pr=p->h; in>>p->bh; getline(in, b, ' '); getline(in, p->name, ' '); // 逐词读取方法三 getline(in, p->xingbie, ' '); getline(in, p->sgks, ' '); getline(in, p->sgys, ' '); getline(in, p->yb, ' '); getline(in, p->zhuangtai, ' '); getline(in, p->bingqing, ' '); in>>p->fy; getline(in, b, ' '); in>>p->a; p->yp=new string[p->a]; p->sl=new double[p->a]; getline(in, b, ' '); for(int i=0;i<p->a;i++) { getline(in, p->yp[i], ' '); in>>p->sl[i]; getline(in, b, ' '); } p->next=p->pr->next; p->pr->next=p; p->pr=p; p->pr->next=NULL; p->n++; } } void kaiyao(int aDate) { int i;

double a=1.1; bingren *p=new bingren; bingren *q=new bingren; p=p->h; while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { if(p->zhuangtai=="未收费") { cout<<"该病人不能拿药,请去收费处交钱后拿药!"<<endl; return; } else { ofstream storefile1("medicine2.txt",ios_base::app); for(i=0;i<p->a;i++) { storefile1<<p->yp[i]<<" "<<p->sl[i]<<" "<<endl; kouchu(p->yp[i],p->sl[i]); cout<<"药品为:"<<endl<<p->yp[i]<<" "<<p->sl[i]<<" "<<endl; } } p->zhuangtai="已开药"; cout<<"****************开药成功*****************"<<endl; } else throw a; } void shoufei(int aDate) { int i; double a=1.1; bingren *p=new bingren; bingren *q=new bingren;

p=p->h; while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { { ofstream storefile1("feiyong.txt",ios_base::app); for(i=0;i<p->a;i++) { p->fy=p->fy+jijia(p->yp[i],p->sl[i]); if(p->yb=="shi"||p->yb=="是") p->fy=p->fy*0.8; } storefile1<<p->bh<<" "<<p->name<<" "<<"收费:"<<p->fy<<" "<<endl; } cout<<"您的总费用为:"<<p->fy<<"元\n"; p->zhuangtai="已收费"; cout<<"***********************收费成功********************"<<endl; } else throw a; } int bingren::n=0; bingren *bingren::h=new bingren; bingren *bingren::pr=new bingren; void delbr(int aDate) //根据编号删除结点 { bingren *p=new bingren; bingren *q=new bingren; p=p->h; double a=1.1; if(p==NULL) //若是空表 return; else if(p->bh==aDate) //若 a 是第一个结点 {

p->h=p->next; delete p; p->n--; cout<<"******************删除成功****************"<<endl; } else { while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { q->next=p->next; delete p; p->n--; cout<<"******************删除成功************"<<endl; } else throw a; } } void searchbr(int aDate) { bingren *p=new bingren; bingren *q=new bingren; p=p->h; double a=1.1; while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { { p->show();

} cout<<"********************查找结束****************"<<endl; } else throw a; } /*-----------------------------------定义医生类-----------------------------------------*/ class doctor:virtual public Person { protected: string x,z,c,g; int day[3]; public: int sgbrs; static doctor *h,*pr; static int n; doctor *next; void create2() { h->next=NULL; pr->next=NULL; } void create(doctor *p) //创建结点 { if(n==0) pr=h; sgbrs=0; cout<<"请输入医生编号:"; cin>>bh; cout<<"姓名:"; cin>>name; cout<<"科室:"; cin>>subject; cout<<"学历:"; cin>>x; cout<<"职位:"; cin>>z; cout<<"职称:"; cin>>c;

cout<<"工作经验:"; cin>>g; cout<<"工作时间:"; for(int i=0;i<3;i++) cin>>day[i]; p->next=pr->next; pr->next=p; pr=p; pr->next=NULL; n++; ofstream storefile1("doctor.txt",ios_base::app); storefile1<<bh<<" "<<name<<" "<<subject<<" "<<x<<" " <<z<<" "<<c<<" "<<g<<" "<<sgbrs<<" "; for(i=0;i<3;i++) storefile1<<day[i]<<" "; storefile1<<endl; storefile1.close(); cout<<"*******************添加成功********************"<<endl; } friend void deld(int aDate); //根据编号删除结点 friend void searchd(int aDate);//根据编号查找 friend void bingren::xuanzeys(time &nowtime);//病人选择医生 friend bool jude(doctor *d,int weekday);//判断医生值班 friend void create3(int m);//将文件中数据读入 friend void baocun3();//保存数据 friend void dqys(int weekday);//查看当前值班医生 friend void kanbing(int ysbh);//病人看病 void show() //打印数据 { cout<<"医生编号:"<<bh<<endl; cout<<"姓名:"<<name<<endl; cout<<"科室:"<<subject<<endl; cout<<"学历:"<<x<<endl; cout<<"职位:"<<z<<endl; cout<<"职称:"<<c<<endl; cout<<"工作经验:"<<g<<endl; cout<<"工作时间:"; for(int i=0;i<3;i++)

cout<<day[i]; cout<<endl; cout<<"所挂病人数:"<<sgbrs<<endl; } void show1() { cout<<"医生编号:"<<bh<<endl; cout<<"姓名:"<<name<<endl; } void showall() //打印所有数据 { doctor *q=new doctor; q=h->next; while(q) { show(); q=q->next; } } }; /*-----------------------------------定义医生类-----------------------------------------*/ void create3(int m) { string a; ifstream in("doctor.txt",ios::binary); for(int i=0;i<m;i++) { doctor *p=new doctor; if(p->n==0) p->pr=p->h; in>>p->bh; getline(in, a, ' '); getline(in, p->name, ' '); // 逐词读取方法三 getline(in, p->subject, ' '); getline(in, p->x, ' '); getline(in, p->z, ' '); getline(in, p->c, ' '); in>>p->g;

getline(in, a, ' '); in>>p->sgbrs; getline(in, a, ' '); for(int i=0;i<3;i++) { in>>p->day[i]; getline(in, a, ' '); } p->next=p->pr->next; p->pr->next=p; p->pr=p; p->pr->next=NULL; p->n++; } cout<<"******************添加成功********************"<<endl; } bool operator <(doctor &d1,doctor &d2) { if(d1.sgbrs<d2.sgbrs) return true; else return false; } void kanbing(int ysbh) { int bhb2; doctor *p=new doctor; doctor *q=new doctor; p=p->h; double a=1.1; int b=1; while(p->bh!=ysbh&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==ysbh) //若有结点 a

{ cout<<"输入病人编号:"; cin>>bhb2; bingren *p1=new bingren; bingren *q1=new bingren; p1=p1->h; while(p1->bh!=bhb2&&p1->next!=NULL) //查找结点 a { q1=p1; p1=p1->next; } if(p1->bh==bhb2) //若有结点 a { if(p1->sgys!=p->name) { cout<<"这个挂的不是我的号,是"<<p1->sgys<<"的号"<<endl; return; } else { cout<<"输入病情:"; cin>>p1->bingqing; p1->yaopin(); p->sgbrs--; } } else throw b; } else throw a; } void dqys(int weekday) { doctor *p=new doctor; doctor *q=new doctor; p=p->h; double a=1.1; while(p->next!=NULL) //查找结点 a {

q=p; p=p->next; for(int i=0;i<3;i++) { if(p->day[i]==weekday) //若有结点 a { p->show1(); } } } } bool jude(doctor *d,int weekday) { for(int i=0;i<3;i++) if(d->day[i]==weekday) //若有结点 a { return true; break; } if(i==3) return false; } void searchd(int aDate) { doctor *p=new doctor; doctor *q=new doctor; p=p->h; double a=1.1; while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { p->show(); } else throw a;

} void deld(int aDate) //根据编号删除结点 { doctor *p=new doctor; doctor *q=new doctor; p=p->h; double a=1.1; if(p==NULL) //若是空表 return; if(p->bh==aDate) //若 a 是第一个结点 { p->h=p->next; delete p; p->n--; cout<<"***************删除成功*****************"<<endl; } else { while(p->bh!=aDate&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==aDate) //若有结点 a { q->next=p->next; delete p; p->n--; cout<<"***************删除成功*****************"<<endl; } else throw a; } } void bingren::xuanzeys(time &nowtime) { doctor *p=new doctor; doctor *q=new doctor; doctor j[100];

doctor *xz=new doctor; int k,i=0; double a=1.1; p=p->h; if(p==NULL) //若是空表 cout<<"error"; else { while(p->next!=NULL) //查找结点 a { q=p; p=p->next; if(p->subject==sgks&&jude(p,nowtime.week)) //若有结点 a { j[i]=*p; i++; } } } xz=&j[0]; for(k=0;k<i-1;k++) if(j[k]<j[k+1]) xz=&j[k]; else xz=&j[k+1]; sgys=xz->name; p=p->h; cout<<"您所挂的医生是:"<<sgys<<endl; cout<<"请去您对应的医生处看病。"<<endl; while(p->bh!=xz->bh&&p->next!=NULL) //查找结点 a { q=p; p=p->next; } if(p->bh==xz->bh) //若有结点 a { p->sgbrs++;

} } void baocun1() { medicine *q=new medicine; ofstream storefile1("medicine.txt",ios_base::out); q=q->h->next; while(q) { if(q->zhonglei=="中药"||q->zhonglei=="zhongyao") {storefile1<<q->bh<<" "<<q->name<<" "<<q->zhonglei<<" "<<q->price<<" " <<q->amount<<" "<<q->in_time.day<<endl; q=q->next; } else if(q->zhonglei=="西药"||q->zhonglei=="xiyao") { storefile1<<q->bh<<" "<<q->name<<" "<<q->zhonglei<<" "<<q->price<<" " <<q->amount<<" "<<q->in_time.day<<" " <<q->out_time.year<<" "<<q->out_time.month<<" "<<q->out_time.day<<endl; q=q->next; } else cout<<"no"; } storefile1.close(); } void baocun2() { bingren *q=new bingren; ofstream storefile1("bingren.txt",ios_base::out); q=q->h->next ; while(q) { storefile1<<q->bh<<" "<<q->name<<" "<<q->xingbie<<" "<<q->sgks<<" "<<q->sgys<<" "<<q->yb<<" "<<q->zhuangtai <<" "<<q->bingqing<<" "<<q->fy<<" "" "<<q->a<<" "; "<<q->in_time.year<<" "<<q->in_time.month<<" "<<q->in_time.year<<" "<<q->in_time.month<<"

for(int i=0;i<q->a;i++) { storefile1<<q->yp[i]<<" "<<q->sl[i]<<" "; } storefile1<<endl; q=q->next; } storefile1.close(); } void baocun3() { ofstream storefile1("doctor.txt",ios_base::out); doctor *q=new doctor; q=q->h->next; while(q) { storefile1<<q->bh<<" "<<q->name<<" "<<q->subject<<" "<<q->x<<" " <<q->z<<" "<<q->c<<" "<<q->g<<" "<<q->sgbrs<<" "; for(int i=0;i<3;i++) storefile1<<q->day[i]<<" "; storefile1<<endl; q=q->next; } storefile1.close(); } int doctor::n=0; doctor *doctor::h=new doctor; doctor *doctor::pr=new doctor; void main() { cout<<endl<<endl<<endl; cout<< ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl; cout<<"< l; cout<<”< l; cout<<”< V1.0 >"<<endl; 医 院 门 诊 管 理 系 统 >"<<end >"<<end

cout<<"< cout<<"< l; cout<<"< 员: cout<<"< cout<<"< cout<<”< cout<<"< 红 cout<<"< l; cout<<"< 凝 cout<<"< l; cout<<"< l; >"<<endl; >"<<endl; 巢 娅 >"<<endl;

>"<<endl; >"<<end 开 发 人 >"<<endl; >"<<endl; >"<<endl; 唐 >"<<end 王雅 >"<<end >"<<end

cout<<"=================================================="<<endl<<end l; system("pause"); cout<<"系统初始化中......"<<endl; medicine *m=new medicine; createb(m); bingren *b=new bingren; createb(b); doctor *d=new doctor; createb(m); create2(panduan1()); create4(panduan3()); create3(panduan2()); cout<<"系统初始化完毕,已启动"<<endl; int cmd; time now_time; now_time.createtime(); do{ cout<<endl<<endl; cout<<"*-----------------------------医 院 门 诊 管 理 系 统

---------------------*"<<endl<<endl; cout<<"| * cout<<"| cout<<"| cout<<"| cout<<"| |"<<endl<<endl; cout<<"| cout<<"| cout<<"| cout<<"| cout<<"| cout<<"| cout<<"| cout<<"| cout<<"| 主菜单 cout<<endl<<" 请按要求安全退出,否则您的信息将无法保存!"<<endl; cin>>cmd; system ("cls"); switch(cmd) { case 1: char a; do { cout<<"*------------------------病 人 入 口------------------------------*"<<endl; cout<<"| cout<<"| cout<<"| cout<<"| a、医院就诊顺序查询 b、自动挂号入口 c、病人信息查询 d、病人满意度调查 |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; *请按数字选择* 1、病人入口 2、医生入口 3、挂号处入口 4、药房入口 5、收费处入口 6、医院信息查询 7、查看病人满意度 8、退出 |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; // 显示 * * ** * * * ** * ** * * * * ** * * * * * ****** * * * * ** * * * ** * * * ** * * ** |"<<endl; * * * * * * * * |"<<endl; * |"<<endl; |"<<endl; *

** * * *

** * * *

cout<<"******************************************************"<<endl;

cout<<"| e、退出

cout<<"*-------------------------------------------*"<<endl; cout<<endl<<"请按要求安全退出,否则您的信息将无法保存! "<<endl; cin>>a; system ("cls"); switch(a) {

case 'a': cout<<"*-------医院就诊流程----------*"<<endl<<endl<<endl<<endl; cout<<" cout<<" cout<<" cout<<" cout<<" break; case 'b': bingren *a; a=new bingren; a->create(a); a->xuanzeys(now_time); break; case 'c': int bhb2; cout<<"输入病人编号:"; cin>>bhb2; try { searchbr(bhb2); } catch(double) { cout<<"查询错误,无该病人记录..."<<endl; } break; case 'd': char m; string m2; ofstream storefile1("manyidu.txt",ios_base::app); cout<<"a.十分满意"<<endl; cout<<"b. 满意"<<endl; | *---->自助---* | | | "<<endl; "<<endl; "<<endl; "<<endl; "<<endl;

挂号--->| |--->就诊--->收费--->拿药 *--->挂号处--*

cout<<"*------------------------------------------*"<<endl<<endl<<endl;

cout<<"c. 一般"<<endl; cout<<"d. cin>>m; storefile1<<m<<" "; cout<<"是否有意见与建议?(Y or N):"<<endl; cin>>m; if(m=='Y') { cout<<"建议与意见:"; cin>>m2; storefile1<<m2<<endl; } system("cls"); cout<<"评价成功!感谢您的参与!"<<endl<<endl; break; } } while(a!='e'); break; case 2: char c; do { cout<<"*-----------------医 生 入 口----------------*"<<endl; cout<<"| cout<<"| cout<<"| a、医生信息添加 b、 看病 c、 医生信息删除 |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; 不满意"<<endl; cout<<"请输入您的评分:";

cout<<"| d、搜索医生信息/查看排队病人数 |"<<endl; cout<<"| e、查看医生排班信息 cout<<"| f、退出

cout<<"*-------------------------------------------------*"<<endl; cout<<endl<<" 请按要求安全退出,否则您的信息将无法保存!"<<endl; cin>>c; system ("cls"); switch(c) { case 'a': doctor *d;

d=new doctor; d->create(d); break; case 'c': int bhd; cout<<"输入医生编号:"; cin>>bhd; try { deld(bhd); } catch(double) { cout<<"删除错误,无该医生信息..."<<endl; } break; case 'd': cout<<"输入医生编号:"; cin>>bhd; try { searchd(bhd); } catch(double) {cout<<"无该医生信息..."<<endl; } break; case 'b': int ysbh; cout<<"输入你的医生编号:"; cin>>ysbh; try { kanbing(ysbh); } catch(double) { cout<<"无该医生信息..."<<endl;

} catch(int) { cout<<"无该病人信息..."<<endl; } break; case 'e': dqys(now_time.week); break; } }while(c!='f'); break; case 3: do { cout<<endl<<endl; cout<<"*---------挂 号 处 入 口-------------------*"<<endl; cout<<"| a、 cout<<”| b、 cout<<"| c、 cout<<"| d、 给病人挂号 搜索病人信息 删除病人信息 退出 |"<<endl; |"<<endl; |"<<endl; |"<<endl;

cout<<"*-------------------------------------------------*"<<endl; cout<<endl<<"请按要求安全退出,否则您的信息将无法保存!"<<endl; cin>>c; system ("cls"); switch(c) { case 'a': bingren *br; br=new bingren; br->create(br); br->xuanzeys(now_time); break; case 'b': int bhd; cout<<"输入病人编号:"; cin>>bhd;

try { searchbr(bhd); } catch(double) { cout<<"查询错误,无该病人信息..."<<endl; } break; case 'c': cout<<"输入病人编号:"; cin>>bhd; try { delbr(bhd); } catch(double) { cout<<"删除错误,无该病人信息..."<<endl; } break; } } while(c!='d'); break; case 4: char d; do{ cout<<endl<<endl; cout<<"*----------------药 房 入 口------------------*"<<endl; cout<<"| a、 cout<<"| b、 cout<<"| c、 cout<<"| d、 cout<<"| e、 cout<<"| f、 添加/删除药品 查看药品售出情况 开药 搜索药品 查看药品过期情况 退出 |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl; |"<<endl;

cout<<"*----------------------------------------*"<<endl; cout<<endl<<"请按要求安全退出,否则您的信息将无法保存"<<endl;

cin>>d; system ("cls"); switch(d) { case 'a': int j; do { cout<<"*------------------------------------------------*"<<endl; cout<<"| cout<<"| cout<<"| 1、添加药品 2、删除药品 3、退出 |"<<endl; |"<<endl; |"<<endl;

cout<<"*-----------------------------------------------------*"<<endl; cout<<endl<<"请按要求安全退出,否则您的信息将无法保存"<<endl; cin>>j; system ("cls"); switch(j) { case 1: medicine *a; a=new medicine; a->create(a); break; case 2: int bhs; cout<<"输入药品编号:"; cin>>bhs; try {del(bhs);} catch(double) {cout<<"删除药品错误..."<<endl;} break; } } while(j!=3); break; case 'b': {

char ch; ifstream in1("medicine2.txt",ios::binary); while ((ch=in1.get())!=EOF) { cout.put(ch); } in1.close(); break; } case 'd': int bhs; cout<<"输入药品编号:"; cin>>bhs; try { search(bhs); } catch(int) { cout<<"无可查询记录..."<<endl; } catch(double) { cout<<"无该药品记录..."<<endl; } break; case 'c': int bhb; cout<<"输入病人编号:"; cin>>bhb; try { kaiyao(bhb); } catch(double) { cout<<"该病人不存在或未开药..."<<endl; }

break; case 'e': cout<<"输入药品编号:"; cin>>bhs; try { gqcx(bhs,now_time); } catch(double) { cout<<"无该药品记录..."<<endl; } break; } } while(d!='f'); break; case 5: char f; do { cout<<"*----------------收 费 处 入 口------------------*"<<endl; cout<<"| cout<<"| cout<<"| a、病人收费 b、查看今日收费情况 c、退出 |"<<endl; |"<<endl; |"<<endl;

cout<<"*----------------------------------------------------------*"<<endl; cout<<endl<<"请按要求安全退出,否则您的信息将无法保存!"<<endl; cin>>f; system ("cls"); switch(f) { case 'a': int bhb; cout<<"输入病人编号:"; cin>>bhb; try { shoufei(bhb); }

catch(double) { cout<<"无消费记录,收费失败..."<<endl; } break; case 'b': { char ch; ifstream in1("feiyong.txt",ios::binary); while ((ch=in1.get())!=EOF) { cout.put(ch); } in1.close(); break; } } } while(f!='c'); break; case 6: cout<<"本医院设有内科、外科、口腔科、儿科、妇科、妇产科、男科等科室, 并有大量优秀医师,临床经验丰富。" <<"设备齐全,且使用信息化管理系统,大大简化了您的看病流程,希望 您能对我们的服务满意!"<<endl; system("pause"); break; case 7: { char ch; ifstream in1("manyidu.txt",ios::binary); while ((ch=in1.get())!=EOF) { cout.put(ch); } in1.close(); break; }

break; } } while(cmd!=8); baocun1(); baocun2(); baocun3(); cout<<"退出成功."<<endl; }


赞助商链接

计算机实习医院管理系统(附代码)_图文

计算机实习医院管理系统(附代码) - 计算机学院专业实习 软件项目设计与开发报告 专业:信息与计算科学 班级:信息 13 学号: 1060413014007 姓名:赵传...

医疗信息管理系统

医疗信息管理系统 - 河北大学工商学院 本科生管理信息系统作业 题目: 医疗信息管理系统 学部 学科门类 专业 小组成员 指导教师 年 管理学部 工商管理 工商管理 ...

医院管理系统设计

医院管理系统设计 - 可行性研究报告 1 引言 医院挂号就诊系统,指利用电子计算机和通信设备,为医院提供病人注册、挂号、就诊 及病例信息的收集、存储、处理的功能,它...

医院管理系统sql数据库

25 III 数据库原理与应用课程设计 第一章 1.1 系统开发背景概述 绪论 随着计算机技术的飞速发展,计算机在医院管理中应用的普及,利用计算机 实现医院管理势在必行...

xxxx医院管理系统解决方案

xxx 医院管理系统解决方案 xxxx 医院管理系统解决方案一、方案概述 xxxx 医院管理系统是 xxxx 软件有限公司开发的系列软件产品中最具代 表性的产品,总结了多家各类...

智慧医院管理系统

智慧医院管理系统方案 智慧医院管理系统一、背景在医疗体制不断完善的今天,医院的信息化程度已经大大提高,现在的大型医院 都已经用上了医院信息系统(HIS),它是医院...

医院信息管理系统

2.2 业务描述某医院信息管理系统大体可以分成六大模块, 一是病人信息模块,里面应该包含病人编号,病人姓名, 性别,身份证号,出生年月,地址,电话,病情,科室编号,...

医院信息管理系统分析

医院信息管理系统分析摘 要在信息技术飞速发展的今天, 医院信息管理系统的建设逐渐成为未来医院及 医疗发展的趋势,越来越多的医院通过建设信息管理系统来提高自身的...

医院管理系统数据库设计

医院管理系统 数据库设计 指导教师:*** 所在班级: *** 所在院系: *** 小组成员:*** 完成时间: 2014-12-8 前言医院信息化是医院应用信息技术及其产品的过程...

医院管理系统

医院管理系统_计算机软件及应用_IT/计算机_专业资料。医院管理系统报告信息工程学院计算机系 课程设计报告 课程名称__ ___C#程序设计基础 学期_ 2014 ___ 至_ 20...