下载
加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 医院挂号系统设计

医院挂号系统设计.doc

医院挂号系统设计

说叹息桥下接吻能永恒
2018-03-18 0人阅读 举报 0 0 暂无简介

简介:本文档为《医院挂号系统设计doc》,可适用于领域

医院挂号系统设计医院挂号系统一:系统功能、输入数据、与输出数据:医院挂号系统是一个可以让病人在线挂号并查询挂号纪录的系统为了简化系统的复杂度我们做了以下的假设:诊别数据是给定的不可新增诊别数据只包含两样信息:诊别编号与诊别名字。医生资料是给定的不可新增医生数据只包含两样信息:医生编号与医生名字。药物资料是给定的不可新增药物数据只包含两样信息:药物编号与药物名字。可新增病人资料病人数据只包含两样信息:病人编号与病人名字。可新增挂号数据挂号数据包含几样信息:挂号编号、病人编号、病人名字、诊别编号、诊别名字、医生编号、医生名字、药物编号、药物名字与挂号日期挂号时一旦某病人选择了某诊别与某医生则系统将根据该诊别与该医生自动配置对应的药物。有了以上的假设我们应该要有以下这些档案:诊别档:用来提供诊别信息档案的每一行应包含两个字段:诊别编号与诊别名字。subjectslog:骨科眼科SARS专科医生檔:用来提供医生信息档案的每一行应包含两个字段:医生编号与医生名字。doctorslog:林庄杰许家荣萧博文林芳伶陈明江卢瑞鹏药物檔:用来提供药物信息档案的每一行应包含两个字段:药物编号与药物名字。medicineslog:铁牛运功散十八铜人行气散福禄寿健儿宝爱之味麦仔茶统一埔里矿泉水黑松沙士东北三宝人参,貂皮,乌拉草天山雪莲含笑半步癫比对檔:用来提供比对信息所谓的比对信息就是哪科诊别配上哪位医生则开哪种药物档案的每一行应包含四个字段:比对编号、诊别编号、医生编号与药物编号。matcheslog:病人檔:用来提供病人信息档案的每一行应包含两个字段:病人编号与病人名字。patientslog:吴柏宏黄俊育石凌霖挂号檔:用来提供挂号信息档案的每一行应包含几个字段:挂号编号、病人编号、病人名字、诊别编号、诊别名字、医生编号、医生名字、药物编号、药物名字与挂号日期。reportslog:吴柏宏骨科许家荣十八铜人行气散黄俊育眼科林芳伶东北三宝人参,貂皮,乌拉草石凌霖SARS专科卢瑞鹏福禄寿健儿宝二:应用层面说明:医院挂号系统不仅可用在医院挂号上也可用在其它具比对性质的系统上。三:数据结构说明:为了处理这些复杂的数据我们定义了六种数据结构来处理数据与数据之间复杂的关系:储存诊别数据的数据结构(SUBJECT):SUBJECT字段意义字段名称诊别编号intid诊别名称charname储存医生数据("新增挂号资料成功!")printf("n")}else{printf("挂号数据已满!")printf("n")}}else如果此医生不看此诊别{printf("此医生不看此诊别!")printf("n")}}else如果无此病人编号{printf("无此病人编号!")printf("n")}breakcase:查询某病人的就诊纪录printf("请输入病人编号>")scanf("d",patid)if(searchPatient(patients,patid)>){queryByPatient(reports,patid)}else{printf("无此病人编号!")printf("n")}breakcase:查询某医生的看诊纪录showDoctors(doctors)printf("请输入医生编号>")scanf("d",docid)if(searchDoctor(doctors,docid)>){queryByDoctor(reports,docid)}else{printf("无此医生编号!")printf("n")}breakcase:结束程序fppatients=fopen(PATIENTSFILE,"w")fpreports=fopen(REPORTSFILE,"w")savePatients(patients,fppatients)saveReports(reports,fpreports)fclose(fppatients)fclose(fpreports)exit()breakdefault:无效的选项printf("无效的选项!")printf("n")break}}}子程序initSubjects()initDoctors()initMedicines()initMatches()initPatients()initReports():功能:初始化资料在此仅举initSubjects()与initDoctors()两个例子其它例子与这两个例子相似。流程图:初始化診別資料的初始化醫生資料的副程式開始副程式開始initSubjects(subjects)initDoctors(doctors)從第筆開始從第筆開始i=i=下一筆下一筆i=ii=i到第到第SUBJECTSNUM筆結給定初始值DOCTORSNUM筆結給定初始值YesYes束subjectsiid=束doctorsiid=i<=SUBJECTSNUMi<=DOCTORSNUMNoNo副程式結束副程式結束程序代码:初始化诊别资料voidinitSubjects(structSUBJECTsubjects){intifor(i=i<=SUBJECTSNUMi){subjectsiid=}}初始化医生资料voidinitDoctors(structDOCTORdoctors){intifor(i=i<=DOCTORSNUMi){doctorsiid=}}子程序loadSubjects()loadDoctors()loadMedicines()loadMatches()loadPatients()loadReports():功能:加载数据在此仅举loadSubjects()与loadDoctors()两个例子其它例子与这两个例子相似。流程图:載入診別資料的載入醫生資料的副程式開始副程式開始loadSubjects(subjects,fp)loadDoctors(doctors,fp)count=count=載入第count筆資料載入第count筆資料尚未讀到檔尾Yescount=count尚未讀到檔尾Yescount=countNoNo副程式結束副程式結束returncountreturncount程序代码:加载诊别数据,回传加载数据笔数intloadSubjects(structSUBJECTsubjects,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",subjectscountid,subjectscountname)}returncount}加载医生数据,回传加载数据笔数intloadDoctors(structDOCTORdoctors,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",doctorscountid,doctorscountname)}returncount}子程序searchSubject()searchDoctor()searchMedicine()searchPatient():功能:搜寻诊别数据搜寻医生数据搜寻药物数据与搜寻病人数据搜寻的条件为搜寻符合的编号的数据如搜寻诊别数据为搜寻符合的诊别编号的数据。流程图:搜尋診別資料的搜尋醫生資料的副程式開始副程式開始searchSubject(subjects,id)searchDoctor(doctors,id)從第一筆開始從第一筆開始index=index=下一筆下一筆index=indexindex=indexNoNoindex<=SUBJECTSNUM是否找到index<=DOCTORSNUM是否找到且Yessubjectsindexid且Yesdoctorsindexid=subjectsindexid!===iddoctorsindexid!==idNoYesNoYes副程式結束副程式結束副程式結束副程式結束returnreturnindexreturnreturnindex搜尋藥物資料的搜尋病人資料的副程式開始副程式開始searchMedicine(medicines,id)searchPatient(patients,id)從第一筆開始從第一筆開始index=index=下一筆下一筆index=indexindex=indexNoNoindex<=MEDICINESNUM是否找到index<=PATIENTSNUM是否找到且Yesmedicinesindexi且Yespatientsindexid=medicinesindexid!=d==idpatientsindexid!==idNoYesNoYes副程式結束副程式結束副程式結束副程式結束returnreturnindexreturnreturnindex程序代码:搜寻诊别数据,回传诊别数据位置intsearchSubject(structSUBJECTsubjects,intid){intindexfor(index=index<=SUBJECTSNUMsubjectsindexid!=index){if(subjectsindexid==id){returnindex}}return}搜寻医生数据,回传医生数据位置intsearchDoctor(structDOCTORdoctors,intid){intindexfor(index=index<=DOCTORSNUMdoctorsindexid!=index){if(doctorsindexid==id){returnindex}}return}搜寻药物数据,回传药物数据位置intsearchMedicine(structMEDICINEmedicines,intid){intindexfor(index=index<=MEDICINESNUMmedicinesindexid!=index){if(medicinesindexid==id){returnindex}}return}搜寻病人数据,回传病人数据位置intsearchPatient(structPATIENTpatients,intid){intindexfor(index=index<=PATIENTSNUMpatientsindexid!=index){if(patientsindexid==id){returnindex}}return}子程序searchMatch():功能:搜寻比对数据搜寻的条件与前述个不太一样为搜寻同时符合的诊别编号与医生编号的资料也就是说搜寻是否有某医生且看某诊别的资料。流程图:搜尋比對資料的副程式開始searchMatch(matches,sid,did)從第筆開始index=下一筆index=indexNoindex<=MATCHESNUMmatchesindexsubjectid==sid且Yes且matchesindexid!=matchesindexdoctorid==didNoYes副程式結束副程式結束returnreturnindex程序代码:搜寻比对数据,回传比对数据位置intsearchMatch(structMATCHmatches,intsid,intdid){intindexfor(index=index<=MATCHESNUMmatchesindexid!=index){if(matchesindexsubjectid==sidmatchesindexdoctorid==did){returnindex}}return}子程序addPatient()addReport():功能:新增病人数据与新增挂号数据。流程图:新增病人資料的新增掛號資料的副程式開始副程式開始addPatient(patients,pat)addReport(reports,rep)i=i=i=ii=iNoNoi<=PATIENTSNUMYespatientsiid==i<=REPORTSNUMYesreportsiid==YesYesrepid=ipatientsi=patNoNoreportsi=rep副程式結束副程式結束副程式結束副程式結束returnreturnreturnreturn程序代码:新增病人资料,回传成功与否intaddPatient(structPATIENTpatients,structPATIENTpat){intifor(i=i<=PATIENTSNUMi){if(patientsiid==){patientsi=patreturn}}return}新增挂号资料,回传成功与否intaddReport(structREPORTreports,structREPORTrep){intifor(i=i<=REPORTSNUMi){if(reportsiid==){repid=ireportsi=repreturn}}return}子程序queryByPatient()queryByDoctor():功能:查询某病人的就诊纪录与查询某医生的看诊纪录。流程图:查詢某病人的就診紀錄的查詢某醫生的看診紀錄的副程式開始副程式開始queryByPatient(reports,id)queryByDoctor(reports,id)count=count=i=i=i=ii=iNoNo是否第i筆資料的病是否第i筆資料的醫i<=REPORTSNUMi<=REPORTSNUM人為該病人生為該醫生且Yes且Yesreportsipatientid=reportsidoctorid==reportsiid!=reportsiid!==ididYesYes顯示第i筆資料顯示第i筆資料NoNo副程式結束副程式結束count=countcount=countreturncountreturncount程序代码:查询某病人的就诊纪录,回传显示数据笔数intqueryByPatient(structREPORTreports,intid){intcount,iprintf("病人名字t诊别名字t医生名字t药物名字t挂号日期n")count=for(i=i<=REPORTSNUMreportsiid!=i){if(reportsipatientid==id){printf("ststststsn",reportsipatientname,reportsisubjectname,reportsidoctorname,reportsimedicinename,reportsidate)count=count}}returncount}查询某医生的看诊纪录,回传显示数据笔数intqueryByDoctor(structREPORTreports,intid){intcount,iprintf("病人名字t诊别名字t医生名字t药物名字t挂号日期n")count=for(i=i<=REPORTSNUMreportsiid!=i){if(reportsidoctorid==id){printf("ststststsn",reportsipatientname,reportsisubjectname,reportsidoctorname,reportsimedicinename,reportsidate)count=count}}returncount}子程序showSubjects()showDoctors():功能:显示诊别数据与显示医生数据。流程图:顯示診別資料的顯示醫生資料的副程式開始副程式開始showSubjects(subjects)showDoctors(doctors)count=count=count=countcount=countcount<=SUBJECTSNUMcount<=DOCTORSNUM且Yes顯示第count筆資料Yes且Yes顯示第count筆資料Yessubjectscountid!=doctorscountid!=NoNo副程式結束副程式結束returncountreturncount程序代码:显示诊别数据,回传显示数据笔数intshowSubjects(structSUBJECTsubjects){intcountprintf("诊别编号t诊别名字n")for(count=count<=SUBJECTSNUMsubjectscountid!=count){printf("dtsn",subjectscountid,subjectscountname)}returncount}显示医生数据,回传显示数据笔数intshowDoctors(structDOCTORdoctors){intcountprintf("医生编号t医生名字n")for(count=count<=DOCTORSNUMdoctorscountid!=count){printf("dtsn",doctorscountid,doctorscountname)}returncount}子程序savePatients()saveReports():功能:储存病人数据与储存挂号数据。流程图:儲存病人資料的儲存掛號資料的副程式開始副程式開始savePatients(patients,fp)saveReports(reports,fp)count=count=count=countcount=countcount<=PATIENTSNUMcount<=REPORTSNUM且Yes儲存第count筆資料Yes且Yes儲存第count筆資料Yespatientscountid!=reportscountid!=NoNo副程式結束副程式結束returncountreturncount程序代码:储存病人数据,回传储存数据笔数intsavePatients(structPATIENTpatients,FILE*fp){intcountfor(count=count<=PATIENTSNUMpatientscountid!=count){fprintf(fp,"dtsn",patientscountid,patientscountname)}returncount}储存挂号数据,回传储存数据笔数intsaveReports(structREPORTreports,FILE*fp){intcountfor(count=count<=REPORTSNUMreportscountid!=count){fprintf(fp,"dtdtstdtstdtstdtstsn",reportscountid,reportscountpatientid,reportscountpatientname,reportscountsubjectid,reportscountsubjectname,reportscountdoctorid,reportscountdoctorname,reportscountmedicineid,reportscountmedicinename,reportscountdate)}returncount}五:程序执行范例:执行程序:anonymousccsun>aout一开始程序会显示主选单:*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************新增三名病人资料:*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入病人名字>吴柏宏新增病人资料成功!*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入病人名字>黄俊育新增病人资料成功!*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入病人名字>石凌霖新增病人资料成功!新增三笔挂号数据:*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入挂号日期(ex)>诊别编号诊别名字骨科眼科SARS专科请输入诊别编号>医生编号医生名字林庄杰许家荣萧博文林芳伶陈明江卢瑞鹏请输入医生编号>新增挂号资料成功!*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入挂号日期(ex)>诊别编号诊别名字骨科眼科SARS专科请输入诊别编号>医生编号医生名字林庄杰许家荣萧博文林芳伶陈明江卢瑞鹏请输入医生编号>新增挂号资料成功!*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>请输入病人编号>请输入挂号日期(ex)>诊别编号诊别名字骨科眼科SARS专科请输入诊别编号>医生编号医生名字林庄杰许家荣萧博文林芳伶陈明江卢瑞鹏请输入医生编号>新增挂号资料成功!结束:*****************主选单*********************************************************新增病人资料挂号查询某病人的就诊纪录查询某医生的看诊纪录结束****************************************请选择>patientslog:吴柏宏黄俊育石凌霖reportslog:吴柏宏骨科许家荣十八铜人行气散黄俊育眼科林芳伶东北三宝人参,貂皮,乌拉草石凌霖SARS专科卢瑞鹏福禄寿健儿宝六:完整的程序代码:#include<stdioh>#include<stringh>#defineSUBJECTSFILE"subjectslog"诊别档#defineDOCTORSFILE"doctorslog"医生档#defineMEDICINESFILE"medicineslog"药物档#defineMATCHESFILE"matcheslog"比对档#definePATIENTSFILE"patientslog"病人檔#defineREPORTSFILE"reportslog"挂号档#defineSUBJECTSNUM诊别资料最大数目#defineDOCTORSNUM医生资料最大数目#defineMEDICINESNUM药物资料最大数目#defineMATCHESNUM比对数据最大数目#definePATIENTSNUM病人资料最大数目#defineREPORTSNUM挂号资料最大数目structSUBJECT诊别资料{intid诊别编号charname诊别名字}structDOCTOR医生资料{intid医生编号charname医生名字}structMEDICINE药物资料{intid药物编号charname药物名字}structMATCH比对数据{intid比对编号intsubjectid诊别编号intdoctorid医生编号intmedicineid药物编号}structPATIENT病人资料{intid病人编号charname病人名字}structREPORT挂号数据{intid挂号编号intpatientid病人编号charpatientname病人名字intsubjectid诊别编号charsubjectname诊别名字intdoctorid医生编号chardoctorname医生名字intmedicineid药物编号charmedicinename药物名字chardate挂号日期}初始化诊别资料voidinitSubjects(structSUBJECTsubjects)初始化医生资料voidinitDoctors(structDOCTORdoctors)初始化药物资料voidinitMedicines(structMEDICINEmedicines)初始化比对数据voidinitMatches(structMATCHmatches)初始化病人资料voidinitPatients(structPATIENTpatients)初始化挂号数据voidinitReports(structREPORTreports)加载诊别数据,回传加载数据笔数intloadSubjects(structSUBJECTsubjects,FILE*fp)加载医生数据,回传加载数据笔数intloadDoctors(structDOCTORdoctors,FILE*fp)加载药物数据,回传加载数据笔数intloadMedicines(structMEDICINEmedicines,FILE*fp)加载比对数据,回传加载数据笔数intloadMatches(structMATCHmatches,FILE*fp)加载病人数据,回传加载数据笔数intloadPatients(structPATIENTpatients,FILE*fp)加载挂号数据,回传加载数据笔数intloadReports(structREPORTreports,FILE*fp)搜寻诊别数据,回传诊别数据位置intsearchSubject(structSUBJECTsubjects,intid)搜寻医生数据,回传医生数据位置intsearchDoctor(structDOCTORdoctors,intid)搜寻药物数据,回传药物数据位置intsearchMedicine(structMEDICINEmedicines,intid)搜寻比对数据,回传比对数据位置intsearchMatch(structMATCHmatches,intsid,intdid)搜寻病人数据,回传病人数据位置intsearchPatient(structPATIENTpatients,intid)新增病人资料,回传成功与否intaddPatient(structPATIENTpatients,structPATIENTpat)新增挂号资料,回传成功与否intaddReport(structREPORTreports,structREPORTrep)查询某病人的就诊纪录,回传显示数据笔数intqueryByPatient(structREPORTreports,intid)查询某医生的看诊纪录,回传显示数据笔数intqueryByDoctor(structREPORTreports,intid)显示诊别数据,回传显示数据笔数intshowSubjects(structSUBJECTsubjects)显示医生数据,回传显示数据笔数intshowDoctors(structDOCTORdoctors)储存病人数据,回传储存数据笔数intsavePatients(structPATIENTpatients,FILE*fp)储存挂号数据,回传储存数据笔数intsaveReports(structREPORTreports,FILE*fp)main(){FILE*fpsubjects诊别档FILE*fpdoctors医生档FILE*fpmedicines药物档FILE*fpmatches比对档FILE*fppatients病人檔FILE*fpreports挂号档structSUBJECTsubjectsSUBJECTSNUM,sub诊别资料structDOCTORdoctorsDOCTORSNUM,doc医生资料structMEDICINEmedicinesMEDICINESNUM,med药物资料structMATCHmatchesMATCHESNUM,mat比对数据structPATIENTpatientsPATIENTSNUM,pat病人资料structREPORTreportsREPORTSNUM,rep挂号数据intpossub诊别数据位置intposdoc医生数据位置intposmed药物数据位置intposmat比对数据位置intpospat病人数据位置intposrep挂号数据位置intchoice,result选项与选项执行结果if(!(fpsubjects=fopen(SUBJECTSFILE,"r")))开启诊别档{printf("无法开启诊别文件,程序终止!")printf("n")exit()}if(!(fpdoctors=fopen(DOCTORSFILE,"r")))开启医生档{printf("无法开启医生文件,程序终止!")printf("n")exit()}if(!(fpmedicines=fopen(MEDICINESFILE,"r")))开启药物档{printf("无法开启药物文件,程序终止!")printf("n")exit()}if(!(fpmatches=fopen(MATCHESFILE,"r")))开启比对档{printf("无法开启比对文件,程序终止!")printf("n")exit()}if(!(fppatients=fopen(PATIENTSFILE,"r")))开启病人档{fppatients=fopen(PATIENTSFILE,"w")}if(!(fpreports=fopen(REPORTSFILE,"r")))开启挂号档{fpreports=fopen(REPORTSFILE,"w")}initSubjects(subjects)初始化诊别资料initDoctors(doctors)初始化医生资料initMedicines(medicines)初始化药物资料initMatches(matches)初始化比对数据initPatients(patients)初始化病人资料initReports(reports)初始化挂号数据loadSubjects(subjects,fpsubjects)加载诊别数据loadDoctors(doctors,fpdoctors)加载医生数据loadMedicines(medicines,fpmedicines)加载药物数据loadMatches(matches,fpmatches)加载比对数据loadPatients(patients,fppatients)加载病人数据loadReports(reports,fpreports)加载挂号数据fclose(fpsubjects)fclose(fpdoctors)fclose(fpmedicines)fclose(fpmatches)fclose(fppatients)fclose(fpreports)while(){printf("*****************主选单*****************")printf("n")printf("****************************************")printf("n")printf("新增病人资料")printf("n")printf("挂号")printf("n")printf("查询某病人的就诊纪录")printf("n")printf("查询某医生的看诊纪录")printf("n")printf("结束")printf("n")printf("****************************************")printf("n")printf("请选择>")scanf("d",choice)输入选项switch(choice){case:新增病人资料printf("请输入病人编号>")scanf("d",patid)printf("请输入病人名字>")scanf("s",patname)if(searchPatient(patients,patid)>){printf("病人数据重复!")printf("n")}else{if(addPatient(patients,pat)>){printf("新增病人资料成功!")printf("n")}else{printf("病人资料已满!")printf("n")}}breakcase:挂号printf("请输入病人编号>")scanf("d",reppatientid)输入病人编号pospat=searchPatient(patients,reppatientid)if(pospat>)如果有此病人编号{printf("请输入挂号日期(ex)>")scanf("s",repdate)输入挂号日期showSubjects(subjects)printf("请输入诊别编号>")scanf("d",repsubjectid)输入诊别编号showDoctors(doctors)printf("请输入医生编号>")scanf("d",repdoctorid)输入医生编号posmat=searchMatch(matches,repsubjectid,repdoctorid)if(posmat>)如果此医生有看此诊别{找出此诊别在诊别数据中的位置possub=searchSubject(subjects,matchesposmatsubjectid)找出此医生在医生数据中的位置posdoc=searchDoctor(doctors,matchesposmatdoctorid)找出此医生看此诊别时所开的药物在药物数据中的位置posmed=searchMedicine(medicines,matchesposmatmedicineid)找出此病人名字strcpy(reppatientname,patientspospatname)找出此诊别名字strcpy(repsubjectname,subjectspossubname)找出此医生名字strcpy(repdoctorname,doctorsposdocname)找出此药物编号repmedicineid=medicinesposmedid找出此药物名字strcpy(repmedicinename,medicinesposmedname)挂号if(addReport(reports,rep)>){printf("新增挂号资料成功!")printf("n")}else{printf("挂号数据已满!")printf("n")}}else如果此医生不看此诊别{printf("此医生不看此诊别!")printf("n")}}else如果无此病人编号{printf("无此病人编号!")printf("n")}breakcase:查询某病人的就诊纪录printf("请输入病人编号>")scanf("d",patid)if(searchPatient(patients,patid)>){queryByPatient(reports,patid)}else{printf("无此病人编号!")printf("n")}breakcase:查询某医生的看诊纪录showDoctors(doctors)printf("请输入医生编号>")scanf("d",docid)if(searchDoctor(doctors,docid)>){queryByDoctor(reports,docid)}else{printf("无此医生编号!")printf("n")}breakcase:结束程序fppatients=fopen(PATIENTSFILE,"w")fpreports=fopen(REPORTSFILE,"w")savePatients(patients,fppatients)saveReports(reports,fpreports)fclose(fppatients)fclose(fpreports)exit()breakdefault:无效的选项printf("无效的选项!")printf("n")break}}}初始化诊别资料voidinitSubjects(structSUBJECTsubjects){intifor(i=i<=SUBJECTSNUMi){subjectsiid=}}初始化医生资料voidinitDoctors(structDOCTORdoctors){intifor(i=i<=DOCTORSNUMi){doctorsiid=}}初始化药物资料voidinitMedicines(structMEDICINEmedicines){intifor(i=i<=MEDICINESNUMi){medicinesiid=}}初始化比对数据voidinitMatches(structMATCHmatches){intifor(i=i<=MATCHESNUMi){matchesiid=}}初始化病人资料voidinitPatients(structPATIENTpatients){intifor(i=i<=PATIENTSNUMi){patientsiid=}}初始化挂号数据voidinitReports(structREPORTreports){intifor(i=i<=REPORTSNUMi){reportsiid=}}加载诊别数据,回传加载数据笔数intloadSubjects(structSUBJECTsubjects,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",subjectscountid,subjectscountname)}returncount}加载医生数据,回传加载数据笔数intloadDoctors(structDOCTORdoctors,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",doctorscountid,doctorscountname)}returncount}加载药物数据,回传加载数据笔数intloadMedicines(structMEDICINEmedicines,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",medicinescountid,medicinescountname)}returncount}加载比对数据,回传加载数据笔数intloadMatches(structMATCHmatches,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtdtdtdn",matchescountid,matchescountsubjectid,matchescountdoctorid,matchescountmedicineid)}returncount}加载病人数据,回传加载数据笔数intloadPatients(structPATIENTpatients,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtsn",patientscountid,patientscountname)}returncount}加载挂号数据,回传加载数据笔数intloadReports(structREPORTreports,FILE*fp){intcountcount=while(!feof(fp)){count=countfscanf(fp,"dtdtstdtstdtstdtstsn",reportscountid,reportscountpatientid,reportscountpatientname,reportscountsubjectid,reportscountsubjectname,reportscountdoctorid,reportscountdoctorname,reportscountmedicineid,reportscountmedicinename,reportscountdate)}returncount}搜寻诊别数据,回传诊别数据位置intsearchSubject(structSUBJECTsubjects,intid){intindexfor(index=index<=SUBJECTSNUMsubjectsindexid!=index){if(subjectsindexid==id){returnindex}}return}搜寻医生数据,回传医生数据位置intsearchDoctor(structDOCTORdoctors,intid){intindexfor(index=index<=DOCTORSNUMdoctorsindexid!=index){if(doctorsindexid==id){returnindex}}return}搜寻药物数据,回传药物数据位置intsearchMedicine(structMEDICINEmedicines,intid){intindexfor(index=index<=MEDICINESNUMmedicinesindexid!=index){if(medicinesindexid==id){returnindex}}return}搜寻比对数据,回传比对数据位置intsearchMatch(structMATCHmatches,intsid,intdid){intindexfor(index=index<=MATCHESNUMmatchesindexid!=index){if(matchesindexsubjectid==sidmatchesindexdoctorid==did){returnindex}}return}搜寻病人数据,回传病人数据位置intsearchPatient(structPATIENTpatients,intid){intindexfor(index=index<=PATIENTSNUMpatientsindexid!=index){if(patientsindexid==id){returnindex}}return}新增病人资料,回传成功与否intaddPatient(structPATIENTpatients,structPATIENTpat){intifor(i=i<=PATIENTSNUMi){if(patientsiid==){patientsi=patreturn}}return}新增挂号资料,回传成功与否intaddReport(structREPORTreports,structREPORTrep){intifor(i=i<=REPORTSNUMi){if(reportsiid==){repid=ireportsi=repreturn}}return}查询某病人的就诊纪录,回传显示数据笔数intqueryByPatient(structREPORTreports,intid){intcount,iprintf("病人名字t诊别名字t医生名字t药物名字t挂号日期n")count=for(i=i<=REPORTSNUMreportsiid!=i){if(reportsipatientid==id){printf("ststststsn",reportsipatientname,reportsisubjectname,reportsidoctorname,reportsimedicinename,reportsidate)count=count}}returncount}查询某医生的看诊纪录,回传显示数据笔数intqueryByDoctor(structREPORTreports,intid){intcount,iprintf("病人名字t诊别名字t医生名字t药物名字t挂号日期n")count=for(i=i<=REPORTSNUMreportsiid!=i){if(reportsidoctorid==id){printf("ststststsn",reportsipatientname,reportsisubjectname,reportsidoctorname,reportsimedicinename,reportsidate)count=count}}returncount}显示诊别数据,回传显示数据笔数intshowSubjects(structSUBJECTsubjects){intcountprintf("诊别编号t诊别名字n")for(count=count<=SUBJECTSNUMsubjectscountid!=count){printf("dtsn",subjectscountid,subjectscountname)}returncount}显示医生数据,回传显示数据笔数intshowDoctors(structDOCTORdoctors){intcountprintf("医生编号t医生名字n")for(count=count<=DOCTORSNUMdoctorscountid!=count){printf("dtsn",doctorscountid,doctorscountname)}returncount}储存病人数据,回传储存数据笔数intsavePatients(structPATIENTpatients,FILE*fp){intcountfor(count=count<=PATIENTSNUMpatientscountid!=count){fprintf(fp,"dtsn",patientscountid,patientscountname)}returncount}储存挂号数据,回传储存数据笔数intsaveReports(structREPORTreports,FILE*fp){intcountfor(count=count<=REPORTSNUMreportscountid!=count){fprintf(fp,"dtdtstdtstdtstdtstsn",reportscountid,reportscountpatientid,reportscountpatientname,reportscountsubjectid,reportscountsubjectname,reportscountdoctorid,reportscountdoctorname,reportscountmedicineid,reportscountmedicinename,reportscountdate)}returncount

用户评价(0)

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/66

医院挂号系统设计

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利