public ArrayList getDoctorMedicalPermitRequest() { Patient patObj = new Patient(storeKeys.loginUserName); //connection string myConnection = connectionCLass; MySqlConnection myConn = new MySqlConnection(myConnection); //query string query = "SELECT * FROM wzb_notice WHERE Send_to = @patID AND (Type_is = 'MP' ) And (Response = '-1' )"; //list to store medicalRequest ArrayList medicalRequestList = new ArrayList(); try { MySqlCommand cmd = new MySqlCommand(query, myConn); cmd.Parameters.AddWithValue("@patID", patObj.getID()); Console.WriteLine(patObj.getID()); MySqlDataReader myReader; myConn.Open(); myReader = cmd.ExecuteReader(); while (myReader.Read()) { string docID = myReader["Received_from"].ToString(); string message = myReader["Message"].ToString(); DoctorClass docObj = new DoctorClass(docID); string doctorName = docObj.getName(); //build a string to add to to listview medicalRequestList.Add(doctorName); medicalRequestList.Add(message); } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { myConn.Close(); } return(medicalRequestList); }
public ArrayList getPatientNotices() { //objects and variables used //id is used in query Patient patObj = new Patient(storeKeys.loginUserName); string patID = patObj.getID(); //patient ID string patName = patObj.getName(); //patient Name string status = ""; //connection string myConnection = connectionCLass; MySqlConnection myConn = new MySqlConnection(myConnection); //query //in the case of a patient's notices string query = "SELECT * FROM wzb_notice WHERE (Received_from = @patID) AND (Type_is = 'RD' or Type_is = 'RP' OR Type_is = 'AD' OR Type_is = 'AP' OR Type_is = 'PD' OR Type_is = 'EP')" + "OR Type_is = 'NP' OR Type_is = 'WP'"; MySqlCommand cmd = new MySqlCommand(query, myConn); cmd.Parameters.AddWithValue("@patID", patID); MySqlDataReader myReader; //list to store notices ArrayList noticeList = new ArrayList(); try { myConn.Open(); myReader = cmd.ExecuteReader(); while (myReader.Read()) { //store values ID = myReader["ID"].ToString(); type = myReader["Type_is"].ToString(); string respond = myReader["Response"].ToString(); message = myReader["Message"].ToString(); //doctor Name DoctorClass docObj = new DoctorClass(myReader["Received_from"].ToString()); string docName = docObj.getName(); Notice notObj = new Notice(); if (respond != "") { status = notObj.checkResponse(type, respond, message); noticeList.Add(status); } //check type and convert to string //---------- // Group //---------- // Doctor //---------- // Set Appt ------------------------ A ---appointment made // Grant/Reject Refills ------------ R ---Refill granted/rejected/in process // Doctor request for medical records M --medical record request // Patient //---------- // Request Phone Call -------------- P ---Phone call request accepted //---------- // Individual //---------- // Pharmacy Recevies Refill Req ---- E ---Refill pharmacy request received // Pharmacy Receives New Presc ----- N ---Prescription pharmacy request received // When Medicine is Ready ---------- W ---Medicine is ready // Doctor DIscuss with Pharmacy ---- D //build a string to add to to listview } } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { myConn.Close(); } return(noticeList); }