Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Services categories(Gyneco-Obstetrique, Polyclique)on File Insu… #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ public static List<String> getAllServiceCategories() {
categories.add(Category.NEUROLOGIE.getDescription());
categories.add(Category.AUTRES.getDescription());
categories.add(Category.AMBULANCE.getDescription());
categories.add(Category.GYNECO_OBSTETRIQUE.getDescription());
categories.add(Category.POLYCLINIQUE.getDescription());

return categories;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ public static String getTotalPaidByConsommation(Integer consommationId){
Consommation c = ConsommationUtil.getConsommation(consommationId);
BigDecimal totalPaid = new BigDecimal(0);
for (BillPayment pay : c.getPatientBill().getPayments()) {
if(!pay.isVoided())
//if(!pay.isVoided())
if(pay.getVoidReason()==null)
totalPaid=totalPaid.add(pay.getAmountPaid());
}
return ""+totalPaid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public static BigDecimal getTotalByCategorizedPaidItems(List<PaidServiceBill> pa
Float insuranceRate = pi.getBillItem().getConsommation().getBeneficiary().getInsurancePolicy().getInsurance().getCurrentRate().getRate();
Float pRate = (100f - insuranceRate) / 100f;
BigDecimal patientRte = new BigDecimal(""+pRate);
if(pi.getBillItem().getHopService().getName().equals(category)){
if(pi.getBillItem().getHopService().getName().equals(category) && pi.getBillItem().getConsommation().getThirdPartyBill()==null){
BigDecimal reqQty = pi.getBillItem().getQuantity();
BigDecimal unitPrice =pi.getBillItem().getUnitPrice();
totalByCategory =totalByCategory.add(reqQty.multiply(unitPrice).multiply(patientRte));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public enum Category {
ORL ("ORL"),OXYGENOTHERAPIE ("OXYGENOTHERAPIE"),PEDIATRIE ("PEDIATRIE"),
RADIOLOGIE ("RADIOLOGIE"),SOINS_INFIRMIERS ("SOINS INFIRMIERS"),
SOINS_INTENSIFS ("SOINS INTENSIFS"),STOMATOLOGIE ("STOMATOLOGIE"),
NEUROLOGIE("NEUROLOGIE"),AUTRES("AUTRES"),AMBULANCE("AMBULANCE");
NEUROLOGIE("NEUROLOGIE"),AUTRES("AUTRES"),AMBULANCE("AMBULANCE"),
GYNECO_OBSTETRIQUE ("GYNECO - OBSTETRIQUE"),
POLYCLINIQUE("POLYCLINIQUE");


private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected ModelAndView handleRequestInternal(HttpServletRequest request,
mav.addObject("pendingRefunds", pendingRefunds);
mav.addObject("checkedRefundsByChief", checkedRefundsByChief);
}
String receiptTitle = consommation.getBeneficiary().getPatient().getPersonName()+"-BILL#"+consommation.getConsommationId()+"-payment#"+payment.getBillPaymentId();
String receiptTitle = consommation.getBeneficiary().getPatient().getPersonName()+"-BILL#"+consommation.getConsommationId()+"-payment#"+payment.getBillPaymentId().toString().concat(".pdf");
if(request.getParameter("print")!=null){
FileExporter exp = new FileExporter();
exp.printPayment(request, response, payment, consommation, receiptTitle);
Expand Down
18 changes: 18 additions & 0 deletions omod/src/main/resources/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,24 @@
<name>Manage deposit</name>
<description>Allows user to manage admission</description>
</privilege>

<!-- Discharge a patient -->
<privilege>
<name>Discharge Patient</name>
<description>Allows the user to discharge a patient and close the global bill</description>
</privilege>

<!-- Add Consommation -->
<privilege>
<name>Add Consommation</name>
<description>Allows the user to add consommation on global bill</description>
</privilege>

<!--Add Item -->
<privilege>
<name>Add Item</name>
<description>Allow user to add item on the same consommation</description>
</privilege>



Expand Down
2 changes: 2 additions & 0 deletions omod/src/main/webapp/mohBillingConsommationItemList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<td>Consommation # : <b>${consommation.consommationId}(${consommation.department.name})</b></td>
<td>Global Bill # : <b>${consommation.globalBill.billIdentifier}</b></td>
<c:if test="${empty consommation.patientBill.payments && !consommation.globalBill.closed}">
<openmrs:hasPrivilege privilege="Add Item">
<td><a href="billing.form?consommationId=${consommation.consommationId}&departmentId=${consommation.department.departmentId}&insurancePolicyId=${param.insurancePolicyId}&ipCardNumber=${insurancePolicy.insuranceCardNo}&globalBillId=${consommation.globalBill.globalBillId}&addNew=true">Add Item</a></td>
</openmrs:hasPrivilege>
</c:if>
</tr>
</table>
Expand Down
8 changes: 7 additions & 1 deletion omod/src/main/webapp/mohBillingConsommationList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

<!-- see http://www.quackit.com/html/codes/html_close_window_code.cfm -->
<c:if test="${not globalBill.closed}">
<a href="javascript:window.open('admission.form?globalBillId=${globalBill.globalBillId}&insurancePolicyId=${insurancePolicy.insurancePolicyId }&ipCardNumber=${insurancePolicy.insuranceCardNo}&discharge=true', 'dischargeWindow', 'height=300,width=450,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes').focus()">Dischage the Patient | </a>

<openmrs:hasPrivilege privilege="Discharge Patient">
<a href="javascript:window.open('admission.form?globalBillId=${globalBill.globalBillId}&insurancePolicyId=${insurancePolicy.insurancePolicyId }&ipCardNumber=${insurancePolicy.insuranceCardNo}&discharge=true', 'dischargeWindow', 'height=300,width=450,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes').focus()">Dischrage the Patient |</a>
</openmrs:hasPrivilege>
<openmrs:hasPrivilege privilege="Add Consommation">
<a href="billing.form?insurancePolicyId=${insurancePolicy.insurancePolicyId}&ipCardNumber=${insurancePolicy.insuranceCardNo}&globalBillId=${globalBill.globalBillId}">Add Consommation</a></div>
</openmrs:hasPrivilege>
</c:if>
<b class="boxHeader">Consommations List for Global Bill id # ${globalBill.billIdentifier}</b>
<div class="box">
Expand Down Expand Up @@ -53,7 +57,9 @@
<td class="rowValue ${(status.count%2!=0)?'even':''}">${billingtag:consommationStatus(consommation.consommationId)}</td>
<td class="rowValue ${(status.count%2!=0)?'even':''}">&nbsp;<a href="patientBillPayment.form?consommationId=${consommation.consommationId}">view</a></td>
<c:if test="${empty consommation.patientBill.payments && not consommation.globalBill.closed }">
<openmrs:hasPrivilege privilege="Edit Bill">
<td class="rowValue ${(status.count%2!=0)?'even':''}"><a href="billing.form?consommationId=${consommation.consommationId}&departmentId=${consommation.department.departmentId}&insurancePolicyId=${param.insurancePolicyId}&ipCardNumber=${param.ipCardNumber}&edit=true">Edit</a></td>
</openmrs:hasPrivilege>
<!-- <td class="rowValue ${(status.count%2!=0)?'even':''}"><a href="billing.form?consommationId=${consommation.consommationId}&departmentId=${consommation.department.departmentId}&insurancePolicyId=${param.insurancePolicyId}&ipCardNumber=${param.ipCardNumber}&globalBillId=${consommation.globalBill.globalBillId}&addNew=true">Add Item</a></td> -->
</c:if>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions omod/src/main/webapp/mohBillingGlobalBillList.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
<td class="rowValue ${(status.count%2!=0)?'even':''}">&nbsp;

<c:if test="${not globalBill.closed}">
<openmrs:hasPrivilege privilege="Add Consommation">
<a href="billing.form?insurancePolicyId=${insurancePolicyId }&ipCardNumber=${ipCardNumber}&globalBillId=${globalBillId}">Add</a>
</openmrs:hasPrivilege>
</c:if>
<a href="consommation.list?insurancePolicyId=${insurancePolicyId }&ipCardNumber=${ipCardNumber}&globalBillId=${globalBillId}">View</a>
</td>
Expand Down
4 changes: 3 additions & 1 deletion omod/src/main/webapp/mohBillingPatientBillPaymentForm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ function recalculateTotals() {
</td>
<td>Global Bill # : <b>${consommation.globalBill.billIdentifier}</b></td>
<c:if test="${empty consommation.patientBill.payments && !consommation.globalBill.closed}">
<openmrs:hasPrivilege privilege="Add Item">
<td><a href="billing.form?consommationId=${consommation.consommationId}&departmentId=${consommation.department.departmentId}&insurancePolicyId=${param.insurancePolicyId}&ipCardNumber=${insurancePolicy.insuranceCardNo}&globalBillId=${consommation.globalBill.globalBillId}&addNew=true">Add Item</a></td>
</openmrs:hasPrivilege>
</c:if>
</tr>
</table>
Expand Down Expand Up @@ -331,7 +333,7 @@ function recalculateTotals() {
<tr></tr>
<tr>
<td colspan="2"><div><a href="searchBillPayment.form?paymentId=${payment.billPaymentId}&consommationId=${consommation.consommationId}&type=epson">EPSON Printer</a></div></td>
</tr>
</tr>
</table>
</form>
<div style="text-align: right;"><a href="searchBillPayment.form?paymentId=${payment.billPaymentId}&consommationId=${consommation.consommationId}&print=true">Print Payment</a></div>
Expand Down
41 changes: 28 additions & 13 deletions omod/src/main/webapp/mohBillingThirdPartyReport.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@ ${resultMsg} <b style="color: black;font: bold;"></b>
<th class="columnHeader" style="width: 3%">#</th>
<th class="columnHeader" style="width: 8%">Date</th>

<th class="columnHeader">Card NUMBER </th>
<th class="columnHeader">CARD NUMBER </th>
<th class="columnHeader">AGE</th>
<th class="columnHeader">Gender</th>
<th class="columnHeader" style="width: 15%">BENEFICIARY'S NAMES</th>
<th class="columnHeader">Insurance Name</th>
<th class="columnHeader">Insurance Rate</th>
<th class="columnHeader">Patient Rate</th>

<c:forEach items="${columns }" var="categ">
<c:if test="${categ eq 'FORMALITES ADMINISTRATIVES' }">
Expand All @@ -74,15 +77,22 @@ ${resultMsg} <b style="color: black;font: bold;"></b>
<th class="columnHeader">${categ } </th>
</c:if>
</c:forEach>
<c:forEach items="${listOfAllServicesRevenue}" var="asr" varStatus="status">


<th class="columnHeader">100%</th>
<th class="columnHeader">Insurance Amount</th>
<th class="columnHeader">Third Party Amount on:<b>${thirdPartyRate}% </th>
<th class="columnHeader">Patient Amount</th>
</tr>
<!--
<c:forEach items="${listOfAllServicesRevenue}" var="asr" varStatus="status">
<th class="columnHeader">100%</th>
<th class="columnHeader">Insurance: <b>${asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate}%</b></th>
<th class="columnHeader">Third Party: <b>${thirdPartyRate }%</b></th>
<th class="columnHeader">Third Party: /b></th>
<th class="columnHeader">Patient: <b>${100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate}%</b></th>
</tr>
<c:set var="patientRate" value="${100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate}"/>
</c:forEach>

</c:forEach>
-->
<c:forEach items="${listOfAllServicesRevenue}" var="asr" varStatus="status">
<tr>
<td class="rowValue ${(status.count%2!=0)?'even':''}">${status.count}</td>
Expand All @@ -96,12 +106,17 @@ ${resultMsg} <b style="color: black;font: bold;"></b>
<td class="rowValue ${(status.count%2!=0)?'even':''}">${asr.consommation.beneficiary.patient.age}</td>
<td class="rowValue ${(status.count%2!=0)?'even':''}">${asr.consommation.beneficiary.patient.gender}</td>
<td class="rowValue ${(status.count%2!=0)?'even':''}">${asr.consommation.beneficiary.patient.personName}</td>
<td class="rowValue ${(status.count%2!=0)?'even':''}">${asr.consommation.beneficiary.insurancePolicy.insurance.name}</td>

<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate}"/></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate-thirdPartyRate }"/></td>

<c:forEach items="${asr.revenues }" var="revenue">
<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${revenue.dueAmount*100/patientRate}" type="number" pattern="#.##"/></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${revenue.dueAmount*thirdPartyRate/patientRate}" type="number" pattern="#.##"/></td>
<c:set var="patientRate" value="${100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate}"/>
</c:forEach>


<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${asr.allDueAmounts}" type="number" pattern="#.##"/></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${asr.allDueAmounts*asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate/100}" type="number" pattern="#.##"/></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><fmt:formatNumber value="${asr.allDueAmounts*thirdPartyRate/100}" type="number" pattern="#.##"/></td>
Expand All @@ -112,20 +127,20 @@ ${resultMsg} <b style="color: black;font: bold;"></b>
</c:forEach>
<tr>
<td><b style="color: blue;">TOTAL</b></td>
<td></td><td></td><td></td><td></td><td></td>
<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
<c:forEach items="${totals }" var="total">
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total}" type="number" pattern="#.##"/></b> </td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total*thirdPartyRate/100}" type="number" pattern="#.##"/></b> </td>
</c:forEach>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100}" type="number" pattern="#.##"/></b></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100*(100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate-thirdPartyRate)/100}" type="number" pattern="#.##"/></b></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="" type="number" pattern="#.##"/></b></td>
<!-- <td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100*(100-asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate-thirdPartyRate)/100}" type="number" pattern="#.##"/></b></td> -->
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100*thirdPartyRate/100}" type="number" pattern="#.##"/></b></td>
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100*asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate/100}" type="number" pattern="#.##"/></b></td>

<!-- <td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="${total100*asr.consommation.beneficiary.insurancePolicy.insurance.currentRate.rate/100}" type="number" pattern="#.##"/></b></td> -->
<td class="rowValue ${(status.count%2!=0)?'even':''}"><b style="color: blue;"><fmt:formatNumber value="" type="number" pattern="#.##"/></b></td>
</tr>

</table>
</div>
</c:if>


<%@ include file="/WEB-INF/template/footer.jsp"%>
9 changes: 6 additions & 3 deletions omod/src/main/webapp/mohBillingViewGlobalBill.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@

<c:if test="${!globalBill.closed}">
<div style="float: left;">
<a href="billing.form?insurancePolicyId=${insurancePolicy.insurancePolicyId}&ipCardNumber=${ipCardNumber}&globalBillId=${globalBillId}">Add Consommation | </a>

<a href="javascript:window.open('admission.form?globalBillId=${globalBill.globalBillId}&insurancePolicyId=${insurancePolicy.insurancePolicyId }&ipCardNumber=${insurancePolicy.insuranceCardNo}&discharge=true', 'dischargeWindow', 'height=300,width=450,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes').focus()">Dischage the Patient</a>
<openmrs:hasPrivilege privilege="Add Consommation">
<a href="billing.form?insurancePolicyId=${insurancePolicy.insurancePolicyId}&ipCardNumber=${ipCardNumber}&globalBillId=${globalBillId}">Add Consommation |</a>
</openmrs:hasPrivilege>
<openmrs:hasPrivilege privilege="Discharge Patient">
<a href="javascript:window.open('admission.form?globalBillId=${globalBill.globalBillId}&insurancePolicyId=${insurancePolicy.insurancePolicyId }&ipCardNumber=${insurancePolicy.insuranceCardNo}&discharge=true', 'dischargeWindow', 'height=300,width=450,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=yes').focus()">Discharge the Patient</a>
</openmrs:hasPrivilege>
</div>
</c:if>

Expand Down