Update of /cvsroot/oscarmcmaster/oscar_mcmaster/web/demographic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22590/demographic
Modified Files:
demographicaddarecord.jsp demographiccontrol.jsp
Log Message:
add checking dob/hin duplicated record, if there is a HIN number
Index: demographiccontrol.jsp
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/demographic/demographiccontrol.jsp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** demographiccontrol.jsp 9 Dec 2004 03:08:03 -0000 1.14
--- demographiccontrol.jsp 28 Mar 2005 18:30:32 -0000 1.15
***************
*** 1,25 ****
! <%--
/*
! *
* 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
*/
--%>
--- 1,25 ----
! <%--
/*
! *
* 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
*/
--%>
***************
*** 30,38 ****
<%@ page errorPage="errorpage.jsp" import="oscar.OscarProperties" %>
<jsp:useBean id="apptMainBean" class="oscar.AppointmentMainBean" scope="session" />
! <%@ include file="../admin/dbconnection.jsp" %>
<%
OscarProperties props = OscarProperties.getInstance();
!
//operation available to the client -- dboperation
//construct SQL expression
--- 30,38 ----
<%@ page errorPage="errorpage.jsp" import="oscar.OscarProperties" %>
<jsp:useBean id="apptMainBean" class="oscar.AppointmentMainBean" scope="session" />
! <%@ include file="../admin/dbconnection.jsp" %>
<%
OscarProperties props = OscarProperties.getInstance();
!
//operation available to the client -- dboperation
//construct SQL expression
***************
*** 66,70 ****
}
}
!
String ptstatusexp="";
if(request.getParameter("ptstatus")!=null) {
--- 66,70 ----
}
}
!
String ptstatusexp="";
if(request.getParameter("ptstatus")!=null) {
***************
*** 72,97 ****
if(request.getParameter("ptstatus").equals("inactive")) ptstatusexp=" and patient_status in ("+props.getProperty("inactive_statuses", "'IN','DE','IC', 'ID', 'MO', 'FI'")+") ";
}
!
String [][] dbQueries=new String[][] {
! {"search_titlename", "select * from demographic where "+fieldname+" "+regularexp+" ? "+ptstatusexp+orderby+" "+limit},
! {"add_apptrecord", "select demographic_no,first_name,last_name,roster_status,sex,chart_no,year_of_birth,month_of_birth,date_of_birth,provider_no from demographic where "+fieldname+ " "+regularexp+" ? " +ptstatusexp+orderby + " "+limit},
! {"update_apptrecord", "select demographic_no,first_name,last_name,roster_status,sex,chart_no,year_of_birth,month_of_birth,date_of_birth,provider_no from demographic where "+fieldname+ " "+regularexp+" ? " +ptstatusexp+orderby + " "+limit},
{"search_detail", "select * from demographic where demographic_no=?"},
{"search_detail_ptbr", "select * from demographic d left outer join demographic_ptbr dptbr on dptbr.demographic_no = d.demographic_no where d.demographic_no=?"},
{"update_record", "update demographic set last_name=?,first_name =?,address=?, city=?,province=?,postal=?,phone =?,phone2=?,email=?,pin=?, year_of_birth=?,month_of_birth=?,date_of_birth=?,hin=?,ver=?, roster_status=?, patient_status=?, date_joined=?, chart_no=?,provider_no=?,sex=? , end_date=?,eff_date=?, pcn_indicator=?,hc_type=? ,hc_renew_date=?, family_doctor=? where demographic_no=?"},
{"update_record_ptbr", "update demographic_ptbr set cpf=?,rg=?,chart_address=?,marriage_certificate=?,birth_certificate=?,marital_state=?,partner_name=?,father_name=?,mother_name=?,district=?,address_no=?,complementary_address=? where demographic_no=?"},
! {"add_record", "insert into demographic (last_name, first_name, address, city, province, postal, phone, phone2, email, pin, year_of_birth, month_of_birth, date_of_birth, hin, ver, roster_status, patient_status, date_joined, chart_no, provider_no, sex, end_date, eff_date, pcn_indicator, hc_type, hc_renew_date, family_doctor) values(?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?)" },
! {"add_record_ptbr","insert into demographic_ptbr (demographic_no,cpf,rg,chart_address,marriage_certificate,birth_certificate,marital_state,partner_name,father_name,mother_name,district,address_no,complementary_address) values (?,?,?,?,?,?,?,?,?,?,?,?,?)" },
{"search_provider", "select * from provider order by last_name"},
{"search_demographicid", "select * from demographic where demographic_no=?"},
! {"search*", "select * from demographic "+ ptstatusexp+orderby + " "+limit },
{"search_lastfirstnamedob", "select demographic_no from demographic where last_name=? and first_name=? and year_of_birth=? and month_of_birth=? and date_of_birth=?"},
! {"search_demographiccust_alert", "select cust3 from demographiccust where demographic_no = ? " },
{"search_demographiccust", "select * from demographiccust where demographic_no = ?" },
{"search_demographic_ptbr","select * from demographic_ptbr where demographic_no = ?"},
{"search_demoaddno", "select demographic_no from demographic where last_name=? and first_name =? and year_of_birth=? and month_of_birth=? and date_of_birth=? and hin=? and ver=?"},
! {"search_custrecordno", "select demographic_no from demographiccust where demographic_no=?" },
! {"add_custrecord", "insert into demographiccust values(?,?,?,?,?, ?)" },
! {"update_custrecord", "update demographiccust set cust1=?,cust2=?,cust3=?,cust4=?,content=? where demographic_no=?" },
{"appt_history", "select appointment_no, appointment_date, start_time, end_time, reason, appointment.status, provider.last_name, provider.first_name from appointment LEFT JOIN provider ON appointment.provider_no=provider.provider_no where appointment.demographic_no=? "+ orderby + " desc "+limit },
{"search_ptstatus", "select distinct patient_status from demographic where patient_status != '' and patient_status != 'AC' and patient_status != 'IN' and patient_status != 'DE' and patient_status != 'MO' and patient_status != 'FI'"},
--- 72,97 ----
if(request.getParameter("ptstatus").equals("inactive")) ptstatusexp=" and patient_status in ("+props.getProperty("inactive_statuses", "'IN','DE','IC', 'ID', 'MO', 'FI'")+") ";
}
!
String [][] dbQueries=new String[][] {
! {"search_titlename", "select * from demographic where "+fieldname+" "+regularexp+" ? "+ptstatusexp+orderby+" "+limit},
! {"add_apptrecord", "select demographic_no,first_name,last_name,roster_status,sex,chart_no,year_of_birth,month_of_birth,date_of_birth,provider_no from demographic where "+fieldname+ " "+regularexp+" ? " +ptstatusexp+orderby + " "+limit},
! {"update_apptrecord", "select demographic_no,first_name,last_name,roster_status,sex,chart_no,year_of_birth,month_of_birth,date_of_birth,provider_no from demographic where "+fieldname+ " "+regularexp+" ? " +ptstatusexp+orderby + " "+limit},
{"search_detail", "select * from demographic where demographic_no=?"},
{"search_detail_ptbr", "select * from demographic d left outer join demographic_ptbr dptbr on dptbr.demographic_no = d.demographic_no where d.demographic_no=?"},
{"update_record", "update demographic set last_name=?,first_name =?,address=?, city=?,province=?,postal=?,phone =?,phone2=?,email=?,pin=?, year_of_birth=?,month_of_birth=?,date_of_birth=?,hin=?,ver=?, roster_status=?, patient_status=?, date_joined=?, chart_no=?,provider_no=?,sex=? , end_date=?,eff_date=?, pcn_indicator=?,hc_type=? ,hc_renew_date=?, family_doctor=? where demographic_no=?"},
{"update_record_ptbr", "update demographic_ptbr set cpf=?,rg=?,chart_address=?,marriage_certificate=?,birth_certificate=?,marital_state=?,partner_name=?,father_name=?,mother_name=?,district=?,address_no=?,complementary_address=? where demographic_no=?"},
! {"add_record", "insert into demographic (last_name, first_name, address, city, province, postal, phone, phone2, email, pin, year_of_birth, month_of_birth, date_of_birth, hin, ver, roster_status, patient_status, date_joined, chart_no, provider_no, sex, end_date, eff_date, pcn_indicator, hc_type, hc_renew_date, family_doctor) values(?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?)" },
! {"add_record_ptbr","insert into demographic_ptbr (demographic_no,cpf,rg,chart_address,marriage_certificate,birth_certificate,marital_state,partner_name,father_name,mother_name,district,address_no,complementary_address) values (?,?,?,?,?,?,?,?,?,?,?,?,?)" },
{"search_provider", "select * from provider order by last_name"},
{"search_demographicid", "select * from demographic where demographic_no=?"},
! {"search*", "select * from demographic "+ ptstatusexp+orderby + " "+limit },
{"search_lastfirstnamedob", "select demographic_no from demographic where last_name=? and first_name=? and year_of_birth=? and month_of_birth=? and date_of_birth=?"},
! {"search_demographiccust_alert", "select cust3 from demographiccust where demographic_no = ? " },
{"search_demographiccust", "select * from demographiccust where demographic_no = ?" },
{"search_demographic_ptbr","select * from demographic_ptbr where demographic_no = ?"},
{"search_demoaddno", "select demographic_no from demographic where last_name=? and first_name =? and year_of_birth=? and month_of_birth=? and date_of_birth=? and hin=? and ver=?"},
! {"search_custrecordno", "select demographic_no from demographiccust where demographic_no=?" },
! {"add_custrecord", "insert into demographiccust values(?,?,?,?,?, ?)" },
! {"update_custrecord", "update demographiccust set cust1=?,cust2=?,cust3=?,cust4=?,content=? where demographic_no=?" },
{"appt_history", "select appointment_no, appointment_date, start_time, end_time, reason, appointment.status, provider.last_name, provider.first_name from appointment LEFT JOIN provider ON appointment.provider_no=provider.provider_no where appointment.demographic_no=? "+ orderby + " desc "+limit },
{"search_ptstatus", "select distinct patient_status from demographic where patient_status != '' and patient_status != 'AC' and patient_status != 'IN' and patient_status != 'DE' and patient_status != 'MO' and patient_status != 'FI'"},
***************
*** 102,107 ****
{"search_demo_waiting_list", "select * from waitingList where demographic_no=? AND listID=?"},
{"search_future_appt", "select a.demographic_no, a.appointment_date from appointment a where a.appointment_date >= now() AND a.demographic_no=?"},
};
!
//associate each operation with an output JSP file -- displaymode
String[][] responseTargets=new String[][] {
--- 102,108 ----
{"search_demo_waiting_list", "select * from waitingList where demographic_no=? AND listID=?"},
{"search_future_appt", "select a.demographic_no, a.appointment_date from appointment a where a.appointment_date >= now() AND a.demographic_no=?"},
+ {"search_hindob", "select demographic_no from demographic where hin=? and year_of_birth=? and month_of_birth=? and date_of_birth=?"},
};
!
//associate each operation with an output JSP file -- displaymode
String[][] responseTargets=new String[][] {
***************
*** 112,116 ****
{"appt_history" , "demographicappthistory.jsp"},
{"Update Record" , "demographicupdatearecord.jsp"},
!
{"Add Demographic" , "adddemographictoappt.jsp"},
{" Search" , "demographicsearch2editapptresults.jsp"},
--- 113,117 ----
{"appt_history" , "demographicappthistory.jsp"},
{"Update Record" , "demographicupdatearecord.jsp"},
!
{"Add Demographic" , "adddemographictoappt.jsp"},
{" Search" , "demographicsearch2editapptresults.jsp"},
Index: demographicaddarecord.jsp
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/demographic/demographicaddarecord.jsp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** demographicaddarecord.jsp 8 Nov 2004 19:34:15 -0000 1.11
--- demographicaddarecord.jsp 28 Mar 2005 18:30:31 -0000 1.12
***************
*** 4,30 ****
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
! <!--
/*
! *
* 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
*/
-->
--- 4,30 ----
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
! <!--
/*
! *
* 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
*/
-->
***************
*** 41,45 ****
//parent.refresh();
close();
! }
//-->
</script>
--- 41,45 ----
//parent.refresh();
close();
! }
//-->
</script>
***************
*** 48,57 ****
<center>
<table border="0" cellspacing="0" cellpadding="0" width="100%" >
! <tr bgcolor="#486ebd">
<th align="CENTER"><font face="Helvetica" color="#FFFFFF">
<bean:message key="demographic.demographicaddarecord.title"/></font></th>
</tr>
</table>
!
<%
//if action is good, then give me the result
--- 48,57 ----
<center>
<table border="0" cellspacing="0" cellpadding="0" width="100%" >
! <tr bgcolor="#486ebd">
<th align="CENTER"><font face="Helvetica" color="#FFFFFF">
<bean:message key="demographic.demographicaddarecord.title"/></font></th>
</tr>
</table>
!
<%
//if action is good, then give me the result
***************
*** 77,81 ****
param[15]=request.getParameter("roster_status");
param[16]=request.getParameter("patient_status");
! // Databases have an alias for today. It is not necessary give the current date.
// ** Overridden - we want to give users option to change if needed
// ** Now defaults to current date on the add demographic screen
--- 77,81 ----
param[15]=request.getParameter("roster_status");
param[16]=request.getParameter("patient_status");
! // Databases have an alias for today. It is not necessary give the current date.
// ** Overridden - we want to give users option to change if needed
// ** Now defaults to current date on the add demographic screen
***************
*** 150,154 ****
param[25] = year + "-" + month + "-" + day;
! param[26]="<rdohip>" + request.getParameter("r_doctor_ohip") + "</rdohip>" + "<rd>" + request.getParameter("r_doctor") + "</rd>"+ (request.getParameter("family_doc")!=null? ("<family_doc>" + request.getParameter("family_doc") + "</family_doc>") : "");
String[] paramName =new String[5];
--- 150,154 ----
param[25] = year + "-" + month + "-" + day;
! param[26]="<rdohip>" + request.getParameter("r_doctor_ohip") + "</rdohip>" + "<rd>" + request.getParameter("r_doctor") + "</rd>"+ (request.getParameter("family_doc")!=null? ("<family_doc>" + request.getParameter("family_doc") + "</family_doc>") : "");
String[] paramName =new String[5];
***************
*** 160,164 ****
//System.out.println("from -------- :"+ param[0]+ ": next :"+param[1]);
ResultSet rs = apptMainBean.queryResults(paramName, "search_lastfirstnamedob");
!
if(rs.next()) { %>
***<font color='red'><bean:message key="demographic.demographicaddarecord.msgDuplicatedRecord"/></font>***<br>
--- 160,164 ----
//System.out.println("from -------- :"+ param[0]+ ": next :"+param[1]);
ResultSet rs = apptMainBean.queryResults(paramName, "search_lastfirstnamedob");
!
if(rs.next()) { %>
***<font color='red'><bean:message key="demographic.demographicaddarecord.msgDuplicatedRecord"/></font>***<br>
***************
*** 167,172 ****
}
// int rowsAffected = apptMainBean.queryExecuteUpdate(intparam, param, request.getParameter("dboperation"));
!
int rowsAffected = apptMainBean.queryExecuteUpdate(param, request.getParameter("dboperation")); //add_record
if (rowsAffected ==1) {
--- 167,189 ----
}
+ // add checking dob/hin duplicated record, if there is a HIN number
+ if(request.getParameter("hin")!=null && request.getParameter("hin").length()>5) {
+ //oscar.oscarBilling.ca.on.data.BillingONDataHelp dbObj = new oscar.oscarBilling.ca.on.data.BillingONDataHelp();
+ //String sql = "select demographic_no from demographic where hin=? and year_of_birth=? and month_of_birth=? and date_of_birth=?";
+ String[] paramNameHin =new String[4];
+ paramNameHin[0]=request.getParameter("hin").trim();
+ paramNameHin[1]=param[10].trim();
+ paramNameHin[2]=param[11].trim();
+ paramNameHin[3]=param[12].trim();
+ ResultSet rsHin = apptMainBean.queryResults(paramNameHin, "search_hindob");
+ if(rsHin.next()) { %>
+ ***<font color='red'><bean:message key="demographic.demographicaddarecord.msgDuplicatedRecord"/></font>***<br>
+ <br><a href=# onClick="history.go(-1);"><b><-<bean:message key="global.btnBack"/></b></a>
+ <% return;
+ }
+ }
+
// int rowsAffected = apptMainBean.queryExecuteUpdate(intparam, param, request.getParameter("dboperation"));
!
int rowsAffected = apptMainBean.queryExecuteUpdate(param, request.getParameter("dboperation")); //add_record
if (rowsAffected ==1) {
***************
*** 180,189 ****
param1[5]=request.getParameter("hin");
param1[6]=request.getParameter("ver");
!
rs = apptMainBean.queryResults(param1, "search_demoaddno");
if(rs.next()) { //
//add democust record for alert
String[] param2 =new String[6];
! param2[0]=rs.getString("demographic_no");
param2[1]=request.getParameter("cust1");
param2[2]=request.getParameter("cust2");
--- 197,206 ----
param1[5]=request.getParameter("hin");
param1[6]=request.getParameter("ver");
!
rs = apptMainBean.queryResults(param1, "search_demoaddno");
if(rs.next()) { //
//add democust record for alert
String[] param2 =new String[6];
! param2[0]=rs.getString("demographic_no");
param2[1]=request.getParameter("cust1");
param2[2]=request.getParameter("cust2");
***************
*** 193,202 ****
System.out.println("demographic_no" + param2[0] +param2[1]+param2[2]+param2[3]+param2[4]+param2[5] );
rowsAffected = apptMainBean.queryExecuteUpdate(param2, "add_custrecord" ); //add_record
!
//add to waiting list if the waiting_list parameter in the property file is set to true
!
WaitingList wL = WaitingList.getInstance();
if(wL.getFound()){
!
String[] paramWLPosition = new String[1];
paramWLPosition[0] = request.getParameter("list_id");
--- 210,219 ----
System.out.println("demographic_no" + param2[0] +param2[1]+param2[2]+param2[3]+param2[4]+param2[5] );
rowsAffected = apptMainBean.queryExecuteUpdate(param2, "add_custrecord" ); //add_record
!
//add to waiting list if the waiting_list parameter in the property file is set to true
!
WaitingList wL = WaitingList.getInstance();
if(wL.getFound()){
!
String[] paramWLPosition = new String[1];
paramWLPosition[0] = request.getParameter("list_id");
***************
*** 218,222 ****
if (request.getParameter("dboperation2") != null) {
String[] parametros = new String[13];
!
parametros[0]=rs.getString("demographic_no");
parametros[1]=request.getParameter("cpf");
--- 235,239 ----
if (request.getParameter("dboperation2") != null) {
String[] parametros = new String[13];
!
parametros[0]=rs.getString("demographic_no");
parametros[1]=request.getParameter("cpf");
***************
*** 232,250 ****
parametros[11]=request.getParameter("address_no")==null || request.getParameter("address_no").trim().equals("")?"0":request.getParameter("address_no");
parametros[12]=request.getParameter("complementary_address");
!
!
rowsAffected = apptMainBean.queryExecuteUpdate(parametros, request.getParameter("dboperation2")); //add_record
}
!
}
!
%>
<p><h2><bean:message key="demographic.demographicaddarecord.msgSuccessful"/>
</h2></p>
! <%
} else {
%>
<p><h1><bean:message key="demographic.demographicaddarecord.msgFailed"/></h1></p>
! <%
}
apptMainBean.closePstmtConn();
--- 249,267 ----
parametros[11]=request.getParameter("address_no")==null || request.getParameter("address_no").trim().equals("")?"0":request.getParameter("address_no");
parametros[12]=request.getParameter("complementary_address");
!
!
rowsAffected = apptMainBean.queryExecuteUpdate(parametros, request.getParameter("dboperation2")); //add_record
}
!
}
!
%>
<p><h2><bean:message key="demographic.demographicaddarecord.msgSuccessful"/>
</h2></p>
! <%
} else {
%>
<p><h1><bean:message key="demographic.demographicaddarecord.msgFailed"/></h1></p>
! <%
}
apptMainBean.closePstmtConn();
|