Skip to content

Commit

Permalink
Merge pull request #6809 from hmislk/Issue#407
Browse files Browse the repository at this point in the history
Issue#407 Closes #407
  • Loading branch information
Irani96 authored Aug 9, 2024
2 parents e3b5a93 + 2830d9c commit 47bed61
Show file tree
Hide file tree
Showing 23 changed files with 150 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
26
14
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio

## Current Version

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

## History

Expand Down Expand Up @@ -73,7 +73,7 @@ The features available to different roles of the users are stated in detail in t
* Dr M H B Ariyaratne - Initiated the Project, Product owner, System Architect, Lead Developer since 2004 to date

## Project Management
* Mr.K.M.G.T.R. Waidyarathne - Recruitment Management from 2013 to 2022, Project Management from 2022 to 2024
* Mr.K.M.G.T.R. Waidyarathne - Project Management from 2013 to date

## Business Analyst
* Miss Binuthi Nilakna Ariyaratne - From 2024 to date
Expand Down
6 changes: 4 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>
<artifactId>newDemo</artifactId>


<artifactId>ruhunu-dev</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>newDemo</name>
<name>ruhunu-dev</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/com/divudi/bean/common/OpdPreBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ public String settleBill() {
}

b.setBillItems(list);
b.setIpOpOrCc("OP");

getBillFacade().edit(b);
getBillBean().calculateBillItems(b, getLstBillEntries());
Expand All @@ -822,24 +823,24 @@ public String settleBill() {
saveBillItemSessions();
JsfUtil.addSuccessMessage("Bill Saved");
checkBillValues();

if (getToken() != null) {
if (getToken().getBill() == null) {
getToken().setBill(batchBill);
tokenFacade.edit(getToken());
markToken(batchBill);
}else{
Token t=new Token();
} else {
Token t = new Token();
t.setPatient(getToken().getPatient());
t.setBill(batchBill);
t.setTokenNumber(getToken().getTokenNumber());
tokenFacade.create(t);
getToken().setReferaToken(t);
tokenFacade.edit(t);
}
}

}

printPreview = true;

