freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

基于java的醫(yī)院門診信息管理系統(tǒng)設計與實現(xiàn)-資料下載頁

2025-01-15 23:41本頁面
  

【正文】 public synchronized int addPatient(String username, String name, String password, int age, int sex,String address,String phone){ ?? } public int getDoctorInfo(String orderBy){ ?? } public int getCurrentDoctorInfo(){ ?? } public int getHistory(){ ?? } public synchronized int makeAppointment(String did,int day,int ap){ ?? } public synchronized int cancleAppointment(int qid){ ?? } public int getAppointmentInfo(){ ?? } public int getDoctorAppointmentInfo(String did){ ?? } protected void checkUser(String id) throws InvalidUserException{ conn=()。 31 strSQL=SELECT Username FROM patient WHERE Username=39。 + id + 39。 if(()) return。 try{ stmt=()。 rs=(strSQL)。 if(!()) throw new InvalidUserException()。 } catch(SQLException sqle){ ((sqle))。 } } } 下面對 Patient 類中的一些關鍵方法的功能和原理加以說明 。 (1) 患者注冊: addPatient 本方法用于患者注冊,即向數據庫中插入患者信息記錄。 ? 參數 ? username:用戶名。 ? name:姓名。 ? password:密碼。 ? age:年齡。 ? sex:性別。 ? address:聯(lián)系地址。 ? phone:聯(lián)系電話。 ? 返回值 ? 1:操作成功。 ? 0:拋出一般異常。 ? 1:拋出數據庫異常。 ? 2:賬戶已存在。 實現(xiàn)代碼如下: public synchronized int addPatient(String username, String name, String password, int age, int sex, String address, String phone){ (Name,Username,Password,Age,Sex,Address,Phone+name +,+username+,+password+,+age+,+sex+,+address+,+phone)。 int res=0。 32 conn=()。 if(conn!=null){ (conn isnot null)。 }else{ (conn is null)。 } try{ String insertSQL = INSERT INTO patient (Name,Username,Password,Age,Sex,Address,Phone)VALUES(?, ? , ? , ? , ? , ? , ?)。 PreparedStatement ps = (insertSQL)。 (1 , name)。 (2 , username)。 (3 , password)。 (4 , age)。 (5 ,sex)。 (6 , address)。 (7 , phone)。 ()。 res=1。 } catch(SQLException sqle){ ((sqle))。 res= 1。 } catch(IllegalArgumentException iae){ ((iae))。 res= 2。 } catch(Exception e){ res=0。 } finally{ } return res。 } (2) 查詢醫(yī)生信息: getDoctorInfo(String orderBy) 本方法查詢所有醫(yī)生的全部信息。 ? 參數 orderBy: 結果集排序方式。 ? 返回值 33 1:操作成功。 2:拋出一般異常。 1:拋出數據庫異常。 實現(xiàn)代碼如下: public int getDoctorInfo(String orderBy){ if(orderBy == null || ()) orderBy=。 int res=0。 conn=()。 strSQL=SELECT DID,Name,Age,Sex,Level,Section,Specialism,Phone FROM doctor ORDER BY + orderBy。 try{ stmt=()。 rs=(strSQL)。 result=rs。 res=1。 } catch(SQLException sqle){ ((sqle))。 res= 1。 } catch(Exception e){ res=0。 } finally{ return res。 } } (3) 獲取主治醫(yī)生信息: getCurrentDoctorInfo() 本方法返回當前患者的主治醫(yī)生的信息。其中“主治醫(yī)生”指已創(chuàng)建該患者病歷且治療過程未結束的醫(yī)生。 返回值如下: ? 1:操作成功。 ? 0:拋出一般異常。 ? 1:拋出數據庫異常。 (4) 查詢病歷: getHistory() 本方法返回當前患者的所有病歷。 34 返回值如下: ? 1:操作結果。 ? 0:拋出一般異常。 ? 1:拋出數據庫異常。 (5) 預約: makeAppointment(String did, int day, int ap) 本方法用于患者預 約,即向數據庫中插入一條預約記錄,其流程如下: 向 pinqueue表插入預約記錄 將 curappointment表中相應的可預約數量減 1。 ? 參數 ? did:醫(yī)生編號。 ? day:預約日 (0 為周日, 1 為周一?? )。 ? ap:上下午 (0 為上午, 1 為下午 )。 ? 返回值 ? 1:操作成功。 ? 0:拋出一般異常。 ? 1:拋出數據庫異常。 ? 2:已在相同的時間預約相同的醫(yī)生。 ? 3: day 或 ap 格式錯誤。 的實現(xiàn)代碼如下: public synchronized int makeAppointment(String did,int day,int ap){ int res=0。 conn=()。 SimpleDateFormat dateFormat=new SimpleDateFormat(yyyyMMdd HH:mm:ss)。 String[] days={SunA,SunP,MonA,MonP,TueA,TueP,WedA,WedP,ThuA,ThuP,FriA,FriP,SatA,SatP}。 int index=0,curpc=0。 try{ if(day 0 || day 6 || ap 0 || ap 1) //day必須是 0~ 6之間的整數, ap必須是 0或 1 throw new NumberFormatException()。 index=day * 2 + ap。 stmt=()。 strSQL= SELECT * FROM curappointment WHERE DID=39。 + did + 39。 rs=(strSQL)。 35 if(!() || (curpc=(days[index])) == 0) throw new NumberFormatException()。 strSQL=SELECT Doctor FROM pinqueue WHERE Doctor=39。 + did + 39。 AND Patient= + + AND Day= + day + AND AP= + ap。 rs=(strSQL)。 if(()) throw new IllegalArgumentException()。 (false)。 //事務處理開始 stmt=()。 strSQL=INSERT INTO pinqueue (Patient,Doctor,Day,AP,Date) VALUES ( + + ,39。 + did + 39。, + day + , + ap + ,39。 + (new ()) + 39。)。 //向 pinqueue表插入預約記錄 (strSQL)。 strSQL=UPDATE curappointment SET + days[index] + = + (curpc 1) + WHERE DID=39。 + did + 39。 //將 curappointment表中相應可預約數量減 1 (strSQL)。 ()。 ()。 res=1。 } catch(NumberFormatException nfe){ res= 3。 } catch(SQLException sqle){ ()。 res= 1。 ((sqle))。 } catch(IllegalArgumentException iae){ res= 2。 } catch(Exception e){ ((e))。 res=0。 } finally{ return res。 } } (6) 取消預約: cancleAppointment(int qid) 本方法用于患者取消預約信息,即從數據庫中刪除相應的預約記錄,其流程 36 如下。 刪除 pinqueue 表中記錄 將 curappointment 表中相應可預約數量加 1。 ? 參數 qid:預約編號。 ? 返回值 ? 1:操作結果。 ? 0:拋出一般異常。 ? 1:拋出數據庫異常。 實現(xiàn)代碼: public synchronized int cancleAppointment(int qid){ int res=0。 conn=()。 String[] days={SunA,SunP,MonA,MonP,TueA,TueP,WedA,WedP,ThuA,ThuP,FriA,FriP,SatA,SatP}。 int index,curpc,day,ap。 String did=。 try{ strSQL=SELECT * FROM pinqueue WHERE QID= + qid。 stmt=()。 rs=(strSQL)。 if(!()) throw new SQLException(QID does not exist.)。 day=(Day)。 ap=(AP)。 did=(Doctor)。 index=day * 2 + ap。 strSQL=SELECT * FROM curappointment WHERE DID=39。 + did + 39。 rs=(strSQL)。 ()。 curpc=(days[index])。 (false)。 stmt=()。 strSQL=DELETE FROM pinqueue WHERE QID= + qid。 (strSQL)。 strSQL=UPDATE curappointment SET + days[index] + = + (curpc + 1) + WHERE DID=39。 + did + 39。 (strSQL)。 ()。 ()。 37 res=1。 } catch(SQLExcep
點擊復制文檔內容
高考資料相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1