Skip to content

Commit

Permalink
Merge branch 'master' into Issue#6447
Browse files Browse the repository at this point in the history
  • Loading branch information
Pubudu-Piyankara authored Jul 21, 2024
2 parents 6628c62 + 30f8fd2 commit 3ee71a4
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3
5
2 changes: 1 addition & 1 deletion 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.20240721.3 (This line will be automatically updated to reflect the latest version)
Current Version: 3.0.0.20240721.5 (This line will be automatically updated to reflect the latest version)

## History

Expand Down
2 changes: 1 addition & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ That way multiple projects can share the same settings (useful for formatting ru
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>pfv5ee8</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<netbeans.compile.on.save>none</netbeans.compile.on.save>
<org-netbeans-modules-maven-j2ee.netbeans_2e_deploy_2e_on_2e_save>false</org-netbeans-modules-maven-j2ee.netbeans_2e_deploy_2e_on_2e_save>

</properties>
</project-shared-configuration>
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<version>3.0.0</version>
<packaging>war</packaging>
<name>sethma</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -307,7 +306,11 @@
<artifactId>reflections</artifactId>
<version>0.10.2</version>
</dependency>

<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>9.0.83</version> <!-- or the version compatible with your setup -->
</dependency>

</dependencies>

Expand Down
68 changes: 66 additions & 2 deletions src/main/java/com/divudi/bean/channel/BookingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public class BookingController implements Serializable, ControllerWithPatient {
SecurityController securityController;
@Inject
private CommonController commonController;
/**

* Properties
*/
private Speciality speciality;
Expand Down Expand Up @@ -556,7 +556,8 @@ public void markSessionInstanceAsStarted() {
JsfUtil.addErrorMessage("No session selected");
return;
}
if (!selectedSessionInstance.isArrived()) {

if(!selectedSessionInstance.isArrived()){
markAsArrived();
}
selectedSessionInstance.setStarted(true);
Expand Down Expand Up @@ -624,6 +625,69 @@ public void markSessionInstanceAsCompleted() {
JsfUtil.addSuccessMessage("Session Completed");
sendSmsOnChannelMissingChannelBookings();
}

public void sendChannellingStatusUpdateNotificationSms(BillSession methodBillSession) {
if (methodBillSession == null) {
JsfUtil.addErrorMessage("Nothing to send");
return;
}
if (methodBillSession.getSessionInstance() == null) {
JsfUtil.addErrorMessage("No Session");
return;
}
if (methodBillSession.getSessionInstance().getOriginatingSession() == null) {
JsfUtil.addErrorMessage("No Originating Session");
return;
}
if (methodBillSession.getBill() == null) {
JsfUtil.addErrorMessage("No Bill");
return;
}
if (methodBillSession.getBill().getPatient() == null) {
JsfUtil.addErrorMessage("No Bill");
return;
}

if (!methodBillSession.getBill().getPatient().getPerson().getSmsNumber().trim().equals("")) {
Sms e = new Sms();
e.setCreatedAt(new Date());
e.setCreater(sessionController.getLoggedUser());
e.setBill(methodBillSession.getBill());
e.setCreatedAt(new Date());
e.setSmsType(MessageType.ChannelStatusUpdate);
e.setCreater(sessionController.getLoggedUser());
e.setReceipientNumber(methodBillSession.getBill().getPatient().getPerson().getSmsNumber());
e.setSendingMessage(smsBody(methodBillSession));
e.setDepartment(getSessionController().getLoggedUser().getDepartment());
e.setInstitution(getSessionController().getLoggedUser().getInstitution());
e.setPending(false);
getSmsFacade().create(e);

Boolean sent = smsManager.sendSms(e);
e.setSentSuccessfully(sent);
getSmsFacade().edit(e);

}

JsfUtil.addSuccessMessage("SMS Sent");
}

public String smsBody(BillSession r) {
String securityKey = sessionController.getApplicationPreference().getEncrptionKey();
if (securityKey == null || securityKey.trim().equals("")) {
sessionController.getApplicationPreference().setEncrptionKey(securityController.generateRandomKey(10));
sessionController.savePreferences(sessionController.getApplicationPreference());
}
Calendar c = Calendar.getInstance();
c.add(Calendar.DATE, 2);
String temId = securityController.encryptAlphanumeric(r.getId().toString(), securityKey);
String url = commonController.getBaseUrl() + "faces/requests/cbss.xhtml?id=" + temId;
String b = "Your session of "
+ r.getSessionInstance().getOriginatingSession().getName()
+ " Started. "
+ url;
return b;
}

public void sendChannellingStatusUpdateNotificationSms(BillSession methodBillSession) {
if (methodBillSession == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si)
bs.setReferenceBillSession(newBillSession);
getBillSessionFacade().edit(bs);
newBillSessionForSMS = newBillSession;

System.out.println("newBillSessionForSMS = " + newBillSessionForSMS);
printingBill.setSingleBillSession(newBillSession);
billFacade.edit(printingBill);
Expand Down Expand Up @@ -602,6 +603,7 @@ private BillItem createSessionItemForReshedule(Bill bill) {
return bi;
}


public void fillSessionInstanceByDoctor() {
sessionInstanceByDoctor = new ArrayList<>();
Date currentDate = new Date();
Expand Down Expand Up @@ -1325,7 +1327,8 @@ public void markSessionInstanceAsStarted() {
JsfUtil.addErrorMessage("No session selected");
return;
}
if (!selectedSessionInstance.isArrived()) {

if(!selectedSessionInstance.isArrived()){
markAsArrived();
}
selectedSessionInstance.setStarted(true);
Expand Down Expand Up @@ -1946,6 +1949,15 @@ public String navigateToNurseView() {
return "";
}
}

public String navigateToNurseViewWithItems() {
if (preSet()) {
getChannelReportController().fillNurseView();
return "/channel/channel_views/channel_nurse_view_with_items?faces-redirect=true";
} else {
return "";
}
}

public String navigateToNurseViewWithItems() {
if (preSet()) {
Expand Down Expand Up @@ -3064,10 +3076,10 @@ public void addChannelBooking(boolean reservedBooking) {
int maxNo = selectedSessionInstance.getMaxNo();
long bookedPatientCount = selectedSessionInstance.getBookedPatientCount();
long totalPatientCount;

List<Integer> reservedNumbers = CommonFunctions.convertStringToIntegerList(selectedSessionInstance.getReserveNumbers());
bookedPatientCount = bookedPatientCount + reservedNumbers.size();

if (selectedSessionInstance.getCancelPatientCount() != null) {
long canceledPatientCount = selectedSessionInstance.getCancelPatientCount();
totalPatientCount = bookedPatientCount - canceledPatientCount;
Expand Down Expand Up @@ -3109,13 +3121,20 @@ public void addChannelBooking(boolean reservedBooking) {
createPayment(printingBill, paymentMethod);
}
sendSmsAfterBooking();
if (selectedSessionInstance.isStarted()) {

if(selectedSessionInstance.isStarted()){
sendChannellingStatusUpdateNotificationSms(printingBill.getSingleBillSession());
}
settleSucessFully = true;
printPreview = true;
JsfUtil.addSuccessMessage("Channel Booking Added.");
}

public long totalReservedNumberCount(SessionInstance s){
List<Integer> reservedNumbers = CommonFunctions.convertStringToIntegerList(s.getReserveNumbers());
long reservedNumberCount = reservedNumbers.size();
return reservedNumberCount;
}

public long totalReservedNumberCount(SessionInstance s) {
List<Integer> reservedNumbers = CommonFunctions.convertStringToIntegerList(s.getReserveNumbers());
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/com/divudi/bean/common/OpdTokenController.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,10 @@ public void fillOpdTokens() {
String j = "Select t "
+ " from Token t"
+ " where t.department=:dep"
+ " and t.tokenDate=:date "
+ " and t.tokenType=:ty"
+ " and t.completed=:com";
Map m = new HashMap();
m.put("dep", sessionController.getDepartment());
m.put("date", new Date());
m.put("ty", TokenType.OPD_TOKEN);
m.put("com", false);
if (counter != null) {
Expand Down Expand Up @@ -358,15 +356,13 @@ public void fillOpdTokensCalled() {
String j = "Select t "
+ " from Token t"
+ " where t.department=:dep"
+ " and t.tokenDate=:date "
+ " and t.called=:cal "
+ " and t.tokenType=:ty"
+ " and t.inProgress=:prog "
+ " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed
m.put("dep", sessionController.getDepartment());
m.put("date", new Date());
m.put("cal", true); // Tokens that are called
m.put("prog", false); // Tokens that are not in progress
m.put("prog", true); // Tokens that are not in progress
m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called
m.put("com", false); // Tokens that are not completed
j += " order by t.id";
Expand Down
15 changes: 5 additions & 10 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<?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 version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.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"/>
<property name="javax.persistence.schema-generation.database.action" value="create-or-extend-tables"/>
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/arogyaAudit</jta-data-source>
<class>com.divudi.entity.AuditEvent</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<jta-data-source>jdbc/ruhunuDemoAudit</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>
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.20240721.3
3.0.0.20240721.5
6 changes: 3 additions & 3 deletions src/main/webapp/cashier/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<h:body>
<ui:composition template="/resources/template/template.xhtml">
<ui:define name="content">
<h:form>

<div class="row" >
<div class="col-2">
<h:form>
<p:panel header="Financial Transaction Manager" rendered="true">
<div class="d-grid gap-2">
<p:commandButton
Expand Down Expand Up @@ -87,14 +88,13 @@

</div>
</p:panel>

</h:form>
</div>
<div class="col-10" >
<ui:insert name="subcontent" >
</ui:insert>
</div>
</div>
</h:form>
</ui:define>
</ui:composition>
</h:body>
Expand Down
40 changes: 22 additions & 18 deletions src/main/webapp/channel/channel_queue.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,28 @@

</div>
<p:spacer height="65px" />

<div class=" m-2">
<div class="shadow-lg">
<p:inputText id="txtFilter" class="w-100" style="padding-left:20px;height: 55px" value="#{bookingController.sessionInstanceFilter}" placeholder="Search">
<p:ajax event="keyup" process="@this" update="tblSi" listener="#{bookingController.filterSessionInstances}">
</p:ajax>
</p:inputText>
</div>
</div>

<h:panelGroup id="tblSi">
<ui:repeat var="s"
id="tblSessions"
value="#{bookingController.sortedSessionInstances}"
class="w-100 mt-5">

<div class="bgCard row w-100 p-2 shadow mt-1">
<div class="col-3 bg-light text-white d-flex align-items-center">
<ui:repeat var="s"
id="tblSessions"
value="#{bookingController.sortedSessionInstances}"
class="w-100 mt-5">

<div class="bgCard row w-100 p-2 shadow mt-1">
<div class="col-3 bg-primary text-white d-flex align-items-center">
<div class="px-4">
<h:outputText style="font-size: 30pt" styleClass="far fa-clock"/>
</div>
<div class="p-1 px-2">
<h:outputText value="#{s.name}" style="font-weight: bold;font-size: 10pt"/><br/>
<h:outputText value="#{s.sessionDate}" style="font-size: 8pt;">
<f:convertDateTime pattern="#{sessionController.applicationPreference.shortDateFormat}" />
</h:outputText>
<h:outputText class="mx-2" value="#{s.startingTime}" style="font-weight: bold; font-size: 8pt;">
<f:convertDateTime pattern="#{sessionController.applicationPreference.shortTimeFormat}"/>
</h:outputText>
</div>
</div>
<div class="col-3 bg-dark">
<div class="d-flex align-items-center text-white p-2">
<div class="px-4">
<h:outputText style="font-size: 30pt;color: black" styleClass="far fa-clock"/>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/channel/patient_portal.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@

</div>
</nav>
<!-- <p:staticMessage severity="error" summary="ERROR" detail="This function is currently unavailable due to maintenance. Please refrain from using it until further notice." style="width: 100%; font-size: 2em;"/>-->

<p:staticMessage severity="error" summary="ERROR" detail="This function is currently unavailable due to maintenance. Please refrain from using it until further notice." style="width: 100%; font-size: 2em;"/>

</div>
<div>
<h:panelGroup rendered="#{patientPortalController.patient.id ne null}" class="h-100 container" >
Expand Down

0 comments on commit 3ee71a4

Please sign in to comment.