Update of /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarBilling/ca/on/pageUtil
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv30970/WEB-INF/classes/src/oscar/oscarBilling/ca/on/pageUtil
Modified Files:
BillingStatusPrep.java
Added Files:
PatientEndYearStatementBean.java
PatientEndYearStatementServiceBean.java
PatientEndYearStatementForm.java
PatientEndYearStatementAction.java
PatientEndYearStatementInvoiceBean.java
Log Message:
1) invoice report enhancement.
2) add year end patient priate billing report.
3) auto add tickler to appointment if patients owes private payment.
--- NEW FILE: PatientEndYearStatementBean.java ---
package oscar.oscarBilling.ca.on.pageUtil;
import java.util.Date;
public class PatientEndYearStatementBean {
private String patientName;
private String patientNo;
private String hin;
private String address;
private String phone;
private String invoiced = "0.00";
private String paid = "0.00";
private String count = "0";
private Date fromDate;
private Date toDate;
// private String fromDateParam;
// private String todateParam;
public PatientEndYearStatementBean(String patientName, String patientNo, String hin,
String address, String phone) {
super();
this.patientName = patientName;
this.patientNo = patientNo;
this.hin = hin;
this.address = address;
this.phone = phone;
}
public String getPatientName() {
return patientName;
}
public void setPatientName(String patientName) {
this.patientName = patientName;
}
public String getHin() {
return hin;
}
public void setHin(String hin) {
this.hin = hin;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo;
}
public String getInvoiced() {
return invoiced;
}
public void setInvoiced(String invoiced) {
this.invoiced = invoiced;
}
public String getPaid() {
return paid;
}
public void setPaid(String paid) {
this.paid = paid;
}
public String getCount() {
return count;
}
public void setCount(String count) {
this.count = count;
}
public Date getFromDate() {
return fromDate;
}
public void setFromDate(Date fromDate) {
this.fromDate = fromDate;
}
public Date getToDate() {
return toDate;
}
public void setToDate(Date toDate) {
this.toDate = toDate;
}
/*
public String getFromDateParam() {
return fromDateParam;
}
public void setFromDateParam(String fromDateParam) {
this.fromDateParam = fromDateParam;
}
public String getTodateParam() {
return todateParam;
}
public void setTodateParam(String todateParam) {
this.todateParam = todateParam;
}
*/
}
--- NEW FILE: PatientEndYearStatementAction.java ---
package oscar.oscarBilling.ca.on.pageUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.text.DateFormat;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.oscarehr.PMmodule.utility.Utility;
import org.oscarehr.common.dao.DemographicDao;
import org.oscarehr.common.model.Demographic;
import org.oscarehr.util.DbConnectionFilter;
import org.oscarehr.util.SpringUtils;
import oscar.OscarDocumentCreator;
import oscar.oscarBilling.ca.bc.MSP.MSPReconcile;
import oscar.oscarBilling.ca.bc.MSP.MSPReconcile.BillSearch;
import oscar.oscarBilling.ca.on.data.BillingCodeData;
import oscar.oscarBilling.ca.on.data.BillingONDataHelp;
import oscar.oscarBilling.ca.on.data.JdbcBillingReviewImpl;
import oscar.oscarDemographic.data.DemographicData;
import oscar.OscarAction;
/**
*
* @author Eugene Katyukhin
*/
public class PatientEndYearStatementAction extends OscarAction {
private static final Logger _logger = Logger.getLogger(BillingStatusPrep.class);
private static final String RES_SUCCESS = "success";
private static final String RES_FAILURE = "failure";
private static final String REPORTS_PATH = "oscar/oscarBilling/ca/on/reports/";
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
PatientEndYearStatementForm statement = (PatientEndYearStatementForm)form;
List<PatientEndYearStatementInvoiceBean> result = null;
PatientEndYearStatementBean summary = new PatientEndYearStatementBean("", "", "", "", "");
ActionMessages errors = this.getErrors(request);
if(request.getParameter("search") != null || request.getParameter("pdf") != null) {
request.setAttribute("fromDateParam",statement.getFromDateParam());
request.setAttribute("toDateParam",statement.getToDateParam());
Date fromDate = statement.getFromDate();
Date toDate = statement.getToDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
if(request.getParameter("search") != null) {
DemographicDao dao = (DemographicDao) SpringUtils.getBean("demographicDao");
List<Demographic> demographicList = dao.searchDemographic(statement.getLastNameParam()+","+statement.getFirstNameParam());
if(demographicList == null || demographicList.size()==0) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("error.billingReport.invalidPatientName"));
saveErrors(request,errors);
_logger.error("Failed to find patient name: "+statement.getFirstNameParam()+","+statement.getLastNameParam());
return mapping.findForward(RES_FAILURE);
}
if(demographicList.size()>1) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("error.billingReport.notSelectivePatientName"));
saveErrors(request,errors);
_logger.error("Patient name is not selective enough: "+statement.getFirstNameParam()+","+statement.getLastNameParam());
return mapping.findForward(RES_FAILURE);
}
Demographic demographic = demographicList.get(0);
summary.setPatientNo(demographic.getChartNo());
summary.setPatientName(demographic.getFormattedName());
summary.setHin(demographic.getHin());
summary.setAddress(demographic.getAddress()+" "+demographic.getCity()+" "+demographic.getProvince());
summary.setPhone(demographic.getPhone()+" "+demographic.getPhone2());
request.setAttribute("summary", summary);
BillingONDataHelp dbObj = new BillingONDataHelp();
//testing data: 18812 2010-05-01 2010-05-02
String sql = "SELECT bch.id,bch.billing_date,bch.total,bch.paid,bch.demographic_name,d.address,d.hin,d.phone,d.phone2 " +
" FROM billing_on_cheader1 bch JOIN demographic d ON bch.demographic_no=d.demographic_no " +
" WHERE bch.demographic_no='" + demographic.getDemographicNo() + "' AND bch.pay_program='PAT' ";
if(fromDate != null) sql += " AND bch.billing_date >= '" + df.format(fromDate);
if(toDate != null) sql += "' AND bch.billing_date <= '" + df.format(toDate) + "'";
sql += " ORDER BY bch.id";
ResultSet rs = dbObj.searchDBRecord(sql);
if(rs == null) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.billing.ca.on.database", "SQL error"));
saveErrors(request,errors);
_logger.error("Database error on query "+sql);
return mapping.findForward(RES_FAILURE);
}
double totalInvoiced = 0;
double totalPaid = 0;
int invoiceCount = 0;
try {
if(rs.next()) {
result = new ArrayList<PatientEndYearStatementInvoiceBean>();
do {
String paid = Utility.toCurrency(rs.getString("paid"));
String invoiced = Utility.toCurrency(rs.getString("total"));
PatientEndYearStatementInvoiceBean bean =
new PatientEndYearStatementInvoiceBean(rs.getInt("id"),
rs.getDate("billing_date"), invoiced, paid );
String sql2 = "SELECT bi.service_code,bi.fee FROM billing_on_item bi WHERE ch1_id="+rs.getInt("id")+" ORDER BY bi.service_code";
ResultSet rs2 = dbObj.searchDBRecord(sql2);
List<PatientEndYearStatementServiceBean> services = null;
if(rs2 == null) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.billing.ca.on.database", "SQL error"));
saveErrors(request,errors);
_logger.error("Database error on query "+sql2);
return mapping.findForward(RES_FAILURE);
}
try {
if(rs2.next()) {
services = new ArrayList<PatientEndYearStatementServiceBean>();
do {
String fee = Utility.toCurrency(rs2.getString("fee"));
PatientEndYearStatementServiceBean serviceBean =
new PatientEndYearStatementServiceBean(rs2.getString("service_code"),fee );
services.add(serviceBean);
} while (rs2.next());
}
} catch (SQLException e) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.billing.ca.on.database", "SQL error"));
saveErrors(request,errors);
_logger.error("Database error on query "+sql2,e);
return mapping.findForward(RES_FAILURE);
}
bean.setServices(services);
result.add(bean);
totalInvoiced += Double.parseDouble(invoiced);
totalPaid += Double.parseDouble(paid);
invoiceCount += 1;
request.setAttribute("result", result);
} while (rs.next());
}
summary.setInvoiced(Utility.toCurrency(totalInvoiced));
summary.setPaid(Utility.toCurrency(totalPaid));
summary.setCount(Integer.toString(invoiceCount));
request.getSession().setAttribute("summary", summary);
} catch (SQLException e) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.billing.ca.on.database", "SQL error"));
saveErrors(request,errors);
_logger.error("Database error on query "+sql,e);
return mapping.findForward(RES_FAILURE);
}
} else if(request.getParameter("pdf") != null) {
summary = (PatientEndYearStatementBean) request.getSession().getAttribute("summary");
OscarDocumentCreator osc = new OscarDocumentCreator();
String docFmt = "pdf";
HashMap reportParams = new HashMap();
reportParams.put("patientId", summary.getPatientNo());
reportParams.put("patientName", summary.getPatientName());
reportParams.put("hin", summary.getHin());
reportParams.put("address", summary.getAddress());
reportParams.put("phone", summary.getPhone());
reportParams.put("fromDate", statement.getFromDate() != null ? df.format(statement.getFromDate()) : "");
reportParams.put("toDate", statement.getToDate() != null ? df.format(statement.getToDate()) : "");
reportParams.put("invoiceCount", summary.getCount());
reportParams.put("totalInvoiced", summary.getInvoiced());
reportParams.put("totalPaid", summary.getPaid());
request.setAttribute("fromDateParam",statement.getFromDateParam());
request.setAttribute("toDateParam",statement.getToDateParam());
reportParams.put("SUBREPORT_DIR", REPORTS_PATH);
ServletOutputStream outputStream = getServletOstream(response);
//open corresponding Jasper Report Definition
InputStream reportInstream = osc.getDocumentStream(REPORTS_PATH + "end_year_statement_report.jrxml");
//COnfigure Reponse Header
cfgHeader(response, "end_year_statement_report.pdf", docFmt);
//Fill document with report parameter data
Connection dbConn = null;
try {
dbConn = DbConnectionFilter.getThreadLocalDbConnection();
} catch (SQLException ex) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("errors.billing.ca.on.database", "Database access error"));
saveErrors(request,errors);
_logger.error("Can't get db connection",ex);
return mapping.findForward(RES_FAILURE);
}
if(dbConn != null) osc.fillDocumentStream(reportParams, outputStream, docFmt, reportInstream, dbConn);
return null;
}
} else if (request.getParameter("demosearch") != null) {
request.getSession().setAttribute("summary", null);
DemographicDao dao = (DemographicDao) SpringUtils.getBean("demographicDao");
List<Demographic> demographicList = dao.searchDemographic(statement.getLastNameParam()+","+statement.getFirstNameParam());
if(demographicList == null || demographicList.size()==0) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("error.billingReport.invalidPatientName"));
saveErrors(request,errors);
_logger.error("Failed to find patient name: "+statement.getFirstNameParam()+","+statement.getLastNameParam());
return mapping.findForward(RES_FAILURE);
}
if(demographicList.size()>1) {
errors.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("error.billingReport.notSelectivePatientName"));
saveErrors(request,errors);
_logger.error("Patient name is not selective enough: "+statement.getFirstNameParam()+","+statement.getLastNameParam());
return mapping.findForward(RES_FAILURE);
}
Demographic demographic = demographicList.get(0);
summary.setPatientNo(demographic.getChartNo());
summary.setPatientName(demographic.getFormattedName());
summary.setHin(demographic.getHin());
summary.setAddress(demographic.getAddress()+" "+demographic.getCity()+" "+demographic.getProvince());
summary.setPhone(demographic.getPhone()+" "+demographic.getPhone2());
request.setAttribute("summary", summary);
} else {
request.getSession().setAttribute("summary", null);
}
return mapping.findForward(RES_SUCCESS);
}
}
--- NEW FILE: PatientEndYearStatementInvoiceBean.java ---
package oscar.oscarBilling.ca.on.pageUtil;
import java.util.Date;
import java.util.List;
/**
* @author Eugene Katyukhin
*/
public class PatientEndYearStatementInvoiceBean {
private Date invoiceDate;
private int invoiceNo;
private String invoiced;
private String paid;
private List<PatientEndYearStatementServiceBean> services;
public PatientEndYearStatementInvoiceBean() { }
public PatientEndYearStatementInvoiceBean(int invoiceNo, Date invoiceDate,
String invoiced, String paid) {
super();
this.invoiceDate = invoiceDate;
this.invoiceNo = invoiceNo;
this.invoiced = invoiced;
this.paid = paid;
}
public Date getInvoiceDate() {
return invoiceDate;
}
public void setInvoiceDate(Date invoiceDate) {
this.invoiceDate = invoiceDate;
}
public int getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(int invoiceNo) {
this.invoiceNo = invoiceNo;
}
public String getInvoiced() {
return invoiced;
}
public void setInvoiced(String invoiced) {
this.invoiced = invoiced;
}
public String getPaid() {
return paid;
}
public void setPaid(String paid) {
this.paid = paid;
}
public List<PatientEndYearStatementServiceBean> getServices() {
return services;
}
public void setServices(List<PatientEndYearStatementServiceBean> services) {
this.services = services;
}
}
--- NEW FILE: PatientEndYearStatementServiceBean.java ---
package oscar.oscarBilling.ca.on.pageUtil;
import java.util.Date;
/**
* @author Eugene Katyukhin
*/
public class PatientEndYearStatementServiceBean {
private String code;
private String fee;
public PatientEndYearStatementServiceBean(String code, String fee) {
super();
this.code = code;
this.fee = fee;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getFee() {
return fee;
}
public void setFee(String fee) {
this.fee = fee;
}
}
--- NEW FILE: PatientEndYearStatementForm.java ---
// -----------------------------------------------------------------------------------------------------------------------
// *
// *
// * 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.oscarBilling.ca.on.pageUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.apache.struts.upload.FormFile;
/**
* @author Eugene Katyukhin
*/
public final class PatientEndYearStatementForm extends ActionForm {
private static Logger logger = Logger.getLogger(PatientEndYearStatementForm.class);
private String firstNameParam;
private String lastNameParam;
private String fromDateParam;
private String toDateParam;
// private Date fromDate;
// private Date toDate;
public PatientEndYearStatementForm() {}
/*
public PatientEndYearStatementForm(String patientId, String fromDate,
String toDate) {
super();
this.patientIdParam = patientId;
this.fromDateParam = fromDate;
this.toDateParam = toDate;
}
*/
public String getFirstNameParam() {
return firstNameParam;
}
public void setFirstNameParam(String name) {
this.firstNameParam = name;
}
public String getLastNameParam() {
return lastNameParam;
}
public void setLastNameParam(String name) {
this.lastNameParam = name;
}
public String getFromDateParam() {
return fromDateParam;
}
public void setFromDateParam(String fromDate) {
this.fromDateParam = fromDate;
}
public Date getFromDate() {
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
Date res = null;
try {
if(fromDateParam != null && fromDateParam.length()>0) res = df.parse(fromDateParam);
} catch(ParseException ex) {
logger.error("Can't parse date: "+fromDateParam);
return null;
}
return res;
}
public String getToDateParam() {
return toDateParam;
}
public void setToDateParam(String toDate) {
this.toDateParam = toDate;
}
public Date getToDate() {
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
Date res = null;
try {
if(toDateParam != null && toDateParam.length()>0) res = df.parse(toDateParam);
} catch(ParseException ex) {
logger.error("Can't parse date: "+toDateParam);
return null;
}
return res;
}
public ActionErrors validate (ActionMapping mapping , HttpServletRequest request){
ActionErrors errors = new ActionErrors();
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd");
if(request.getParameter("search") != null) {
if ((this.firstNameParam == null || this.firstNameParam.length()==0) &&
(this.lastNameParam == null || this.lastNameParam.length()==0)) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.billingReport.noPatient"));
}
try {
if(fromDateParam != null && fromDateParam.length()>0) df.parse(fromDateParam);
if(toDateParam != null && toDateParam.length()>0) df.parse(toDateParam);
} catch(ParseException ex) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.billingReport.invalidDateFormat"));
}
}
return errors;
}
}
Index: BillingStatusPrep.java
===================================================================
RCS file: /cvsroot/oscarmcmaster/oscar_mcmaster/web/WEB-INF/classes/src/oscar/oscarBilling/ca/on/pageUtil/BillingStatusPrep.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BillingStatusPrep.java 24 Dec 2006 14:39:20 -0000 1.1
--- BillingStatusPrep.java 2 Jan 2011 20:58:20 -0000 1.2
***************
*** 1,12 ****
--- 1,21 ----
package oscar.oscarBilling.ca.on.pageUtil;
+ import java.sql.ResultSet;
+ import java.sql.SQLException;
+ import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
+ import org.apache.struts.util.LabelValueBean;
import oscar.oscarBilling.ca.on.data.JdbcBillingReviewImpl;
+ import oscar.oscarDB.DBHandler;
public class BillingStatusPrep {
private static final Logger _logger = Logger.getLogger(BillingStatusPrep.class);
+ private static final String ANY_PROVIDER = "all";
+ private static final String ANY_STATUS_TYPE = "%";
+ private static final String ANY_SERVICE_CODE = "%";
+ private static final String ANY_BILLING_FORM = "---";
// JdbcBillingRAImpl dbObj = new JdbcBillingRAImpl();
***************
*** 16,22 ****
JdbcBillingReviewImpl bObj = new JdbcBillingReviewImpl();
billType = billType == null || billType.length() == 0 ? "" : " and pay_program in (" + billType + ")";
! statusType = statusType == null || statusType.length() == 0 || statusType.equals("%") ? "" : " and status = '"
+ statusType + "'";
! providerNo = providerNo == null || providerNo.length() == 0 ? "" : " and provider_no ='" + providerNo + "'";
startDate = startDate == null || startDate.length() == 0 ? "" : " and billing_date >= '" + startDate + "'";
endDate = endDate == null || endDate.length() == 0 ? "" : " and billing_date <= '" + endDate + "'";
--- 25,31 ----
JdbcBillingReviewImpl bObj = new JdbcBillingReviewImpl();
billType = billType == null || billType.length() == 0 ? "" : " and pay_program in (" + billType + ")";
! statusType = statusType == null || statusType.length() == 0 || statusType.equals(ANY_STATUS_TYPE) ? "" : " and status = '"
+ statusType + "'";
! providerNo = providerNo == null || providerNo.length() == 0 || providerNo.equals(ANY_PROVIDER) ? "" : " and provider_no ='" + providerNo + "'";
startDate = startDate == null || startDate.length() == 0 ? "" : " and billing_date >= '" + startDate + "'";
endDate = endDate == null || endDate.length() == 0 ? "" : " and billing_date <= '" + endDate + "'";
***************
*** 28,46 ****
public List getBills(String billType, String statusType, String providerNo, String startDate, String endDate,
! String demoNo, String serviceCode, String dx, String visitType) {
JdbcBillingReviewImpl bObj = new JdbcBillingReviewImpl();
! billType = billType == null || billType.length() == 0 ? "" : " and pay_program in (" + billType + ")";
! statusType = statusType == null || statusType.length() == 0 || statusType.equals("%") ? "" : " and status = '"
+ statusType + "'";
! providerNo = providerNo == null || providerNo.length() == 0 ? "" : " and provider_no ='" + providerNo + "'";
! startDate = startDate == null || startDate.length() == 0 ? "" : " and billing_date >= '" + startDate + "'";
! endDate = endDate == null || endDate.length() == 0 ? "" : " and billing_date <= '" + endDate + "'";
! demoNo = demoNo == null || demoNo.length() == 0 ? "" : " and demographic_no=" + demoNo;
! dx = dx == null || dx.length() < 2 ? "" : " and dx='" + dx + "'";
! visitType = visitType == null || visitType.length() < 2 ? "" : " and visittype='" + visitType + "'";
! List retval = bObj.getBill(billType, statusType, providerNo, startDate, endDate, demoNo, serviceCode, dx,
visitType);
return retval;
}
}
--- 37,80 ----
public List getBills(String billType, String statusType, String providerNo, String startDate, String endDate,
! String demoNo, String serviceCodeParams, String dx, String visitType, String billingForm) {
JdbcBillingReviewImpl bObj = new JdbcBillingReviewImpl();
! billType = billType == null || billType.length() == 0 ? "" : " and ch1.pay_program in (" + billType + ")";
! statusType = statusType == null || statusType.length() == 0 || statusType.equals(ANY_STATUS_TYPE) ? "" : " and ch1.status = '"
+ statusType + "'";
! providerNo = providerNo == null || providerNo.length() == 0 || providerNo.equals(ANY_PROVIDER) ? "" : " and ch1.provider_no ='" + providerNo + "'";
! startDate = startDate == null || startDate.length() == 0 ? "" : " and ch1.billing_date >= '" + startDate + "'";
! endDate = endDate == null || endDate.length() == 0 ? "" : " and ch1.billing_date <= '" + endDate + "'";
! demoNo = demoNo == null || demoNo.length() == 0 ? "" : " and ch1.demographic_no=" + demoNo;
! dx = dx == null || dx.length() < 2 ? "" : " and ch1.dx='" + dx + "'";
! visitType = visitType == null || visitType.length() < 2 ? "" : " and ch1.visittype='" + visitType + "'";
! serviceCodeParams = serviceCodeParams == null || serviceCodeParams.length() == 0 || serviceCodeParams.equals(ANY_SERVICE_CODE) ? "" : serviceCodeParams.toUpperCase();
! billingForm = billingForm == null || billingForm.length() == 0 || billingForm.equals(ANY_BILLING_FORM) ? "" : billingForm;
!
! List<String> serviceCodeList = bObj.mergeServiceCodes(serviceCodeParams, billingForm);
! String serviceCodes = "";
! if(serviceCodeList != null && serviceCodeList.size()>0) {
! for(String serviceCode : serviceCodeList) {
! if(serviceCodes.length() == 0) serviceCodes = " and (" +serviceCode;
! else serviceCodes += " or " + serviceCode;
! }
! serviceCodes += ")";
! }
!
! List retval = bObj.getBill(billType, statusType, providerNo, startDate, endDate, demoNo, serviceCodes, dx,
visitType);
return retval;
}
+
+ public List getBills(String billType, String statusType, String providerNo, String startDate, String endDate,
+ String demoNo, String serviceCode, String dx, String visitType) {
+ return getBills(billType, statusType, providerNo, startDate, endDate,
+ demoNo, serviceCode, dx, visitType, null);
+ }
+ public List<LabelValueBean> listBillingForms() {
+ JdbcBillingReviewImpl bObj = new JdbcBillingReviewImpl();
+ List<LabelValueBean> billingFormsList = bObj.listBillingForms();
+ if(billingFormsList == null) billingFormsList = new ArrayList<LabelValueBean>();
+ return billingFormsList;
+ }
}
|