Skip to content

Commit

Permalink
Merge pull request #6616 from hmislk/Issue#6575
Browse files Browse the repository at this point in the history
Issue#6575 Closes #6575
  • Loading branch information
DeshaniPubudu authored Jul 27, 2024
2 parents 7e839dc + 8f4d6f7 commit 267e0dd
Show file tree
Hide file tree
Showing 12 changed files with 740 additions and 159 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 @@
20240727
20240727
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.20240727.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
17 changes: 17 additions & 0 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public class EnumController implements Serializable {
List<PaymentMethod> paymentMethodsForOpdBilling;
List<PaymentMethod> paymentMethodsForChanneling;
List<PaymentMethod> paymentMethodsForPharmacyBilling;

List<PaymentMethod> paymentMethodsForPatientDeposit;

SessionNumberType[] sessionNumberTypes;

@PostConstruct
Expand Down Expand Up @@ -808,4 +810,19 @@ public void setPaymentScheme(PaymentScheme paymentScheme) {
this.paymentScheme = paymentScheme;
}

public List<PaymentMethod> getPaymentMethodsForPatientDeposit() {
paymentMethodsForPatientDeposit = new ArrayList<>();
for (PaymentMethod pm : PaymentMethod.values()) {
boolean include = configOptionApplicationController.getBooleanValueByKey(pm.getLabel() + " is available for Patient Deposit", true);
if (include) {
paymentMethodsForPatientDeposit.add(pm);
}
}
return paymentMethodsForPatientDeposit;
}

public void setPaymentMethodsForPatientDeposit(List<PaymentMethod> paymentMethodsForPatientDeposit) {
this.paymentMethodsForPatientDeposit = paymentMethodsForPatientDeposit;
}

}
36 changes: 19 additions & 17 deletions src/main/java/com/divudi/bean/common/PatientController.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public void downloadAllPatients() {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=Patients.xlsx");

try ( ServletOutputStream outputStream = response.getOutputStream()) {
try (ServletOutputStream outputStream = response.getOutputStream()) {
workbook.write(outputStream);
} catch (IOException e) {
e.printStackTrace();
Expand Down Expand Up @@ -571,7 +571,7 @@ public void downloadPatientsPhoneNumbers() {
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=PatientPhoneNumbers.xlsx");

try ( ServletOutputStream outputStream = response.getOutputStream()) {
try (ServletOutputStream outputStream = response.getOutputStream()) {
workbook.write(outputStream);
} catch (IOException e) {
e.printStackTrace();
Expand Down Expand Up @@ -1047,7 +1047,6 @@ public void createPatientInvestigationsTableAllByLoggedInstitution() {
temMap.put("ins", getSessionController().getInstitution());
sql += " order by pi.approveAt desc ";

//System.err.println("Sql " + sql);
// patientInvestigations = getPatientInvestigationFacade().findByJpql(sql, temMap, TemporalType.TIMESTAMP);
// patientInvestigations=
}
Expand Down Expand Up @@ -1563,6 +1562,7 @@ public void quickSearchPatientLongPhoneNumber(ControllerWithPatient controller)
Long searchedPhoneNumber = CommonFunctions.removeSpecialCharsInPhonenumber(quickSearchPhoneNumber);
m.put("pp", searchedPhoneNumber);
quickSearchPatientList = getFacade().findByJpql(j, m);
opdBillController.setPaymentMethod(null);
if (quickSearchPatientList == null) {
JsfUtil.addErrorMessage("No Patient found !");
controller.setPatient(null);
Expand All @@ -1581,6 +1581,14 @@ public void quickSearchPatientLongPhoneNumber(ControllerWithPatient controller)
patientSearched = quickSearchPatientList.get(0);
controller.setPatient(patientSearched);
controller.setPatientDetailsEditable(false);
opdBillController.setPaymentMethod(null);
if (controller.getPatient().getHasAnAccount() != null) {
if (patientSearched.getHasAnAccount() && configOptionApplicationController.getBooleanValueByKey("Automatically set the PatientDeposit payment Method if a Deposit is Available", false)) {
opdBillController.setPaymentMethod(PaymentMethod.PatientDeposit);
opdBillController.listnerForPaymentMethodChange();
}
}

quickSearchPatientList = null;
} else {
controller.setPatient(null);
Expand Down Expand Up @@ -1608,6 +1616,14 @@ public void selectQuickOneFromQuickSearchPatient(ControllerWithPatient controlle
controller.setPatient(current);
admissionController.fillCurrentPatientAllergies(current);
controller.setPatientDetailsEditable(false);
opdBillController.setPaymentMethod(null);
if (controller.getPatient().getHasAnAccount() != null) {
if (controller.getPatient().getHasAnAccount() && configOptionApplicationController.getBooleanValueByKey("Automatically set the PatientDeposit payment Method if a Deposit is Available", false)) {
opdBillController.setPaymentMethod(PaymentMethod.PatientDeposit);
opdBillController.listnerForPaymentMethodChange();
}
}

quickSearchPatientList = null;
}

Expand Down Expand Up @@ -2042,22 +2058,18 @@ public void createPatientBarcode() {
// return str;

} catch (Exception ex) {
// ////System.out.println("ex = " + ex.getMessage());
}
} else {
// ////System.out.println("else = ");
try {
Barcode bc = BarcodeFactory.createCode128A("0000");
bc.setBarHeight(5);
bc.setBarWidth(3);
bc.setDrawingText(true);
BarcodeImageHandler.saveJPEG(bc, barcodeFile);
// ////System.out.println("12");
InputStream targetStream = new FileInputStream(barcodeFile);
StreamedContent str = DefaultStreamedContent.builder().contentType("image/jpeg").name(barcodeFile.getName()).stream(() -> targetStream).build();
barcode = str;
} catch (Exception ex) {
// ////System.out.println("ex = " + ex.getMessage());
}
}
}
Expand Down Expand Up @@ -2155,15 +2167,13 @@ public void dobChangeListen() {
}

public StreamedContent getPhoto(Patient p) {
//////System.out.println("p is " + p);
FacesContext context = FacesContext.getCurrentInstance();
if (context.getRenderResponse()) {
return new DefaultStreamedContent();
} else if (p == null) {
return new DefaultStreamedContent();
} else {
if (p.getId() != null && p.getBaImage() != null) {
//////System.out.println("giving image");
InputStream targetStream = new ByteArrayInputStream(p.getBaImage());
StreamedContent str = DefaultStreamedContent.builder().contentType(p.getFileType()).name(p.getFileName()).stream(() -> targetStream).build();
return str;
Expand Down Expand Up @@ -2306,7 +2316,6 @@ public List<Patient> completePatient(String query) {
+ " or (p.person.mobile) like :q "
+ " order by p.person.name";
hm.put("q", "%" + query.toUpperCase() + "%");
//////System.out.println(sql);
suggestions = getFacade().findByJpql(sql, hm, 20);
}
return suggestions;
Expand Down Expand Up @@ -2782,11 +2791,6 @@ public String getCountPatientCode(String s) {
String st = "";
if (p != null) {
String str = p.getCode();
// //System.out.println("str.substring(0,1) = " + str.substring(0, 1));
// //System.out.println("str.substring(0,2) = " + str.substring(0, 2));
// //System.out.println("str.substring(2) = " + str.substring(2));
// //System.out.println("str.substring(3) = " + str.substring(3));
// //System.out.println("str.substring(3,7) = " + str.substring(3, 7));
long l = Long.parseLong(str.substring(2));
l++;
st += s;
Expand Down Expand Up @@ -3691,13 +3695,11 @@ public Object getAsObject(FacesContext facesContext, UIComponent component, Stri
}
PatientController controller = (PatientController) facesContext.getApplication().getELResolver().
getValue(facesContext.getELContext(), null, "patientController");
//////System.out.println("value at converter getAsObject is " + value);
return controller.getEjbFacade().find(getKey(value));
}

java.lang.Long getKey(String value) {
java.lang.Long key;
//////System.out.println(value);
if (value == null || value.equals("null") || value.trim().equals("")) {
key = 0l;
} else {
Expand Down
Loading

0 comments on commit 267e0dd

Please sign in to comment.