Update of /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10721/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil
Modified Files:
EctConsultationFormRequestAction.java
EctConsultationFormRequestForm.java
EctConsultationFormRequestUtil.java
EctViewConsultationRequestsUtil.java EctViewRequestAction.java
Log Message:
Added "Patient Will Book" option to consultationRequest, struts classes mods and sql query mods
Index: EctViewConsultationRequestsUtil.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil/EctViewConsultationRequestsUtil.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** EctViewConsultationRequestsUtil.java 11 Sep 2003 20:53:40 -0000 1.3
--- EctViewConsultationRequestsUtil.java 9 Feb 2005 07:02:15 -0000 1.4
***************
*** 1,122 ****
// -----------------------------------------------------------------------------------------------------------------------
// *
// *
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
! // * This software is published under the GPL GNU General Public License.
! // * This program is free software; you can redistribute it and/or
! // * modify it under the terms of the GNU General Public License
! // * as published by the Free Software Foundation; either version 2
! // * of the License, or (at your option) any later version. *
! // * This program is distributed in the hope that it will be useful,
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
! // * along with this program; if not, write to the Free Software
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
! // *
// * <OSCAR TEAM>
! // * This software was written for the
! // * Department of Family Medicine
! // * McMaster Unviersity
! // * Hamilton
! // * Ontario, Canada
// *
// -----------------------------------------------------------------------------------------------------------------------
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.PrintStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import oscar.oscarDB.DBHandler;
public class EctViewConsultationRequestsUtil {
public boolean estConsultationVecByTeam(String team) {
ids = new Vector();
status = new Vector();
patient = new Vector();
provider = new Vector();
service = new Vector();
date = new Vector();
boolean verdict = true;
if(!team.equals("-1")) {
try {
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = " select cr.status, cr.referalDate, cr.requestId, demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and cr.status != 4 and sendTo ='" +team+ "' order by cr.referalDate desc";
ResultSet rs= db.GetSQL(sql);
while(rs.next()) {
date.add(rs.getString("referalDate"));
ids.add(rs.getString("requestId"));
status.add(rs.getString("status"));
patient.add(rs.getString("last_name") +", "+ rs.getString("first_name")) ;
provider.add(rs.getString("lName") +", "+ rs.getString("fName"));
service.add(rs.getString("serviceDesc"));
}
rs.close();
db.CloseConn();
} catch(SQLException e) {
System.out.println(e.getMessage());
verdict = false;
}
} else {
System.out.println("GETTIM ALL!!!!");
try {
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = " select cr.status, cr.referalDate, cr.requestId, demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and cr.status != 4 order by cr.referalDate desc";
ResultSet rs;
for(rs = db.GetSQL(sql); rs.next(); date.add(rs.getString("referalDate")))
{
ids.add(rs.getString("requestId"));
status.add(rs.getString("status"));
patient.add(rs.getString("last_name") +", "+ rs.getString("first_name")) ;
provider.add(rs.getString("lName") +", "+ rs.getString("fName")) ;
service.add(rs.getString("serviceDesc"));
}
rs.close();
db.CloseConn();
} catch(SQLException e) {
System.out.println(e.getMessage());
verdict = false;
}
}
return verdict;
}
public boolean estConsultationVecByDemographic(String demoNo) {
ids = new Vector();
status = new Vector();
patient = new Vector();
provider = new Vector();
service = new Vector();
date = new Vector();
boolean verdict = true;
try {
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = " select cr.status, cr.referalDate, cr.requestId, demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and demographicNo ='"+demoNo+"' order by cr.referalDate ";
ResultSet rs;
for(rs = db.GetSQL(sql); rs.next(); date.add(rs.getString("referalDate")))
{
ids.add(rs.getString("requestId"));
status.add(rs.getString("status"));
patient.add(rs.getString("last_name")+", "+rs.getString("first_name"));
provider.add(rs.getString("lName")+", "+rs.getString("fName"));
service.add(rs.getString("serviceDesc"));
}
rs.close();
db.CloseConn();
} catch(SQLException e) {
System.out.println(e.getMessage());
verdict = false;
}
return verdict;
}
public Vector ids;
public Vector status;
public Vector patient;
public Vector provider;
public Vector service;
public Vector date;
}
--- 1,249 ----
// -----------------------------------------------------------------------------------------------------------------------
+
// *
+
// *
+
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
!
! // * This software is published under the GPL GNU General Public License.
!
! // * This program is free software; you can redistribute it and/or
!
! // * modify it under the terms of the GNU General Public License
!
! // * as published by the Free Software Foundation; either version 2
!
! // * of the License, or (at your option) any later version. *
!
! // * This program is distributed in the hope that it will be useful,
!
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
!
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
!
! // * along with this program; if not, write to the Free Software
!
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
!
! // *
!
// * <OSCAR TEAM>
!
! // * This software was written for the
!
! // * Department of Family Medicine
!
! // * McMaster Unviersity
!
! // * Hamilton
!
! // * Ontario, Canada
!
// *
+
// -----------------------------------------------------------------------------------------------------------------------
+
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
+
+
import java.io.PrintStream;
+
import java.sql.ResultSet;
+
import java.sql.SQLException;
+
import java.util.Vector;
+
import oscar.oscarDB.DBHandler;
+
+
public class EctViewConsultationRequestsUtil {
+
+
public boolean estConsultationVecByTeam(String team) {
+
ids = new Vector();
+
status = new Vector();
+
patient = new Vector();
+
provider = new Vector();
+
service = new Vector();
+
date = new Vector();
+ this.patientWillBook = new Vector();
+
boolean verdict = true;
+
if(!team.equals("-1")) {
+
try {
+
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = " select cr.status, cr.referalDate, cr.requestId, cr.patientWillBook,demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and cr.status != 4 and sendTo ='" +team+ "' order by cr.referalDate desc";
!
ResultSet rs= db.GetSQL(sql);
+
while(rs.next()) {
+
date.add(rs.getString("referalDate"));
+
ids.add(rs.getString("requestId"));
+
status.add(rs.getString("status"));
+
patient.add(rs.getString("last_name") +", "+ rs.getString("first_name")) ;
+
provider.add(rs.getString("lName") +", "+ rs.getString("fName"));
+
service.add(rs.getString("serviceDesc"));
+ this.patientWillBook.add(rs.getString("patientWillBook"));
+
}
+
rs.close();
+
db.CloseConn();
+
} catch(SQLException e) {
+
System.out.println(e.getMessage());
+
verdict = false;
+
}
+
} else {
+
System.out.println("GETTIM ALL!!!!");
+
try {
+
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = " select cr.status, cr.referalDate, cr.requestId, cr.patientWillBook,demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and cr.status != 4 order by cr.referalDate desc";
!
ResultSet rs;
+
for(rs = db.GetSQL(sql); rs.next(); date.add(rs.getString("referalDate")))
+
{
+
ids.add(rs.getString("requestId"));
+
status.add(rs.getString("status"));
+
patient.add(rs.getString("last_name") +", "+ rs.getString("first_name")) ;
+
provider.add(rs.getString("lName") +", "+ rs.getString("fName")) ;
+
service.add(rs.getString("serviceDesc"));
+
}
+
rs.close();
+
db.CloseConn();
+
} catch(SQLException e) {
+
System.out.println(e.getMessage());
+
verdict = false;
+
}
+
}
+
return verdict;
+
}
+
+
public boolean estConsultationVecByDemographic(String demoNo) {
+
ids = new Vector();
+
status = new Vector();
+
patient = new Vector();
+
provider = new Vector();
+
service = new Vector();
+
date = new Vector();
+ this.patientWillBook = new Vector();
+
boolean verdict = true;
+
try {
+
DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = " select cr.status, cr.referalDate, cr.requestId, cr.patientWillBook, demo.last_name, demo.first_name, pro.last_name as lName, pro.first_name as fName, ser.serviceDesc from consultationRequests cr, demographic demo, provider pro, consultationServices ser where demo.demographic_no = cr.demographicNo and pro.provider_no = cr.providerNo and ser.serviceId = cr.serviceId and demographicNo ='"+demoNo+"' order by cr.referalDate ";
!
ResultSet rs;
+
for(rs = db.GetSQL(sql); rs.next(); date.add(rs.getString("referalDate")))
+
{
+
ids.add(rs.getString("requestId"));
+
status.add(rs.getString("status"));
+
patient.add(rs.getString("last_name")+", "+rs.getString("first_name"));
+
provider.add(rs.getString("lName")+", "+rs.getString("fName"));
+
service.add(rs.getString("serviceDesc"));
+ patientWillBook.add(rs.getString("patientWillBook"));
+
}
+
+
rs.close();
+
db.CloseConn();
+
} catch(SQLException e) {
+
System.out.println(e.getMessage());
+
verdict = false;
+
}
+
return verdict;
+
}
+
+
public Vector ids;
+
public Vector status;
+
public Vector patient;
+
public Vector provider;
+
public Vector service;
+
public Vector date;
+ public Vector patientWillBook;
+
}
+
Index: EctViewRequestAction.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil/EctViewRequestAction.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EctViewRequestAction.java 28 Dec 2004 17:54:47 -0000 1.5
--- EctViewRequestAction.java 9 Feb 2005 07:02:15 -0000 1.6
***************
*** 1,50 ****
// -----------------------------------------------------------------------------------------------------------------------
// *
// *
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
! // * This software is published under the GPL GNU General Public License.
! // * This program is free software; you can redistribute it and/or
! // * modify it under the terms of the GNU General Public License
! // * as published by the Free Software Foundation; either version 2
! // * of the License, or (at your option) any later version. *
! // * This program is distributed in the hope that it will be useful,
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
! // * along with this program; if not, write to the Free Software
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
! // *
// * <OSCAR TEAM>
! // * This software was written for the
! // * Department of Family Medicine
! // * McMaster University
! // * Hamilton
! // * Ontario, Canada
// *
// -----------------------------------------------------------------------------------------------------------------------
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.IOException;
import java.io.PrintStream;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import oscar.oscarEncounter.pageUtil.EctSessionBean;
! public class EctViewRequestAction extends Action {
! public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
! throws ServletException, IOException {
- EctViewRequestForm frm = (EctViewRequestForm)form;
- //EctSessionBean bean = (EctSessionBean)request.getSession().getAttribute("EctSessionBean");
- /*if(bean == null) {
- return mapping.findForward("eject");
- } else {
- bean.setConsultationRequestId(frm.getRequestId());*/
- request.setAttribute("id",frm.getRequestId());
- return mapping.findForward("success");
- //}
- }
}
--- 1,93 ----
// -----------------------------------------------------------------------------------------------------------------------
+
// *
+
// *
+
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
!
! // * This software is published under the GPL GNU General Public License.
!
! // * This program is free software; you can redistribute it and/or
!
! // * modify it under the terms of the GNU General Public License
!
! // * as published by the Free Software Foundation; either version 2
!
! // * of the License, or (at your option) any later version. *
!
! // * This program is distributed in the hope that it will be useful,
!
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
!
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
!
! // * along with this program; if not, write to the Free Software
!
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
!
! // *
!
// * <OSCAR TEAM>
!
! // * This software was written for the
!
! // * Department of Family Medicine
!
! // * McMaster University
!
! // * Hamilton
!
! // * Ontario, Canada
!
// *
+
// -----------------------------------------------------------------------------------------------------------------------
+
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.IOException;
+
import java.io.PrintStream;
+
import javax.servlet.ServletException;
+
import javax.servlet.ServletRequest;
+
import javax.servlet.http.*;
+
import org.apache.struts.action.*;
+
import oscar.oscarEncounter.pageUtil.EctSessionBean;
! public class EctViewRequestAction
! extends Action {
! public ActionForward execute(ActionMapping mapping, ActionForm form,
! HttpServletRequest request,
! HttpServletResponse response)
!
! throws ServletException, IOException {
!
! EctViewRequestForm frm = (EctViewRequestForm) form;
!
! //EctSessionBean bean = (EctSessionBean)request.getSession().getAttribute("EctSessionBean");
!
! /*if(bean == null) {
! return mapping.findForward("eject");
!
! } else {
!
! bean.setConsultationRequestId(frm.getRequestId());*/
!
! request.setAttribute("id", frm.getRequestId());
!
! return mapping.findForward("success");
!
! //}
!
! }
}
Index: EctConsultationFormRequestAction.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil/EctConsultationFormRequestAction.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** EctConsultationFormRequestAction.java 28 Dec 2004 16:42:29 -0000 1.8
--- EctConsultationFormRequestAction.java 9 Feb 2005 07:02:14 -0000 1.9
***************
*** 1,133 ****
/*
*
* Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
* This software is published under the GPL GNU General Public License.
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
*
* <OSCAR TEAM>
*
* This software was written for the
* Department of Family Medicine
* McMaster University
* Hamilton
* Ontario, Canada
*/
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.IOException;
import java.io.PrintStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import oscar.oscarDB.DBHandler;
import oscar.oscarMessenger.util.MsgStringQuote;
import oscar.oscarEncounter.pageUtil.EctSessionBean;
import oscar.OscarProperties;
import oscar.util.ParameterActionForward;
! public class EctConsultationFormRequestAction extends Action {
!
! public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
! throws ServletException, IOException {
! //EctSessionBean bean = (EctSessionBean)request.getSession().getAttribute("EctSessionBean");
! //if(bean == null)
! // return mapping.findForward("eject");
! EctConsultationFormRequestForm frm = (EctConsultationFormRequestForm)form;
! String referalDate = frm.getReferalDate();
! String serviceId = frm.getService();
! String specId = frm.getSpecialist();
! String appointmentDate = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(frm.getAppointmentYear())))).append("/").append(frm.getAppointmentMonth()).append("/").append(frm.getAppointmentDay())));
! String appointmentHour = frm.getAppointmentHour();
! String appointmentPm = frm.getAppointmentPm();
! if(appointmentPm.equals("PM")) {
! appointmentHour = Integer.toString(Integer.parseInt(appointmentHour) + 12);
! System.out.println(String.valueOf(String.valueOf((new StringBuffer("\n\n\nlook at the time")).append(appointmentHour).append("\n\n\n"))));
}
! String appointmentTime = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(appointmentHour)))).append(":").append(frm.getAppointmentMinute())));
! String reason = frm.getReasonForConsultation();
! String clinicalInfo = frm.getClinicalInformation();
! String currentMeds = frm.getCurrentMedications();
! String allergies = frm.getAllergies();
! String concurrentProblems = frm.getConcurrentProblems();
! String sendTo = frm.getSendTo();
! String submission = frm.getSubmission();
! String providerNo = frm.getProviderNo();
! String demographicNo = frm.getDemographicNo();
! String status = frm.getStatus();
! String statusText = frm.getAppointmentNotes();
! String urg = frm.getUrgency();
! String requestId = "";
! MsgStringQuote str = new MsgStringQuote();
! if(submission.equals("Submit Consultation Request") || submission.equals("Submit Consultation Request And Print Preview") || submission.equals("Submit And Fax")) {
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = "insert into consultationRequests "
! +"(referalDate,serviceId,specId,appointmentDate,appointmentTime,reason,"
! +"clinicalInfo,currentMeds,allergies,providerNo,demographicNo,status,statusText,sendTo,concurrentProblems,urgency) "
! +" values ('"+str.q(referalDate)+"','"+str.q(serviceId)+"','"+str.q(specId)+"','"+str.q(appointmentDate)+"','"+str.q(appointmentTime)+"', "
! +"'"+str.q(reason)+"','"+str.q(clinicalInfo)+"','"+str.q(currentMeds)+"','"+str.q(allergies)+"','"+str.q(providerNo)+"','"+str.q(demographicNo)
! +"','"+str.q(status)+"','"+str.q(statusText)+"','"+str.q(sendTo)+"','"+str.q(concurrentProblems)+"','"+urg+"')";
! System.out.println(" sql statement "+sql);
! db.RunSQL(sql);
!
! /* select the correct db specific command */
! String db_type = OscarProperties.getInstance().getProperty("db_type").trim();
! String dbSpecificCommand;
! if (db_type.equalsIgnoreCase("mysql")) {
! dbSpecificCommand = "SELECT LAST_INSERT_ID()";
! } else if (db_type.equalsIgnoreCase("postgresql")){
! dbSpecificCommand = "SELECT CURRVAL('consultationrequests_numeric')";
! } else
! throw new SQLException("ERROR: Database " + db_type + " unrecognized.");
!
! ResultSet rs = db.GetSQL(dbSpecificCommand);
! if(rs.next())
! requestId = Integer.toString(rs.getInt(1));
! db.CloseConn();
! }
! catch(SQLException e) {
! System.out.println(e.getMessage());
! }
! request.setAttribute("transType", "2");
! } else
! if(submission.equals("Update Consultation Request") || submission.equals("Update Consultation Request And Print Preview") || submission.equals("Update And Fax")) {
! requestId = frm.getRequestId();
! System.out.println("request id = ".concat(String.valueOf(String.valueOf(frm.getRequestId()))));
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = String.valueOf(String.valueOf((new StringBuffer("update consultationRequests set serviceId = '")).append(str.q(serviceId)).append("', ").append(" specId = '").append(str.q(specId)).append("', ").append(" appointmentDate = '").append(str.q(appointmentDate)).append("', ").append(" appointmentTime = '").append(str.q(appointmentTime)).append("', ").append(" reason = '").append(str.q(reason)).append("', ").append(" clinicalInfo = '").append(str.q(clinicalInfo)).append("', ").append(" currentMeds = '").append(str.q(currentMeds)).append("', ").append(" allergies = '").append(str.q(allergies)).append("', ").append(" status = '").append(str.q(status)).append("', ").append(" statusText = '").append(str.q(statusText)).append("', ").append(" sendTo = '").append(str.q(sendTo)).append("', ").append(" urgency = '").append(urg).append("', ").append(" concurrentProblems = '").append(str.q(concurrentProblems)).append("' ").append(" where requestId = '").append(str.q(requestId)).append("'")));
! db.RunSQL(sql);
! db.CloseConn();
! }
! catch(SQLException e) {
! System.out.println(e.getMessage());
! }
! request.setAttribute("transType", "1");
! }
! frm.setRequestId("");
! request.setAttribute("teamVar",sendTo);
! if(submission.equals("Update Consultation Request And Print Preview") || submission.equals("Submit Consultation Request And Print Preview")){
! request.setAttribute("reqId", requestId);
! return mapping.findForward("print");
! } else if (submission.equals("Update And Fax") || submission.equals("Submit And Fax")) {
! request.setAttribute("reqId", requestId);
! return mapping.findForward("fax");
! } else {
! ParameterActionForward forward = new ParameterActionForward(mapping.findForward("success"));
! forward.addParameter("de", demographicNo);
! return forward;
}
! }
}
--- 1,309 ----
/*
*
+
* Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
+
* This software is published under the GPL GNU General Public License.
+
* This program is free software; you can redistribute it and/or
+
* modify it under the terms of the GNU General Public License
+
* as published by the Free Software Foundation; either version 2
+
* of the License, or (at your option) any later version. *
+
* This program is distributed in the hope that it will be useful,
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
+
* along with this program; if not, write to the Free Software
+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+
*
+
* <OSCAR TEAM>
+
*
+
* This software was written for the
+
* Department of Family Medicine
+
* McMaster University
+
* Hamilton
+
* Ontario, Canada
+
*/
+
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.IOException;
+
import java.io.PrintStream;
+
import java.sql.ResultSet;
+
import java.sql.SQLException;
+
import javax.servlet.ServletException;
+
import javax.servlet.ServletRequest;
+
import javax.servlet.http.*;
+
import org.apache.struts.action.*;
+
import oscar.oscarDB.DBHandler;
+
import oscar.oscarMessenger.util.MsgStringQuote;
+
import oscar.oscarEncounter.pageUtil.EctSessionBean;
+
import oscar.OscarProperties;
+
import oscar.util.ParameterActionForward;
! public class EctConsultationFormRequestAction
! extends Action {
!
! public ActionForward execute(ActionMapping mapping, ActionForm form,
! HttpServletRequest request,
! HttpServletResponse response)
!
! throws ServletException, IOException {
!
! //EctSessionBean bean = (EctSessionBean)request.getSession().getAttribute("EctSessionBean");
!
! //if(bean == null)
!
! // return mapping.findForward("eject");
!
! EctConsultationFormRequestForm frm = (EctConsultationFormRequestForm) form;
!
! String referalDate = frm.getReferalDate();
!
! String serviceId = frm.getService();
!
! String specId = frm.getSpecialist();
!
! String appointmentDate = String.valueOf(String.valueOf( (new StringBuffer(
! String.valueOf(String.valueOf(frm.getAppointmentYear())))).append("/").
! append(frm.getAppointmentMonth()).append("/").append(frm.
! getAppointmentDay())));
!
! String appointmentHour = frm.getAppointmentHour();
!
! String appointmentPm = frm.getAppointmentPm();
!
! if (appointmentPm.equals("PM")) {
!
! appointmentHour = Integer.toString(Integer.parseInt(appointmentHour) + 12);
!
! System.out.println(String.valueOf(String.valueOf( (new StringBuffer(
! "\n\n\nlook at the time")).append(appointmentHour).append("\n\n\n"))));
!
! }
!
! String appointmentTime = String.valueOf(String.valueOf( (new StringBuffer(
! String.valueOf(String.valueOf(appointmentHour)))).append(":").append(
! frm.getAppointmentMinute())));
!
! String reason = frm.getReasonForConsultation();
!
! String clinicalInfo = frm.getClinicalInformation();
!
! String currentMeds = frm.getCurrentMedications();
!
! String allergies = frm.getAllergies();
!
! String concurrentProblems = frm.getConcurrentProblems();
!
! String sendTo = frm.getSendTo();
!
! String submission = frm.getSubmission();
!
! String providerNo = frm.getProviderNo();
!
! String demographicNo = frm.getDemographicNo();
!
! String status = frm.getStatus();
!
! String statusText = frm.getAppointmentNotes();
!
!
! String pwbtmp = request.getParameter("patientWillBook");
! String pwb = frm.patientWillBook;
!
! // String pwb = (pwbtmp==null||pwbtmp.equals(""))?"0":pwbtmp;
!
! String urg = frm.getUrgency();
!
! String requestId = "";
!
! MsgStringQuote str = new MsgStringQuote();
!
! if (submission.equals("Submit Consultation Request") ||
! submission.equals("Submit Consultation Request And Print Preview") ||
! submission.equals("Submit And Fax")) {
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = "insert into consultationRequests "
!
! +
! "(referalDate,serviceId,specId,appointmentDate,appointmentTime,reason,"
!
! + "clinicalInfo,currentMeds,allergies,providerNo,demographicNo,status,statusText,sendTo,concurrentProblems,urgency,patientWillBook) "
!
! + " values ('" + str.q(referalDate) + "','" + str.q(serviceId) +
! "','" + str.q(specId) + "','" + str.q(appointmentDate) + "','" +
! str.q(appointmentTime) + "', "
!
! + "'" + str.q(reason) + "','" + str.q(clinicalInfo) + "','" +
! str.q(currentMeds) + "','" + str.q(allergies) + "','" +
! str.q(providerNo) + "','" + str.q(demographicNo)
!
! + "','" + str.q(status) + "','" + str.q(statusText) + "','" +
! str.q(sendTo) + "','" + str.q(concurrentProblems) + "','" + urg +
! "'," + pwb + ")";
!
! System.out.println(" sql statement " + sql);
!
! db.RunSQL(sql);
!
! /* select the correct db specific command */
!
! String db_type = OscarProperties.getInstance().getProperty("db_type").
! trim();
!
! String dbSpecificCommand;
!
! if (db_type.equalsIgnoreCase("mysql")) {
!
! dbSpecificCommand = "SELECT LAST_INSERT_ID()";
!
! }
! else if (db_type.equalsIgnoreCase("postgresql")) {
!
! dbSpecificCommand = "SELECT CURRVAL('consultationrequests_numeric')";
!
! }
! else {
!
! throw new SQLException("ERROR: Database " + db_type +
! " unrecognized.");
! }
!
! ResultSet rs = db.GetSQL(dbSpecificCommand);
!
! if (rs.next()) {
!
! requestId = Integer.toString(rs.getInt(1));
!
! }
! db.CloseConn();
!
}
!
! catch (SQLException e) {
!
! System.out.println(e.getMessage());
!
}
!
! request.setAttribute("transType", "2");
!
! }
! else
!
! if (submission.equals("Update Consultation Request") ||
! submission.equals("Update Consultation Request And Print Preview") ||
! submission.equals("Update And Fax")) {
!
! requestId = frm.getRequestId();
!
! System.out.println("request id = ".concat(String.valueOf(String.valueOf(
! frm.getRequestId()))));
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = String.valueOf(String.valueOf( (new StringBuffer(
! "update consultationRequests set serviceId = '")).append(str.q(
! serviceId)).append("', ").append(" specId = '").append(str.q(specId)).
! append("', ").append(" appointmentDate = '").append(str.q(
! appointmentDate)).append("', ").append(" appointmentTime = '").
! append(str.q(appointmentTime)).append("', ").append(" reason = '").
! append(str.q(reason)).append("', ").append(" clinicalInfo = '").
! append(str.q(clinicalInfo)).append("', ").append(" currentMeds = '").
! append(str.q(currentMeds)).append("', ").append(" allergies = '").
! append(str.q(allergies)).append("', ").append(" status = '").append(
! str.q(status)).append("', ").append(" statusText = '").append(str.q(
! statusText)).append("', ").append(" sendTo = '").append(str.q(
! sendTo)).append("', ").append(" urgency = '").append(urg).append(
! "', ").append(" concurrentProblems = '").append(str.q(
! concurrentProblems)).append("', ").append(" patientWillBook = ").
! append(str.q(pwb)).append(" ").append(" where requestId = '"
! ).append(str.q(requestId)).
! append("'")));
! db.RunSQL(sql);
!
! db.CloseConn();
!
! }
!
! catch (SQLException e) {
!
! System.out.println(e.getMessage());
!
! }
!
! request.setAttribute("transType", "1");
!
! }
!
! frm.setRequestId("");
!
! request.setAttribute("teamVar", sendTo);
!
! if (submission.equals("Update Consultation Request And Print Preview") ||
! submission.equals("Submit Consultation Request And Print Preview")) {
!
! request.setAttribute("reqId", requestId);
!
! return mapping.findForward("print");
!
! }
! else if (submission.equals("Update And Fax") ||
! submission.equals("Submit And Fax")) {
!
! request.setAttribute("reqId", requestId);
!
! return mapping.findForward("fax");
!
! }
! else {
!
! ParameterActionForward forward = new ParameterActionForward(mapping.
! findForward("success"));
!
! forward.addParameter("de", demographicNo);
!
! return forward;
!
! }
!
! }
!
}
Index: EctConsultationFormRequestUtil.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarEncounter/oscarConsultationRequest/pageUtil/EctConsultationFormRequestUtil.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** EctConsultationFormRequestUtil.java 7 Aug 2004 18:29:35 -0000 1.5
--- EctConsultationFormRequestUtil.java 9 Feb 2005 07:02:15 -0000 1.6
***************
*** 1,277 ****
// -----------------------------------------------------------------------------------------------------------------------
// *
// *
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
! // * This software is published under the GPL GNU General Public License.
! // * This program is free software; you can redistribute it and/or
! // * modify it under the terms of the GNU General Public License
! // * as published by the Free Software Foundation; either version 2
! // * of the License, or (at your option) any later version. *
! // * This program is distributed in the hope that it will be useful,
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
! // * along with this program; if not, write to the Free Software
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
! // *
// * <OSCAR TEAM>
! // * This software was written for the
! // * Department of Family Medicine
! // * McMaster Unviersity
! // * Hamilton
! // * Ontario, Canada
// *
// -----------------------------------------------------------------------------------------------------------------------
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.PrintStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import java.util.Date;
import oscar.oscarDB.DBHandler;
import oscar.util.*;
public class EctConsultationFormRequestUtil {
! public boolean estPatient(String demo) {
! demoNo = demo;
! boolean verdict = true;
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = "select * from demographic where demographic_no = " +demoNo ;
! ResultSet rs = db.GetSQL(sql);
! if(rs.next()) {
! patientName = rs.getString("last_name") +","+ rs.getString("first_name");
! patientAddress = rs.getString("address") +"<br>"+ rs.getString("city") +","+ rs.getString("province") +","+ rs.getString("postal") ;
! patientPhone = rs.getString("phone");
! patientDOB = rs.getString("year_of_birth") +"/"+ rs.getString("month_of_birth") +"/"+ rs.getString("date_of_birth") ;
! patientHealthNum = rs.getString("hin");
! patientSex = rs.getString("sex");
! patientHealthCardType = rs.getString("hc_type");
! patientHealthCardVersionCode = rs.getString("ver");
! patientChartNo = rs.getString("chart_no");
! patientAge = UtilDateUtilities.calcAge(UtilDateUtilities.calcDate(rs.getString("year_of_birth"), rs.getString("month_of_birth"), rs.getString("date_of_birth")));
!
! }
! rs.close();
! db.CloseConn();
! } catch(SQLException e) {
! System.out.println(e.getMessage());
! verdict = false;
! }
! return verdict;
}
- public boolean estTeams() {
- boolean verdict = true;
- teamVec = new Vector();
- try {
- DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
- String sql = "select distinct team from provider order by team ";
- ResultSet rs = db.GetSQL(sql);
- while(rs.next()) {
- String teamName = rs.getString("team");
- if(!teamName.equals(""))
- teamVec.add(teamName);
- }
- /*
- do {
- if(!rs.next())
- break;
- String teamName = rs.getString("team");
- if(!teamName.equals(""))
- teamVec.add(teamName);
- } while(true);
- */ rs.close();
- db.CloseConn();
- } catch(SQLException e) {
- System.out.println(e.getMessage());
- verdict = false;
- }
- return verdict;
}
! public boolean estRequestFromId(String id) {
! boolean verdict = true;
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = "select * from consultationRequests where requestId = " +id;
! ResultSet rs = db.GetSQL(sql);
! if(rs.next()) {
! urgency = rs.getString("urgency");
! providerNo = rs.getString("providerNo");
! referalDate = rs.getString("referalDate");
! service = rs.getString("serviceId");
! specialist = rs.getString("specId");
! String appointmentTime = rs.getString("appointmentTime");
! reasonForConsultation = rs.getString("reason");
! clinicalInformation = rs.getString("clinicalInfo");
! concurrentProblems = rs.getString("concurrentProblems");
! currentMedications = rs.getString("currentMeds");
! allergies = rs.getString("allergies");
! sendTo = rs.getString("sendTo");
! status = rs.getString("status");
! appointmentNotes = rs.getString("statusText");
- if(appointmentNotes == null || appointmentNotes.equals("null"))
- appointmentNotes = new String();
- estPatient(rs.getString("demographicNo"));
- String date = rs.getString("appointmentDate");
- int fir = date.indexOf('-');
- int las = date.lastIndexOf('-');
- appointmentYear = date.substring(0, fir);
- appointmentMonth = date.substring(fir + 1, las);
- appointmentDay = date.substring(las + 1);
- fir = appointmentTime.indexOf(':');
- las = appointmentTime.lastIndexOf(':');
- if(fir > -1 && las > -1) {
- //System.out.println(String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(appointmentTime)))).append(" firs = ").append(fir).append(" las ").append(las))));
- appointmentHour = appointmentTime.substring(0, fir);
- if(fir < las)
- appointmentMinute = appointmentTime.substring(fir + 1, las);
- int h = Integer.parseInt(appointmentHour);
- if(h > 12) {
- appointmentPm = "PM";
- appointmentHour = Integer.toString(h - 12);
- } else {
- appointmentPm = "AM";
- appointmentHour = Integer.toString(h);
- }
- }
- }
- rs.close();
- db.CloseConn();
- } catch(SQLException e) {
- System.out.println(e.getMessage());
- verdict = false;
}
! return verdict;
}
- public String getSpecailistsName(String id) {
- String retval = new String();
- try {
- DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
- String sql = "select * from professionalSpecialists where specId = " +id ;
- ResultSet rs = db.GetSQL(sql);
- if(rs.next()) {
- retval = rs.getString("lName") +", "+ rs.getString("fName") +" "+ rs.getString("proLetters");
- specPhone = rs.getString("phone");
- specFax = rs.getString("fax");
- specAddr = rs.getString("address");
- if(specPhone == null || specPhone.equals("null"))
- specPhone = new String();
- if(specFax == null || specFax.equals("null"))
- specFax = new String();
- if(specAddr == null || specAddr.equals("null"))
- specAddr = new String();
- }
- rs.close();
- db.CloseConn();
- } catch(SQLException e) {
- System.out.println(e.getMessage());
- }
- return retval;
}
! public String getProviderName(String id) {
! String retval = new String();
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = "select * from provider where provider_no = " +id ;
! ResultSet rs = db.GetSQL(sql);
! if(rs.next())
! retval = rs.getString("last_name") +", "+ rs.getString("first_name");
! rs.close();
! db.CloseConn();
! } catch(SQLException e) {
! System.out.println(e.getMessage());
}
! return retval;
! }
- public String getFamilyDoctor() {
- String retval = new String();
- try {
- DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
- String sql = "select p.last_name, p.first_name from provider p, demographic d where d.provider_no = p.provider_no and d.demographic_no = " +demoNo;
- ResultSet rs = db.GetSQL(sql);
- if(rs.next())
- retval = rs.getString("last_name") +", "+ rs.getString("first_name");
- rs.close();
- db.CloseConn();
- } catch(SQLException e) {
- System.out.println(e.getMessage());
}
! return retval;
}
- public String getServiceName(String id) {
- String retval = new String();
- try {
- DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
- String sql = "select * from consultationServices where serviceId = "+id;
- ResultSet rs = db.GetSQL(sql);
- if(rs.next())
- retval = rs.getString("serviceDesc");
- rs.close();
- db.CloseConn();
- } catch(SQLException e) {
- System.out.println(e.getMessage());
- }
- return retval;
}
!
! public String getClinicName() {
! String retval = new String();
! try {
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
! String sql = "select clinic_name from clinic";
! ResultSet rs = db.GetSQL(sql);
! if(rs.next())
! retval = rs.getString("clinic_name");
! rs.close();
! db.CloseConn();
! } catch(SQLException e) {
! System.out.println(e.getMessage());
}
! return retval;
}
- public String patientName;
- public String patientAddress;
- public String patientPhone;
- public String patientDOB;
- public String patientHealthNum;
- public String patientSex;
- public String patientAge;
- public String patientHealthCardType;
- public String patientHealthCardVersionCode;
- public String patientChartNo;
- public String familyPhysician;
- public String referalDate;
- public String service;
- public String specialist;
- public String appointmentYear;
- public String appointmentMonth;
- public String appointmentDay;
- public String appointmentHour;
- public String appointmentMinute;
- public String appointmentPm;
- public String reasonForConsultation;
- public String clinicalInformation;
- public String concurrentProblems;
- public String currentMedications;
- public String allergies;
- public String sendTo;
- public String status;
- public String appointmentNotes;
- public String providerNo;
- public String urgency;
- public String specPhone;
- public String specFax;
- public String specAddr;
- public Vector teamVec;
- private String demoNo;
}
--- 1,557 ----
// -----------------------------------------------------------------------------------------------------------------------
+
// *
+
// *
+
// * Copyright (c) 2001-2002. Department of Family Medicine, McMaster University. All Rights Reserved. *
!
! // * This software is published under the GPL GNU General Public License.
!
! // * This program is free software; you can redistribute it and/or
!
! // * modify it under the terms of the GNU General Public License
!
! // * as published by the Free Software Foundation; either version 2
!
! // * of the License, or (at your option) any later version. *
!
! // * This program is distributed in the hope that it will be useful,
!
! // * but WITHOUT ANY WARRANTY; without even the implied warranty of
!
! // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!
! // * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License
!
! // * along with this program; if not, write to the Free Software
!
! // * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
!
! // *
!
// * <OSCAR TEAM>
!
! // * This software was written for the
!
! // * Department of Family Medicine
!
! // * McMaster Unviersity
!
! // * Hamilton
!
! // * Ontario, Canada
!
// *
+
// -----------------------------------------------------------------------------------------------------------------------
+
package oscar.oscarEncounter.oscarConsultationRequest.pageUtil;
import java.io.PrintStream;
+
import java.sql.ResultSet;
+
import java.sql.SQLException;
+
import java.util.Vector;
+
import java.util.Date;
+
import oscar.oscarDB.DBHandler;
+
import oscar.util.*;
public class EctConsultationFormRequestUtil {
! public boolean estPatient(String demo) {
!
! demoNo = demo;
!
! boolean verdict = true;
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = "select * from demographic where demographic_no = " + demoNo;
!
! ResultSet rs = db.GetSQL(sql);
!
! if (rs.next()) {
!
! patientName = rs.getString("last_name") + "," +
! rs.getString("first_name");
!
! patientAddress = rs.getString("address") + "<br>" + rs.getString("city") +
! "," + rs.getString("province") + "," + rs.getString("postal");
!
! patientPhone = rs.getString("phone");
!
! patientDOB = rs.getString("year_of_birth") + "/" +
! rs.getString("month_of_birth") + "/" + rs.getString("date_of_birth");
!
! patientHealthNum = rs.getString("hin");
!
! patientSex = rs.getString("sex");
!
! patientHealthCardType = rs.getString("hc_type");
!
! patientHealthCardVersionCode = rs.getString("ver");
!
! patientChartNo = rs.getString("chart_no");
!
! patientAge = UtilDateUtilities.calcAge(UtilDateUtilities.calcDate(rs.
! getString("year_of_birth"), rs.getString("month_of_birth"),
! rs.getString("date_of_birth")));
!
! }
!
! rs.close();
!
! db.CloseConn();
!
}
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ verdict = false;
}
! return verdict;
!
! }
!
! public boolean estTeams() {
!
! boolean verdict = true;
!
! teamVec = new Vector();
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = "select distinct team from provider order by team ";
!
! ResultSet rs = db.GetSQL(sql);
!
! while (rs.next()) {
!
! String teamName = rs.getString("team");
!
! if (!teamName.equals("")) {
!
! teamVec.add(teamName);
}
! }
!
! /*
! do {
!
! if(!rs.next())
!
! break;
!
! String teamName = rs.getString("team");
!
! if(!teamName.equals(""))
!
! teamVec.add(teamName);
!
! } while(true);
!
! */
! rs.close();
!
! db.CloseConn();
!
}
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ verdict = false;
}
! return verdict;
!
! }
!
! public boolean estRequestFromId(String id) {
!
! boolean verdict = true;
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = "select * from consultationRequests where requestId = " +
! id;
!
! ResultSet rs = db.GetSQL(sql);
!
! if (rs.next()) {
! pwb = rs.getString("patientWillBook");
! urgency = rs.getString("urgency");
!
! providerNo = rs.getString("providerNo");
!
! referalDate = rs.getString("referalDate");
!
! service = rs.getString("serviceId");
!
! specialist = rs.getString("specId");
!
! String appointmentTime = rs.getString("appointmentTime");
!
! reasonForConsultation = rs.getString("reason");
!
! clinicalInformation = rs.getString("clinicalInfo");
!
! concurrentProblems = rs.getString("concurrentProblems");
!
! currentMedications = rs.getString("currentMeds");
!
! allergies = rs.getString("allergies");
!
! sendTo = rs.getString("sendTo");
!
! status = rs.getString("status");
!
! appointmentNotes = rs.getString("statusText");
!
! if (appointmentNotes == null || appointmentNotes.equals("null")) {
!
! appointmentNotes = new String();
!
}
! estPatient(rs.getString("demographicNo"));
!
! String date = rs.getString("appointmentDate");
!
! int fir = date.indexOf('-');
!
! int las = date.lastIndexOf('-');
!
! appointmentYear = date.substring(0, fir);
!
! appointmentMonth = date.substring(fir + 1, las);
!
! appointmentDay = date.substring(las + 1);
!
! fir = appointmentTime.indexOf(':');
!
! las = appointmentTime.lastIndexOf(':');
!
! if (fir > -1 && las > -1) {
!
! //System.out.println(String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(appointmentTime)))).append(" firs = ").append(fir).append(" las ").append(las))));
!
! appointmentHour = appointmentTime.substring(0, fir);
!
! if (fir < las) {
!
! appointmentMinute = appointmentTime.substring(fir + 1, las);
!
! }
! int h = Integer.parseInt(appointmentHour);
!
! if (h > 12) {
!
! appointmentPm = "PM";
!
! appointmentHour = Integer.toString(h - 12);
!
! }
! else {
!
! appointmentPm = "AM";
!
! appointmentHour = Integer.toString(h);
!
! }
}
!
! }
!
! rs.close();
!
! db.CloseConn();
!
}
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ verdict = false;
}
!
! return verdict;
!
! }
!
! public String getSpecailistsName(String id) {
!
! String retval = new String();
!
! try {
!
! DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
!
! String sql = "select * from professionalSpecialists where specId = " +
! id;
!
! ResultSet rs = db.GetSQL(sql);
!
! if (rs.next()) {
!
! retval = rs.getString("lName") + ", " + rs.getString("fName") + " " +
! rs.getString("proLetters");
!
! specPhone = rs.getString("phone");
!
! specFax = rs.getString("fax");
!
! specAddr = rs.getString("address");
!
! if (specPhone == null || specPhone.equals("null")) {
!
! specPhone = new String();
!
}
! if (specFax == null || specFax.equals("null")) {
!
! specFax = new String();
!
! }
! if (specAddr == null || specAddr.equals("null")) {
!
! specAddr = new String();
!
! }
! }
!
! rs.close();
!
! db.CloseConn();
!
}
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ }
+
+ return retval;
+
+ }
+
+ public String getProviderName(String id) {
+
+ String retval = new String();
+
+ try {
+
+ DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
+
+ String sql = "select * from provider where provider_no = " + id;
+
+ ResultSet rs = db.GetSQL(sql);
+
+ if (rs.next()) {
+
+ retval = rs.getString("last_name") + ", " + rs.getString("first_name");
+
+ }
+ rs.close();
+
+ db.CloseConn();
+
+ }
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ }
+
+ return retval;
+
+ }
+
+ public String getFamilyDoctor() {
+
+ String retval = new String();
+
+ try {
+
+ DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
+
+ String sql = "select p.last_name, p.first_name from provider p, demographic d where d.provider_no = p.provider_no and d.demographic_no = " +
+ demoNo;
+
+ ResultSet rs = db.GetSQL(sql);
+
+ if (rs.next()) {
+
+ retval = rs.getString("last_name") + ", " + rs.getString("first_name");
+
+ }
+ rs.close();
+
+ db.CloseConn();
+
+ }
+ catch (SQLException e) {
+
+ System.out.println(e.getMessage());
+
+ }
+
+ return retval;
+
+ }
+
+ public String getServiceName(String id) {
+
+ String retval = new String();
+
+ try {
+
+ DBHandler db = new DBHandler(DBHandler.OSCAR_DATA);
+
+ String sql = "select * from consultationServices where serviceId = " +
+ id;
+
+ ResultSet rs = db.GetSQL(sql);
+
+ i...
[truncated message content] |