Skip to content

Commit

Permalink
Merge pull request #6478 from hmislk/Issue#6477
Browse files Browse the repository at this point in the history
Issue#6477 Closes #6477
  • Loading branch information
Deshani Pubudu authored Jul 21, 2024
2 parents 17dbe28 + a9da443 commit 0f39047
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 85 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio

Current Version: 3.0.0.20240721.9 (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
128 changes: 63 additions & 65 deletions src/main/java/com/divudi/bean/channel/BookingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ public class BookingController implements Serializable, ControllerWithPatient {
@Inject
private CommonController commonController;

* Properties
*/
private Speciality speciality;
private Staff staff;
private Staff toStaff;
Expand Down Expand Up @@ -688,69 +686,69 @@ public String smsBody(BillSession r) {
+ url;
return b;
}

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) {
// 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 String navigateToAddBooking() {
if (staff == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1959,15 +1959,6 @@ public String navigateToNurseViewWithItems() {
}
}

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

public String navigateToDoctorView() {
if (preSet()) {
getChannelReportController().fillDoctorView();
Expand Down Expand Up @@ -3136,11 +3127,6 @@ public long totalReservedNumberCount(SessionInstance s){
return reservedNumberCount;
}

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

public BillSession addChannelBookingForOnlinePayment() {
errorText = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.divudi.facade.ConfigOptionFacade;
import javax.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -55,10 +56,16 @@ public void init() {

private void initializeDenominations() {
String denominationsStr = getLongTextValueByKey("Currency Denominations");
denominations = Arrays.stream(denominationsStr.split(","))
.map(Integer::parseInt)
.map(value -> new Denomination(value, 0))
.collect(Collectors.toList());
if (denominationsStr != null && !denominationsStr.trim().isEmpty()) {
denominations = Arrays.stream(denominationsStr.split(","))
.map(String::trim) // Trim any extra spaces
.filter(s -> !s.isEmpty()) // Filter out empty strings
.map(Integer::parseInt)
.map(value -> new Denomination(value, 0))
.collect(Collectors.toList());
} else {
denominations = new ArrayList<>(); // Initialize to an empty list if the string is null or empty
}
}

public List<Integer> getCurrencyDenominations() {
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<jta-data-source>jdbc/demo</jta-data-source>

<jta-data-source>jdbc/sethma</jta-data-source>

<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<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/demoaudit</jta-data-source>
<jta-data-source>jdbc/sethmaAudit</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
</properties>
Expand Down

0 comments on commit 0f39047

Please sign in to comment.