return "/opd/opd_pre_bill?faces-redirect=true";
Expand Down Expand Up @@ -956,6 +957,7 @@ private void saveBatchBill() {

newlyCreatingBatchBillPre.setNetTotal(tmpBatchBillTotalOfNetTotals);
newlyCreatingBatchBillPre.setDiscount(tmpBatchBillTotalOfDiscounts);
newlyCreatingBatchBillPre.setIpOpOrCc("OP");
newlyCreatingBatchBillPre.setTotal(tmpBatchBillTotalOfGrossTotals);
getBillFacade().edit(newlyCreatingBatchBillPre);

Expand Down Expand Up @@ -1013,15 +1015,14 @@ private PreBill saveBill(Department bt, PreBill updatingPreBill) {
updatingPreBill.setReferredByInstitution(referredByInstitution);
//updatingPreBill.setCreditCompany(creditCompany);
updatingPreBill.setComments(comment);

updatingPreBill.setIpOpOrCc("OP");
//getBillBean().setPaymentMethodData(updatingPreBill, paymentMethod, getPaymentMethodData());

updatingPreBill.setBillDate(new Date());
updatingPreBill.setBillTime(new Date());
updatingPreBill.setPatient(getPatient());

// updatingPreBill.setMembershipScheme(membershipSchemeController.fetchPatientMembershipScheme(getPatient(), getSessionController().getApplicationPreference().isMembershipExpires()));

//updatingPreBill.setPaymentScheme(getPaymentScheme());
//updatingPreBill.setPaymentMethod(paymentMethod);
updatingPreBill.setCreatedAt(new Date());
Expand Down Expand Up @@ -1138,7 +1139,6 @@ private boolean errorCheck() {
// JsfUtil.addErrorMessage("Select Payment Method.");
// return true;
// }

// if (getPaymentSchemeController().errorCheckPaymentMethod(paymentMethod, getPaymentMethodData())) {
// return true;
// }
Expand All @@ -1162,7 +1162,6 @@ private boolean errorCheck() {
// JsfUtil.addErrorMessage("Check Payment method");
// return true;
// }

return false;
}

Expand Down Expand Up @@ -1386,7 +1385,7 @@ public void calTotals() {
double billDiscount = 0.0;
double billGross = 0.0;
double billNet = 0.0;

for (BillEntry be : getLstBillEntries()) {
//////// // System.out.println("bill item entry");
double entryGross = 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ public String navigateToPatientDepositRefund() {
createNewPatientDepositRefund();
return "/payments/patient/send?faces-redirect=true;";
}

public String navigateToPatientDepositRefundFromOPDBill(Patient patient) {
current = patient;
bill = new Bill();
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,7 @@ public void fillCollectingCentreCourierPatientInvestigations() {
+ " join pi.billItem.bill b "
+ " join b.patient.person p "
+ " where "
+ " b.createdAt between :fromDate and :toDate "
+ " and pi.investigation.department=:dep ";
+ " b.createdAt between :fromDate and :toDate ";

Map temMap = new HashMap();
temMap.put("toDate", getToDate());
Expand All @@ -1028,7 +1027,7 @@ public void fillCollectingCentreCourierPatientInvestigations() {
temMap.put("ccs", sessionController.getLoggableCollectingCentres());
} else {
jpql += " and b.collectingCentre=:cc ";
temMap.put("cc", sessionController.getLoggableCollectingCentres());
temMap.put("cc", institution);
}

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/divudi/bean/emr/DataUploadController.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.divudi.bean.common.DoctorController;
import com.divudi.bean.common.DoctorSpecialityController;
import com.divudi.bean.common.EnumController;
import com.divudi.bean.common.FeeController;
import com.divudi.bean.common.InstitutionController;
import com.divudi.bean.common.ItemController;
import com.divudi.bean.common.ItemFeeController;
Expand Down Expand Up @@ -53,6 +54,7 @@
import com.divudi.entity.Consultant;
import com.divudi.entity.Department;
import com.divudi.entity.DoctorSpeciality;
import com.divudi.entity.Fee;
import com.divudi.entity.Institution;
import com.divudi.entity.Item;
import com.divudi.entity.ItemFee;
Expand Down Expand Up @@ -83,7 +85,9 @@
import com.divudi.data.SymanticType;
import com.divudi.entity.Doctor;
import com.divudi.entity.inward.InwardService;
import com.divudi.facade.FeeFacade;
import com.divudi.java.CommonFunctions;
import com.mysql.cj.jdbc.interceptors.SessionAssociationInterceptor;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;

import javax.inject.Named;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/divudi/bean/opd/OpdBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,7 @@ private boolean executeSettleBillActions() {
}
newSingleBill.setBillItems(list);
newSingleBill.setBillTotal(newSingleBill.getNetTotal());
newSingleBill.setIpOpOrCc("OP");
getBillFacade().edit(newSingleBill);
getBillBean().calculateBillItems(newSingleBill, getLstBillEntries());
if (getSessionController().getApplicationPreference().isPartialPaymentOfOpdBillsAllowed()) {
Expand Down Expand Up @@ -1995,6 +1996,7 @@ private void saveBatchBill() {
newBatchBill.setFromInstitution(sessionController.getInstitution());
newBatchBill.setFromDepartment(sessionController.getDepartment());
newBatchBill.setPatient(patient);
newBatchBill.setIpOpOrCc("OP");
newBatchBill.setInsId(
getBillNumberGenerator().institutionBillNumberGenerator(
getSessionController().getInstitution(),
Expand Down Expand Up @@ -2096,7 +2098,9 @@ private Bill saveBill(Department bt, Bill newBill) {

newBill.setCreditCompany(creditCompany);
newBill.setCollectingCentre(collectingCentre);
newBill.setIpOpOrCc("OP");
newBill.setComments(comment);


getBillBean().setPaymentMethodData(newBill, paymentMethod, getPaymentMethodData());

Expand Down Expand Up @@ -2178,6 +2182,7 @@ private Bill saveBill(Department bt, Category cat, Bill newBill) {
newBill.setCreditCompany(creditCompany);
newBill.setCollectingCentre(collectingCentre);
newBill.setComments(comment);
newBill.setIpOpOrCc("OP");

getBillBean().setPaymentMethodData(newBill, paymentMethod, getPaymentMethodData());

Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/divudi/bean/store/StoreAdjustmentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,40 @@ public void setStk(List<Stock> stk) {
}


// public void fillSelectStock() {
// List<Stock> items = new ArrayList<>();
// if (stock == null) {
// stk = items;
// return;
// }
// String sql;
// Map<String, Object> m = new HashMap<>();
//
// sql = "select i "
// + " from Stock i "
// + " where i.department=:d "
// + " and i.itemBatch.item.code=:stationary "
// + " order by i.stock desc";
//
// m.put("d", sessionController.getDepartment());
// m.put("stationary", stock.getItemBatch().getItem().getCode()); // Assuming stk contains the item
//
// items = getStockFacade().findByJpql(sql, m);
//
// if (items != null) {
// stk = items;
// }
// }
//
// public List<Stock> getStk() {
// return stk;
// }
//
// public void setStk(List<Stock> stk) {
// this.stk = stk;
// }


// public void fillSelectStock(){
// List<Stock> items = new ArrayList<>();
//
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/divudi/entity/Bill.java
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,7 @@ public void copy(Bill bill) {
vat = bill.getVat();
vatPlusNetTotal = bill.getVatPlusNetTotal();
sessionId = bill.getSessionId();
ipOpOrCc=bill.getIpOpOrCc();
// referenceBill=bill.getReferenceBill();
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/divudi/ws/common/ApplicationConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(com.divudi.ws.inward.ApiInward.class);
resources.add(com.divudi.ws.lims.Lims.class);
resources.add(com.divudi.ws.lims.LimsMiddlewareController.class);
resources.add(com.divudi.ws.lims.MiddlewareController.class);

}

}
48 changes: 48 additions & 0 deletions src/main/java/com/divudi/ws/lims/MiddlewareController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.divudi.ws.lims;

import com.divudi.bean.common.ConfigOptionApplicationController;
import javax.inject.Inject;
import javax.json.Json;
import javax.json.JsonObject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/middleware")
public class MiddlewareController {

@Inject
ConfigOptionApplicationController configOptionApplicationController;

@GET
@Produces(MediaType.TEXT_PLAIN)
public Response checkService() {
return Response.ok("Middleware service is working").build();
}

@GET
@Path("/test")
@Produces(MediaType.TEXT_PLAIN)
public Response checkServiceTest() {
return Response.ok("Middleware service is working").build();
}

@GET
@Path("/pullSampleData")
@Produces(MediaType.APPLICATION_JSON)
public Response pullSampleData() {
String jsonInput = configOptionApplicationController.getLongTextValueByKey("Test Json");

// Check if the retrieved JSON string is not null or empty
if (jsonInput == null || jsonInput.trim().isEmpty()) {
return Response.status(Response.Status.NO_CONTENT).build();
}

// Return the retrieved JSON string
return Response.ok(jsonInput).build();
}

// Add your additional middleware-related methods here
}
8 changes: 4 additions & 4 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?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">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/arogya</jta-data-source>
<jta-data-source>jdbc/ruhunuDemo</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
<property name="eclipselink.logging.parameters" value="false"/>
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/arogyaAudit</jta-data-source>
<jta-data-source>jdbc/ruhunuDemoAudit</jta-data-source>
<class>com.divudi.entity.AuditEvent</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
<property name="eclipselink.logging.parameters" value="false"/>
</properties>
</persistence-unit>
</persistence>
</persistence>

3 changes: 2 additions & 1 deletion src/main/resources/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
3.0.0.20240807.26
3.0.0.20240807.14

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>/sethma</context-root>
<context-root>/ruhuna-dev</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html">
Expand All @@ -11,7 +10,7 @@
<h:panelGroup rendered="#{!webUserController.hasPrivilege('CourierCollectSamples')}" >
You are NOT Authorized to view Collect Samples Page
</h:panelGroup>
<h:panelGroup rendered="#{!webUserController.hasPrivilege('CourierCollectSamples')}" >
<h:panelGroup rendered="#{webUserController.hasPrivilege('CourierCollectSamples')}" >
<div class="container">
<h1><i class="fa fa-box"></i> Collect Samples</h1>
<p>Dummy content for Collect Samples page.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html">
Expand Down
Loading

0 comments on commit 47bed61

Please sign in to comment.