Skip to content

Commit

Permalink
Merge pull request #6755 from hmislk/Issue#6612
Browse files Browse the repository at this point in the history
Issue#6612 Closes #6612
  • Loading branch information
DeshaniPubudu authored Aug 7, 2024
2 parents 7d64666 + 6c50434 commit f5be55c
Show file tree
Hide file tree
Showing 15 changed files with 617 additions and 384 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
1
2 changes: 1 addition & 1 deletion .github/last_date.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240807
20240807
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio

## Current Version



Current Version: 3.0.0.20240807.1 (This line will be automatically updated to reflect the latest version)



## History

In 2004, Dr. M H B Ariyaratne, a medical doctor, pioneered the development of an Electronic Medical Record (EMR) System tailored for his general practice. Utilising Microsoft Visual Basic 6 and MS-Access, this system caught the attention of fellow doctors, leading to widespread adoption. As its user base grew, so did its features, evolving through collaborative discussions and feedback.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public class CollectingCentreBillController implements Serializable, ControllerW
StaffBean staffBean;
@Inject
CategoryController categoryController;
@Inject
ConfigOptionApplicationController configOptionApplicationController;
/**
* Properties
*/
Expand Down Expand Up @@ -1089,14 +1091,15 @@ private boolean errorCheck() {
JsfUtil.addErrorMessage("Please select a collecting centre");
return true;
}
if (referralId == null || referralId.trim().equals("")) {
JsfUtil.addErrorMessage("Please enter a referrance number");
return true;
boolean collectingCentreBillingRequiresReferanceNumbers = configOptionApplicationController.getBooleanValueByKey("Collecting Centre Billing Requires Referance Numbers", true);
boolean collectingCentreBillingRequiresCreditBalanceManagement = configOptionApplicationController.getBooleanValueByKey("Collecting Centre Billing Requires Credit Balance Management", true);

if (collectingCentreBillingRequiresReferanceNumbers) {
if (referralId == null || referralId.trim().equals("")) {
JsfUtil.addErrorMessage("Please enter a referrance number");
return true;
}
}
// else if (collectingCenterReferranceNumberAlreadyUsed(collectingCentre)) {
// JsfUtil.addErrorMessage("Referral number alredy entered");
// return true;
// }

if (getLstBillEntries().isEmpty()) {
JsfUtil.addErrorMessage("Please Add tests before billing");
Expand All @@ -1110,31 +1113,25 @@ private boolean errorCheck() {
}
}

///not wanted
// if ((collectingCentre.getBallance() - Math.abs(feeTotalExceptCcfs)) < 0 - collectingCentre.getStandardCreditLimit()) {
// JsfUtil.addErrorMessage("This bill excees the Collecting Centre Limit");
// return true;
// }
double awailableBalance = Math.abs(collectingCentre.getBallance() + Math.abs(collectingCentre.getAllowedCredit()));

if (awailableBalance < Math.abs(feeTotalExceptCcfs)) {
JsfUtil.addErrorMessage("Collecting Centre Balance is Not Enough");
return true;
}
double awailableBalance = Math.abs(collectingCentre.getBallance() + Math.abs(collectingCentre.getAllowedCredit()));

// if (agentReferenceBookController.numberHasBeenIssuedToTheAgent(getReferralId())) {
// JsfUtil.addErrorMessage("Invaild Reference Number.");
// return true;
// }
if (agentReferenceBookController.agentReferenceNumberIsAlredyUsed(getReferralId(), collectingCentre, BillType.CollectingCentreBill, PaymentMethod.Agent)) {
JsfUtil.addErrorMessage("This Reference Number is alredy Used.");
setReferralId("");
return true;
if (collectingCentreBillingRequiresCreditBalanceManagement) {
if (awailableBalance < Math.abs(feeTotalExceptCcfs)) {
JsfUtil.addErrorMessage("Collecting Centre Balance is Not Enough");
return true;
}
}

if (!agentReferenceBookController.numberHasBeenIssuedToTheAgent(collectingCentre, getReferralId())) {
JsfUtil.addErrorMessage("This Reference Number is Blocked Or This channel Book is Not Issued.");
return true;
if (collectingCentreBillingRequiresReferanceNumbers) {
if (agentReferenceBookController.agentReferenceNumberIsAlredyUsed(getReferralId(), collectingCentre, BillType.CollectingCentreBill, PaymentMethod.Agent)) {
JsfUtil.addErrorMessage("This Reference Number is alredy Used.");
setReferralId("");
return true;
}
if (!agentReferenceBookController.numberHasBeenIssuedToTheAgent(collectingCentre, getReferralId())) {
JsfUtil.addErrorMessage("This Reference Number is Blocked Or This channel Book is Not Issued.");
return true;
}
}

return false;
Expand Down Expand Up @@ -1533,7 +1530,7 @@ public String navigateToCollectingCenterBillingromCollectingCenterBilling() {
setPatient(getPatient());
return "/collecting_centre/bill?faces-redirect=true";
}

public String navigateToCollectingCenterBillingfromBillPriview() {
prepareNewBillKeepingCollectingCenter();
fillAvailableAgentReferanceNumbers(collectingCentre);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public String navigateToCourierHandoverSamplesToLab() {
public String navigateToCourierViewReports() {
return "/collecting_centre/courier/viewReports.xhtml?faces-redirect=true";
}

public String navigateToCourierIndex() {
return "/collecting_centre/courier/index.xhtml?faces-redirect=true";
}

public String navigateToCourierPrintReports() {
return "/collecting_centre/courier/printReports.xhtml?faces-redirect=true";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -992,11 +992,11 @@ public void fillCollectingCentreCourierPatientInvestigations() {
temMap.put("dep", getReportKeyWord().getDepartment());

if(institution==null){
jpql += " b.collectingCentre in :ccs ";
jpql += " and b.collectingCentre in :ccs ";
temMap.put("ccs", sessionController.getLoggableCollectingCentres());
}else{
jpql += " b.collectingCentre=:cc ";
temMap.put("ccs", sessionController.getLoggableCollectingCentres());
jpql += " and b.collectingCentre=:cc ";
temMap.put("cc", sessionController.getLoggableCollectingCentres());
}

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/divudi/bean/common/SessionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
package com.divudi.bean.common;

import com.divudi.bean.channel.BookingController;
import com.divudi.bean.collectingCentre.CourierController;
import com.divudi.bean.pharmacy.PharmacySaleController;
import com.divudi.data.InstitutionType;
import com.divudi.data.Privileges;
Expand Down Expand Up @@ -123,6 +124,8 @@ public class SessionController implements Serializable, HttpSessionListener {
BookingController bookingController;
@Inject
ConfigOptionApplicationController configOptionApplicationController;
@Inject
CourierController courierController;
/**
* Properties
*/
Expand Down Expand Up @@ -1277,6 +1280,8 @@ public String navigateToLoginPageByUsersDefaultLoginPage() {
return opdTokenController.navigateToManageOpdTokensCalled();
case PHARMACY_TOKEN_DISPLAY:
return tokenController.navigateToManagePharmacyTokensCalled();
case COURIER_LANDING_PAGE:
return courierController.navigateToCourierIndex();
case HOME:
default:
return "/home?faces-redirect=true";
Expand Down
15 changes: 3 additions & 12 deletions src/main/java/com/divudi/data/LoginPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Enum representing various page types
*
* @author Dr M H B Ariyaratne <buddhika.ari at gmail.com>
* Author: Dr M H B Ariyaratne <buddhika.ari at gmail.com>
* Contribution by OpenAI's ChatGPT for additional labels and method implementation.
*/
public enum LoginPage {
Expand All @@ -12,24 +12,15 @@ public enum LoginPage {
CHANNELLING_TV_DISPLAY("Channelling TV Display"),
OPD_QUEUE_PAGE("OPD Queue Page"),
OPD_TOKEN_DISPLAY("OPD Token Display"),
PHARMACY_TOKEN_DISPLAY("Pharmacy Token Display");
PHARMACY_TOKEN_DISPLAY("Pharmacy Token Display"),
COURIER_LANDING_PAGE("Courier Landing Page");

private final String label;

/**
* Constructor for LoginPage enum to set the user-friendly label.
*
* @param label the user-friendly name of the page type
*/
LoginPage(String label) {
this.label = label;
}

/**
* Returns the user-friendly name of the page type.
*
* @return the label of the enum constant
*/
public String getLabel() {
return label;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.2" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">
<jta-data-source>jdbc/ruhunu</jta-data-source>
<jta-data-source>jdbc/sethma</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand All @@ -10,7 +10,7 @@
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/ruhunuAudit</jta-data-source>
<jta-data-source>jdbc/sethmaaudit</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0.20240807.1
3.0.0.20240807.1
2 changes: 1 addition & 1 deletion src/main/webapp/WEB-INF/glassfish-web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/coop</context-root>
<context-root>/ruhunuDemo</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
Expand Down
99 changes: 54 additions & 45 deletions src/main/webapp/collecting_centre/bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
action="#{collectingCentreBillController.settleBill}"
ajax="false"
onclick="if (!confirm('Are you sure you want to Settle This Bill ?'))
return false;"
return false;"
class="ui-button-success ">
</p:commandButton>
<p:commandButton
Expand Down Expand Up @@ -346,22 +346,28 @@


</f:facet>

<div class="row">
<div class="col-md-3">
<p:outputLabel value="Reference No" class="mr-4"></p:outputLabel>
</div>
<div class="col-md-9">
<p:selectOneMenu
filter="true"
filterMatchMode="contains"
value="#{collectingCentreBillController.referralId}"
class="w-100 mb-1">
<f:selectItem itemLabel="Select" itemValue="" /> <!-- Default empty selection -->
<f:selectItems value="#{collectingCentreBillController.referralIds}" var="refId"
itemLabel="#{refId}" itemValue="#{refId}" />
</p:selectOneMenu>

<h:panelGroup rendered="#{configOptionApplicationController.getBooleanValueByKey('Collecting Centre Billing Requires Referance Numbers', true)}" >
<div class="row">
<div class="col-md-3">
<p:outputLabel value="Reference No" class="mr-4"></p:outputLabel>
</div>
<div class="col-md-9">
<p:selectOneMenu
filter="true"
filterMatchMode="contains"
value="#{collectingCentreBillController.referralId}"
class="w-100 mb-1">
<f:selectItem itemLabel="Select" itemValue="" /> <!-- Default empty selection -->
<f:selectItems value="#{collectingCentreBillController.referralIds}" var="refId"
itemLabel="#{refId}" itemValue="#{refId}" />
</p:selectOneMenu>
</div>
</div>
</h:panelGroup>


<div class="row">
<div class="col-md-3">
<h:outputLabel id="ballance" value="Balance" class="my-1" />
</div>
Expand Down Expand Up @@ -395,35 +401,38 @@
</h:outputLabel>
</div>
</div>

<h:panelGrid columns="2" class="w-100 ">
<p:dataTable
class="mt-2"
emptyMessage="No Book"
id="tblAgentBooks"
value="#{collectingCentreBillController.bookSummeryRows}"
var="a"
styleClass="noBorder summeryBorder">
<p:column>
<f:facet name="header">
<p:outputLabel value="Book Number" />
</f:facet>
<p:outputLabel value="#{a.bookName}" >
<f:convertNumber pattern="00000" />
</p:outputLabel>
</p:column>

<p:column>
<f:facet name="header">
<p:outputLabel value="Number Of Leaves" />
</f:facet>
<p:outputLabel value="#{a.bookNumber}" >
</p:outputLabel>
</p:column>
</p:dataTable>
<h:panelGroup rendered="#{configOptionApplicationController.getBooleanValueByKey('Collecting Centre Billing Requires Referance Numbers', true)}" >

<h:panelGrid columns="2" class="w-100 ">
<p:dataTable
class="mt-2"
emptyMessage="No Book"
id="tblAgentBooks"
value="#{collectingCentreBillController.bookSummeryRows}"
var="a"
styleClass="noBorder summeryBorder">
<p:column>
<f:facet name="header">
<p:outputLabel value="Book Number" />
</f:facet>
<p:outputLabel value="#{a.bookName}" >
<f:convertNumber pattern="00000" />
</p:outputLabel>
</p:column>

</h:panelGrid>
<p:column>
<f:facet name="header">
<p:outputLabel value="Number Of Leaves" />
</f:facet>
<p:outputLabel value="#{a.bookNumber}" >
</p:outputLabel>
</p:column>
</p:dataTable>

</h:panelGrid>

</h:panelGroup>
</p:panel>


Expand Down Expand Up @@ -625,13 +634,13 @@
<bi:posCCBill_CC bill="#{pp}" duplicate="false"/>
</ui:repeat>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'FiveFivePaper'}" >
<ui:repeat value="#{collectingCentreBillController.bills}" var="pp">
<bi:fiveFiveCCBill_CC bill="#{pp}" duplicate="false"/>
</ui:repeat>
</h:panelGroup>

</h:panelGroup>

</p:panel>
Expand Down Expand Up @@ -659,7 +668,7 @@
<bi:posCCBill_Patient bill="#{pp}" duplicate="false"/>
</ui:repeat>
</h:panelGroup>

<h:panelGroup rendered="#{sessionController.departmentPreference.opdBillPaperType eq 'FiveFivePaper'}" >
<ui:repeat value="#{collectingCentreBillController.bills}" var="pp">
<bi:fiveFiveCCBill_Patient bill="#{pp}" duplicate="false"/>
Expand Down
Loading

0 comments on commit f5be55c

Please sign in to comment.