From 67194f00d06c210445d3d8404ea2a641094b0c0d Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sat, 10 Aug 2024 11:45:29 +0530 Subject: [PATCH 01/17] Signed-off-by: buddhika75 --- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 8947aba09c..b2d581def0 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /coop + /ruhunu From 185c628669337a6a11443369922c3307ff37d95b Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sat, 10 Aug 2024 23:17:25 +0530 Subject: [PATCH 02/17] Signed-off-by: buddhika75 --- pom.xml | 4 ++-- src/main/resources/META-INF/persistence.xml | 6 +++--- .../webapp/admin/lims/investigation_format.xhtml | 12 ++---------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 002cc75f62..212ec6f69f 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.divudi - demo + ruhunu 3.0.0 war - demo + ruhunu ${project.build.directory}/endorsed diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 0899ba70eb..b7234ee98d 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,7 +1,6 @@ - + - org.eclipse.persistence.jpa.PersistenceProvider jdbc/ruhunu false @@ -13,7 +12,7 @@ - jdbc/ruhunuaudit + jdbc/ruhunuAudit false @@ -22,3 +21,4 @@ + diff --git a/src/main/webapp/admin/lims/investigation_format.xhtml b/src/main/webapp/admin/lims/investigation_format.xhtml index 5b061b5931..138d145c4d 100644 --- a/src/main/webapp/admin/lims/investigation_format.xhtml +++ b/src/main/webapp/admin/lims/investigation_format.xhtml @@ -346,16 +346,8 @@ required="true" value="#{investigationItemController.current.ixItemType}"> - - - - - - - - - - + + From 482d351368d1ee03be3c7a2c0ffaadcb5ea9b293 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sat, 10 Aug 2024 23:20:13 +0530 Subject: [PATCH 03/17] Signed-off-by: buddhika75 --- .../java/com/divudi/entity/lab/PatientSample.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/com/divudi/entity/lab/PatientSample.java b/src/main/java/com/divudi/entity/lab/PatientSample.java index 3875ab6e93..1cc2f20c0a 100644 --- a/src/main/java/com/divudi/entity/lab/PatientSample.java +++ b/src/main/java/com/divudi/entity/lab/PatientSample.java @@ -36,6 +36,7 @@ public class PatientSample implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; + private Long sampleId; @ManyToOne private Patient patient; @ManyToOne @@ -154,6 +155,9 @@ public class PatientSample implements Serializable { private Date retiredAt; private String retireComments; + + + public Long getId() { return id; } @@ -162,6 +166,9 @@ public void setId(Long id) { this.id = id; } + + + public String getIdStr() { String formatted = id + ""; return formatted; @@ -650,4 +657,12 @@ public void setStatus(PatientInvestigationStatus status) { this.status = status; } + public Long getSampleId() { + return sampleId; + } + + public void setSampleId(Long sampleId) { + this.sampleId = sampleId; + } + } From 4e8e29bd28aa21618ce6388479ad7fc155ce57be Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sat, 10 Aug 2024 23:35:38 +0530 Subject: [PATCH 04/17] Signed-off-by: buddhika75 --- .../admin/institutions/admin_mange_application_options.xhtml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml b/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml index 97e2bc3362..6f801f6d22 100644 --- a/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml +++ b/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml @@ -21,6 +21,7 @@ Date: Sun, 11 Aug 2024 00:38:00 +0530 Subject: [PATCH 05/17] Signed-off-by: buddhika75 --- pom.xml | 6 +++--- src/main/resources/META-INF/persistence.xml | 15 ++++++++++----- .../admin_mange_application_options.xhtml | 1 - src/main/webapp/lab/generate_barcode_p.xhtml | 3 ++- .../webapp/lab/generate_barcodes_for_lab.xhtml | 4 ---- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 97c098afdb..1491a87a44 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.divudi - ruhunu + ruhunu-dev 3.0.0 war - ruhunu + ruhunu-dev ${project.build.directory}/endorsed @@ -200,7 +200,7 @@ org.primefaces primefaces - 13.0.10 + 14.0.3 jar diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index b7234ee98d..a548dd6d98 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,24 +1,29 @@ + org.eclipse.persistence.jpa.PersistenceProvider jdbc/ruhunu false + + + - + + + - jdbc/ruhunuAudit - false + jdbc/ruhunuaudit + com.divudi.entity.AuditEvent + true - - diff --git a/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml b/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml index 7a00c60487..05aab6edd5 100644 --- a/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml +++ b/src/main/webapp/admin/institutions/admin_mange_application_options.xhtml @@ -22,7 +22,6 @@ rowKey="#{option.id}" value="#{configOptionController.options}" id="optionsTable" paginator="true" rows="10" - rowKey="#{option.id}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15" selection="#{configOptionController.option}" diff --git a/src/main/webapp/lab/generate_barcode_p.xhtml b/src/main/webapp/lab/generate_barcode_p.xhtml index aec34d9013..8867e26ced 100644 --- a/src/main/webapp/lab/generate_barcode_p.xhtml +++ b/src/main/webapp/lab/generate_barcode_p.xhtml @@ -195,13 +195,14 @@ paginator="true" rowKey="#{smpIx.id}" paginatorPosition="bottom" + selectionMode="multiple" selection="#{patientInvestigationController.selectedItems}" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,25,50" > - + diff --git a/src/main/webapp/lab/generate_barcodes_for_lab.xhtml b/src/main/webapp/lab/generate_barcodes_for_lab.xhtml index 31729ee468..fcf5db35f0 100644 --- a/src/main/webapp/lab/generate_barcodes_for_lab.xhtml +++ b/src/main/webapp/lab/generate_barcodes_for_lab.xhtml @@ -1,8 +1,4 @@ - Date: Sat, 10 Aug 2024 19:41:02 -0700 Subject: [PATCH 06/17] Signed-off-by: Dr M H B Ariyaratne --- pom.xml | 4 +- .../channel/BookingControllerViewScope.java | 13 ++ .../ChannelReportTemplateController.java | 124 +++++++++++++++++- src/main/resources/META-INF/persistence.xml | 4 +- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- .../reports/daily_session_counts.xhtml | 39 +++--- .../webapp/channel/session_instance.xhtml | 15 ++- 7 files changed, 177 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index aef39a0217..2ebc5d3d40 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.divudi - demo + sethma 3.0.0 war - demo + sethma ${project.build.directory}/endorsed diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java index f9c9083075..ead3095f92 100644 --- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java +++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java @@ -339,6 +339,8 @@ public class BookingControllerViewScope implements Serializable, ControllerWithP private boolean listCompleted; private boolean listAll; private boolean sessionInstanceStartedEdited; + + boolean billingStarted=false; public void sessionReschedule() { if (getSelectedSessionInstanceForRechedule() == null) { @@ -3087,15 +3089,25 @@ private boolean paymentMethodErrorPresent() { } public void addNormalChannelBooking() { + if(billingStarted){ + return; + } + billingStarted=true; if (selectedSessionInstance == null) { JsfUtil.addErrorMessage("Please select a Session"); + billingStarted=false; return; } addChannelBooking(false); fillBillSessions(); + billingStarted=false; } public void addReservedChannelBooking() { + if(billingStarted){ + return; + } + billingStarted=true; if (selectedSessionInstance == null) { JsfUtil.addErrorMessage("Please select a Session Instance"); return; @@ -3103,6 +3115,7 @@ public void addReservedChannelBooking() { boolean reservedBooking = true; addChannelBooking(reservedBooking); fillBillSessions(); + billingStarted=false; } public void addChannelBooking(boolean reservedBooking) { diff --git a/src/main/java/com/divudi/bean/channel/ChannelReportTemplateController.java b/src/main/java/com/divudi/bean/channel/ChannelReportTemplateController.java index 30c0499e50..de2641879c 100644 --- a/src/main/java/com/divudi/bean/channel/ChannelReportTemplateController.java +++ b/src/main/java/com/divudi/bean/channel/ChannelReportTemplateController.java @@ -56,6 +56,7 @@ import com.divudi.facade.BillSessionFacade; import com.divudi.facade.DepartmentFacade; import com.divudi.facade.ServiceSessionFacade; +import com.divudi.facade.SessionInstanceFacade; import com.divudi.facade.StaffFacade; import com.divudi.facade.WebUserFacade; import com.divudi.java.CommonFunctions; @@ -87,6 +88,7 @@ public class ChannelReportTemplateController implements Serializable { private double repayTotalFee; private double taxTotal; private double total; + private List sessionInstances; /////// private List billSessions; private List billSessionsBilled; @@ -195,6 +197,9 @@ public class ChannelReportTemplateController implements Serializable { @EJB ArrivalRecordFacade arrivalRecordFacade; + @EJB + SessionInstanceFacade sessionInstanceFacade; + public void clearAll() { billedBills = new ArrayList<>(); cancelBills = new ArrayList<>(); @@ -605,6 +610,115 @@ public void fillDailySessionCounts() { } + public void fillBillSessions(SessionInstance sessionInstance) { + BillType[] billTypes = { + BillType.ChannelAgent, + BillType.ChannelCash, + BillType.ChannelOnCall, + BillType.ChannelStaff, + BillType.ChannelCredit, + BillType.ChannelResheduleWithPayment, + BillType.ChannelResheduleWithOutPayment + }; + List bts = Arrays.asList(billTypes); + String sql = "Select bs " + + " From BillSession bs " + + " where bs.retired=false" + + " and bs.bill.billType in :bts" + + " and type(bs.bill)=:class " + + " and bs.sessionInstance=:ss " + + " order by bs.serialNo "; + HashMap hh = new HashMap<>(); + hh.put("bts", bts); + hh.put("class", BilledBill.class); + hh.put("ss", sessionInstance); + billSessions = getBillSessionFacade().findByJpql(sql, hh, TemporalType.DATE); + + // Initialize counts + long bookedPatientCount = 0; + long paidPatientCount = 0; + long completedPatientCount = 0; + long cancelPatientCount = 0; + long refundedPatientCount = 0; + long onCallPatientCount = 0; + long reservedBookingCount = 0; + + if (billSessions == null || billSessions.isEmpty()) { + sessionInstance.setBookedPatientCount(0L); + sessionInstance.setPaidPatientCount(0L); + sessionInstance.setCompletedPatientCount(0L); + sessionInstance.setRemainingPatientCount(0L); + sessionInstanceFacade.edit(sessionInstance); + return; + } + + // Loop through billSessions to calculate counts + for (BillSession bs : billSessions) { + if (bs == null) { + continue; + } + + bookedPatientCount++; // Always increment if bs is not null + + if (Boolean.TRUE.equals(bs.isReservedBooking())) { + reservedBookingCount++; + } + + if (Boolean.TRUE.equals(bs.isCompleted())) { + completedPatientCount++; + } + + if (bs.getPaidBillSession() != null) { + paidPatientCount++; + } + + if (bs.getBill() != null) { + if (Boolean.TRUE.equals(bs.getBill().isCancelled())) { + cancelPatientCount++; + } + + if (Boolean.TRUE.equals(bs.getBill().isRefunded())) { + refundedPatientCount++; + } + + if (bs.getPaidBillSession() == null && !Boolean.TRUE.equals(bs.getBill().isCancelled())) { + onCallPatientCount++; + } + } + } + + // Set calculated counts to sessionInstance + sessionInstance.setBookedPatientCount(bookedPatientCount); + sessionInstance.setPaidPatientCount(paidPatientCount); + sessionInstance.setCompletedPatientCount(completedPatientCount); + sessionInstance.setCancelPatientCount(cancelPatientCount); + sessionInstance.setRefundedPatientCount(refundedPatientCount); + sessionInstance.setOnCallPatientCount(onCallPatientCount); + sessionInstance.setReservedBookingCount(reservedBookingCount); + + // Assuming remainingPatientCount is calculated as booked - completed + sessionInstance.setRemainingPatientCount(bookedPatientCount - completedPatientCount); + sessionInstanceFacade.edit(sessionInstance); + } + + public void processAndfillDailySessionCounts() { + String j; + Map m = new HashMap(); + rows = new ArrayList<>(); + j = "select si " + + " from SessionInstance si " + + " where si.retired=false " + + " and si.sessionDate between :fd and :td "; + if (institution != null) { + m.put("ins", institution); + j += " and si.institution=:ins "; + } + sessionInstances = sessionInstanceFacade.findByJpql(j, m); + for (SessionInstance si : sessionInstances) { + fillBillSessions(si); + } + } + public void fillCategorySessionCounts() { bundle = new ReportTemplateRowBundle(); String j; @@ -6007,6 +6121,14 @@ public void setCategories(List categories) { this.categories = categories; } + public List getSessionInstances() { + return sessionInstances; + } + + public void setSessionInstances(List sessionInstances) { + this.sessionInstances = sessionInstances; + } + public class DocPage { List table1; @@ -7523,6 +7645,4 @@ public void setDoctorDayChannelCounts(List doctorDayChann this.doctorDayChannelCounts = doctorDayChannelCounts; } - - } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 0899ba70eb..c246433d95 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,7 +2,7 @@ org.eclipse.persistence.jpa.PersistenceProvider - jdbc/ruhunu + jdbc/sethma false @@ -13,7 +13,7 @@ - jdbc/ruhunuaudit + jdbc/sethmaaudit false diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 9841584308..2ef047d83a 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /ruhunuDemo + /sethma diff --git a/src/main/webapp/channel/reports/daily_session_counts.xhtml b/src/main/webapp/channel/reports/daily_session_counts.xhtml index 213b989c9d..1b8ed51419 100644 --- a/src/main/webapp/channel/reports/daily_session_counts.xhtml +++ b/src/main/webapp/channel/reports/daily_session_counts.xhtml @@ -43,10 +43,17 @@ + + + - + @@ -100,50 +107,50 @@ - + - + r - + - + - + - + - + - + - + @@ -152,7 +159,7 @@ - + @@ -161,7 +168,7 @@ - + @@ -170,7 +177,7 @@ - + diff --git a/src/main/webapp/channel/session_instance.xhtml b/src/main/webapp/channel/session_instance.xhtml index 1ed4e61417..e2cf1bf06d 100644 --- a/src/main/webapp/channel/session_instance.xhtml +++ b/src/main/webapp/channel/session_instance.xhtml @@ -136,8 +136,21 @@ - + + + + + + + + + + + + + +
From 5fdbe2497a241e4ca4b374957851b2321e2cf412 Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 08:17:10 +0530 Subject: [PATCH 07/17] Signed-off-by: Dr M H B Ariyaratne --- pom.xml | 4 ++-- src/main/resources/META-INF/persistence.xml | 4 ++-- src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 1491a87a44..bfc3a0055a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.divudi - ruhunu-dev + horizon 3.0.0 war - ruhunu-dev + horizon ${project.build.directory}/endorsed diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index c246433d95..313d59aacd 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,7 +2,7 @@ org.eclipse.persistence.jpa.PersistenceProvider - jdbc/sethma + jdbc/horizon false @@ -13,7 +13,7 @@ - jdbc/sethmaaudit + jdbc/horizonAudit false diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 2ef047d83a..4871460e69 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /sethma + /horizon From 61c4b1c1b22cbbede78a3a0a1bb7a0d19ecc069f Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 10:25:25 +0530 Subject: [PATCH 08/17] Signed-off-by: Dr M H B Ariyaratne --- src/main/resources/META-INF/persistence.xml | 303 ++++++++++++++++-- .../webapp/resources/sql/PatientSample.sql | 59 ++++ 2 files changed, 340 insertions(+), 22 deletions(-) create mode 100644 src/main/webapp/resources/sql/PatientSample.sql diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 313d59aacd..10cc695d37 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,24 +1,283 @@ - - - org.eclipse.persistence.jpa.PersistenceProvider - jdbc/horizon - false - - - - - - - - - - jdbc/horizonAudit - false - - - - - - + + + org.eclipse.persistence.jpa.PersistenceProvider + jdbc/horizon + com.divudi.entity.lab.PatientSample + com.divudi.entity.lab.PatientSampleComponant + com.divudi.entity.lab.ReportFormat + com.divudi.entity.lab.ReportItem + com.divudi.bean.common.FormItemValue + com.divudi.bean.pharmacy.DosageForm + com.divudi.bean.pharmacy.RouteOfAdministration + com.divudi.data.clinical.PersonRelationship + com.divudi.entity.AgentHistory + com.divudi.entity.ApiKey + com.divudi.entity.AppEmail + com.divudi.entity.Appointment + com.divudi.entity.Area + com.divudi.entity.AuditEvent + com.divudi.entity.Bill + com.divudi.entity.BillComponent + com.divudi.entity.BillEntry + com.divudi.entity.BillExpense + com.divudi.entity.BillFee + com.divudi.entity.BillFeePayment + com.divudi.entity.BillItem + com.divudi.entity.BillNumber + com.divudi.entity.BillSession + com.divudi.entity.BilledBill + com.divudi.entity.CancelledBill + com.divudi.entity.CashierItem + com.divudi.entity.Category + com.divudi.entity.CategoryItem + com.divudi.entity.Channeling + com.divudi.entity.ConfigOption + com.divudi.entity.Consultant + com.divudi.entity.Department + com.divudi.entity.Doctor + com.divudi.entity.DoctorSpeciality + com.divudi.entity.EncounterCreditCompany + com.divudi.entity.Family + com.divudi.entity.FamilyMember + com.divudi.entity.Fee + com.divudi.entity.FeeChange + com.divudi.entity.Form + com.divudi.entity.FormFormat + com.divudi.entity.Institution + com.divudi.entity.InventoryCategory + com.divudi.entity.IssueRateMargins + com.divudi.entity.Item + com.divudi.entity.ItemFee + com.divudi.entity.ItemMapping + com.divudi.entity.ItemPackage + com.divudi.entity.ItemsCategories + com.divudi.entity.Logins + com.divudi.entity.Mapping + com.divudi.entity.MedicalPackage + com.divudi.entity.MedicalPackageFee + com.divudi.entity.MedicalPackageItem + com.divudi.entity.MetadataCategory + com.divudi.entity.MetadataSuperCategory + com.divudi.entity.Nationality + com.divudi.entity.Notification + com.divudi.entity.OpdVisit + com.divudi.entity.PackageFee + com.divudi.entity.PackageItem + com.divudi.entity.Packege + com.divudi.entity.Patient + com.divudi.entity.PatientEncounter + com.divudi.entity.PatientFlag + com.divudi.entity.PatientItem + com.divudi.entity.Payment + com.divudi.entity.PaymentGatewayTransaction + com.divudi.entity.PaymentScheme + com.divudi.entity.Person + com.divudi.entity.PersonInstitution + com.divudi.entity.PreBill + com.divudi.entity.PriceMatrix + com.divudi.entity.RefundBill + com.divudi.entity.Relation + com.divudi.entity.Religion + com.divudi.entity.ReportTemplate + com.divudi.entity.Route + com.divudi.entity.Service + com.divudi.entity.ServiceCategory + com.divudi.entity.ServiceSession + com.divudi.entity.ServiceSessionInstance + com.divudi.entity.ServiceSessionLeave + com.divudi.entity.ServiceSubCategory + com.divudi.entity.SessionNumberGenerator + com.divudi.entity.Sex + com.divudi.entity.Sms + com.divudi.entity.Speciality + com.divudi.entity.Staff + com.divudi.entity.Token + com.divudi.entity.TriggerSubscription + com.divudi.entity.Upload + com.divudi.entity.UserIcon + com.divudi.entity.UserNotification + com.divudi.entity.UserPreference + com.divudi.entity.Vocabulary + com.divudi.entity.WebContent + com.divudi.entity.WebLanguage + com.divudi.entity.WebTheme + com.divudi.entity.WebUser + com.divudi.entity.WebUserDashboard + com.divudi.entity.WebUserDepartment + com.divudi.entity.WebUserPaymentScheme + com.divudi.entity.WebUserPrivilege + com.divudi.entity.WebUserRole + com.divudi.entity.WebUserRolePrivilege + com.divudi.entity.WebUserRoleUser + com.divudi.entity.WebUserRoute + com.divudi.entity.cashTransaction.CashTransaction + com.divudi.entity.cashTransaction.CashTransactionHistory + com.divudi.entity.cashTransaction.Drawer + com.divudi.entity.channel.AgentReferenceBook + com.divudi.entity.channel.AgentsFees + com.divudi.entity.channel.AppointmentActivity + com.divudi.entity.channel.ArrivalRecord + com.divudi.entity.channel.DoctorInstitution + com.divudi.entity.channel.PatientSessionInstanceActivity + com.divudi.entity.channel.SessionFee + com.divudi.entity.channel.SessionInstance + com.divudi.entity.channel.SessionInstanceActivity + com.divudi.entity.clinical.ClinicalEntity + com.divudi.entity.clinical.ClinicalFindingItem + com.divudi.entity.clinical.ClinicalFindingValue + com.divudi.entity.clinical.DocumentTemplate + com.divudi.entity.clinical.ItemUsage + com.divudi.entity.clinical.Prescription + com.divudi.entity.clinical.PrescriptionTemplate + com.divudi.entity.forms.ComponentAsignment + com.divudi.entity.hr.AdditionalForm + com.divudi.entity.hr.AmendmentForm + com.divudi.entity.hr.BankAccount + com.divudi.entity.hr.BasicSalary + com.divudi.entity.hr.Designation + com.divudi.entity.hr.FingerPrintRecord + com.divudi.entity.hr.FingerPrintRecordHistory + com.divudi.entity.hr.Grade + com.divudi.entity.hr.HrForm + com.divudi.entity.hr.HrmVariables + com.divudi.entity.hr.LeaveForm + com.divudi.entity.hr.LeaveFormSystem + com.divudi.entity.hr.Loan + com.divudi.entity.hr.PayeeTaxRange + com.divudi.entity.hr.PaysheetComponent + com.divudi.entity.hr.PhDate + com.divudi.entity.hr.Roster + com.divudi.entity.hr.SalaryCycle + com.divudi.entity.hr.SalaryHold + com.divudi.entity.hr.Shift + com.divudi.entity.hr.ShiftAmendment + com.divudi.entity.hr.ShiftPreference + com.divudi.entity.hr.StaffBasics + com.divudi.entity.hr.StaffCategory + com.divudi.entity.hr.StaffDesignation + com.divudi.entity.hr.StaffEmployeeStatus + com.divudi.entity.hr.StaffEmployment + com.divudi.entity.hr.StaffGrade + com.divudi.entity.hr.StaffLeave + com.divudi.entity.hr.StaffLeaveEntitle + com.divudi.entity.hr.StaffLeaveSystem + com.divudi.entity.hr.StaffPaysheetComponent + com.divudi.entity.hr.StaffSalary + com.divudi.entity.hr.StaffSalaryComponant + com.divudi.entity.hr.StaffShift + com.divudi.entity.hr.StaffShiftAmendment + com.divudi.entity.hr.StaffShiftExtra + com.divudi.entity.hr.StaffShiftHistory + com.divudi.entity.hr.StaffShiftReplace + com.divudi.entity.hr.StaffStaffCategory + com.divudi.entity.hr.StaffWorkDay + com.divudi.entity.hr.StaffWorkingDepartment + com.divudi.entity.hr.TransferForm + com.divudi.entity.hr.WorkingTime + com.divudi.entity.inward.Admission + com.divudi.entity.inward.AdmissionType + com.divudi.entity.inward.EncounterComponent + com.divudi.entity.inward.GuardianRoom + com.divudi.entity.inward.InwardFee + com.divudi.entity.inward.InwardPriceAdjustment + com.divudi.entity.inward.InwardService + com.divudi.entity.inward.PatientRoom + com.divudi.entity.inward.Room + com.divudi.entity.inward.RoomCategory + com.divudi.entity.inward.RoomFacilityCharge + com.divudi.entity.inward.TheatreService + com.divudi.entity.inward.TimedItem + com.divudi.entity.inward.TimedItemCategory + com.divudi.entity.inward.TimedItemFee + com.divudi.entity.lab.AnalyzerMessage + com.divudi.entity.lab.Antibiotic + com.divudi.entity.lab.CommonReportItem + com.divudi.entity.lab.DepartmentMachine + com.divudi.entity.lab.Investigation + com.divudi.entity.lab.InvestigationCategory + com.divudi.entity.lab.InvestigationComponent + com.divudi.entity.lab.InvestigationItem + com.divudi.entity.lab.InvestigationItemValue + com.divudi.entity.lab.InvestigationItemValueCategory + com.divudi.entity.lab.InvestigationItemValueFlag + com.divudi.entity.lab.InvestigationItemValueForCategory + com.divudi.entity.lab.InvestigationReportItemValue + com.divudi.entity.lab.InvestigationTube + com.divudi.entity.lab.InvestigationValidaterComponent + com.divudi.entity.lab.InvestigationValidator + com.divudi.entity.lab.ItemForItem + com.divudi.entity.lab.IxCal + com.divudi.entity.lab.Lab + com.divudi.entity.lab.LabVisit + com.divudi.entity.lab.Machine + com.divudi.entity.lab.PatientInvestigation + com.divudi.entity.lab.PatientReport + com.divudi.entity.lab.PatientReportItemValue + com.divudi.entity.lab.Sample + com.divudi.entity.lab.TestFlag + com.divudi.entity.lab.WorksheetFormat + com.divudi.entity.lab.WorksheetItem + com.divudi.entity.membership.AllowedPaymentMethod + com.divudi.entity.membership.ChannellingMemberShipDiscount + com.divudi.entity.membership.InwardMemberShipDiscount + com.divudi.entity.membership.MembershipScheme + com.divudi.entity.membership.OpdMemberShipDiscount + com.divudi.entity.membership.PaymentSchemeDiscount + com.divudi.entity.membership.PharmacyMemberShipDiscount + com.divudi.entity.pharmacy.AdjustmentBillItem + com.divudi.entity.pharmacy.AdjustmentCategory + com.divudi.entity.pharmacy.Amp + com.divudi.entity.pharmacy.Ampp + com.divudi.entity.pharmacy.AssetCategory + com.divudi.entity.pharmacy.Atm + com.divudi.entity.pharmacy.ConsumableCategory + com.divudi.entity.pharmacy.DiscardCategory + com.divudi.entity.pharmacy.FrequencyUnit + com.divudi.entity.pharmacy.ItemBatch + com.divudi.entity.pharmacy.ItemsDistributors + com.divudi.entity.pharmacy.Make + com.divudi.entity.pharmacy.MeasurementUnit + com.divudi.entity.pharmacy.PharmaceuticalBillItem + com.divudi.entity.pharmacy.PharmaceuticalCategory + com.divudi.entity.pharmacy.PharmaceuticalItem + com.divudi.entity.pharmacy.PharmaceuticalItemCategory + com.divudi.entity.pharmacy.PharmaceuticalItemType + com.divudi.entity.pharmacy.Price + com.divudi.entity.pharmacy.PurchasePrice + com.divudi.entity.pharmacy.Reorder + com.divudi.entity.pharmacy.RetailSalePrice + com.divudi.entity.pharmacy.Stock + com.divudi.entity.pharmacy.StockHistory + com.divudi.entity.pharmacy.StockVarientBillItem + com.divudi.entity.pharmacy.StoreItemCategory + com.divudi.entity.pharmacy.UserStock + com.divudi.entity.pharmacy.UserStockContainer + com.divudi.entity.pharmacy.VirtualProductIngredient + com.divudi.entity.pharmacy.Vmp + com.divudi.entity.pharmacy.Vmpp + com.divudi.entity.pharmacy.Vtm + com.divudi.entity.pharmacy.WholeSalePrice + com.divudi.entity.web.CaptureComponent + com.divudi.entity.web.DesignComponent + com.divudi.entity.web.TemplateComponent + com.divudi.entity.web.WebTemplate + true + + + + + + + + + + jdbc/HorizonAudit + false + + + + + + diff --git a/src/main/webapp/resources/sql/PatientSample.sql b/src/main/webapp/resources/sql/PatientSample.sql new file mode 100644 index 0000000000..9358dfb030 --- /dev/null +++ b/src/main/webapp/resources/sql/PatientSample.sql @@ -0,0 +1,59 @@ +ALTER TABLE PatientSample ADD COLUMN id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY; +ALTER TABLE PatientSample ADD COLUMN sampleId BIGINT; +ALTER TABLE PatientSample ADD COLUMN patient_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN patientInvestigation_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN bill_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN creater_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN createdAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN barcodeGenerated BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN barcodeGenerator_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN barcodeGeneratedAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN barcodeGeneratedDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN barcodeGeneratedInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleCollected BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN sampleCollecter_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleCollectedAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN sampleCollectedOutside BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN sampleCollectionComments VARCHAR(255); +ALTER TABLE PatientSample ADD COLUMN sampleCollectedDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleCollectedInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN readyTosentToAnalyzer BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN sampleRequestType VARCHAR(255); +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzer BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzerBy_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzerAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzerComments TEXT; +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzerDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sentToAnalyzerInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzer BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzerBy_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzerAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzerComments TEXT; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzerDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN receivedFromAnalyzerInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN duplicatedFrom_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN duplicatedTo_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN divertedFrom_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN divertedTo_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN investigationComponant_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN test_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN tube_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN machine_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sample_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleReceivedAtLab BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN sampleReceiverAtLab_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleReceivedAtLabDate TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN sampleReceivedAtLabComments VARCHAR(255); +ALTER TABLE PatientSample ADD COLUMN sampleReceivedAtLabDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN sampleReceivedAtLabInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN status VARCHAR(255); +ALTER TABLE PatientSample ADD COLUMN cancelled BOOLEAN DEFAULT FALSE; +ALTER TABLE PatientSample ADD COLUMN cancelledUser_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN cancelledAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN cancellComments VARCHAR(255); +ALTER TABLE PatientSample ADD COLUMN cancellDepartment_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN cancellInstitution_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN retired BOOLEAN; +ALTER TABLE PatientSample ADD COLUMN retirer_id BIGINT; +ALTER TABLE PatientSample ADD COLUMN retiredAt TIMESTAMP; +ALTER TABLE PatientSample ADD COLUMN retireComments VARCHAR(255); From 4b664a539c223a1f4253f98c269a348d94a2b3fa Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Sun, 11 Aug 2024 15:13:45 +0530 Subject: [PATCH 09/17] Signed-off-by: buddhika75 --- .../lab/PatientInvestigationController.java | 38 +++++------ .../com/divudi/entity/lab/PatientSample.java | 67 +++++++++++++++++-- 2 files changed, 77 insertions(+), 28 deletions(-) diff --git a/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java b/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java index d123c5481e..c4cbd67f81 100644 --- a/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java +++ b/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java @@ -1529,22 +1529,16 @@ public void searchPatientSamples() { params.put("td", getToDate()); break; case REPORT_AUTHORIZED: - jpql += " AND i.approveAt BETWEEN :fd AND :td "; - params.put("fd", getFromDate()); - params.put("td", getToDate()); break; case REPORT_PRINTED: - jpql += " AND i.printingAt BETWEEN :fd AND :td "; - params.put("fd", getFromDate()); - params.put("td", getToDate()); break; case SAMPLE_ACCEPTED_DATE: - jpql += " AND i.sampleAcceptedAt BETWEEN :fd AND :td "; + jpql += " AND ps.sampleReceivedAtLabDate BETWEEN :fd AND :td "; params.put("fd", getFromDate()); params.put("td", getToDate()); break; case SAMPLE_COLLECTED_DATE: - jpql += " AND i.sampleCollectedAt BETWEEN :fd AND :td "; + jpql += " AND ps.sampleCollectedAt BETWEEN :fd AND :td "; params.put("fd", getFromDate()); params.put("td", getToDate()); break; @@ -1558,6 +1552,7 @@ public void searchPatientSamples() { params.put("fd", getFromDate()); params.put("td", getToDate()); break; + } if (orderedInstitution != null) { @@ -1571,12 +1566,12 @@ public void searchPatientSamples() { } if (peformingInstitution != null) { - jpql += " AND i.performInstitution = :peformingInstitution "; + jpql += " AND ps.institution = :peformingInstitution "; params.put("peformingInstitution", getPeformingInstitution()); } if (peformingDepartment != null) { - jpql += " AND i.performDepartment = :peformingDepartment "; + jpql += " AND ps.department = :peformingDepartment "; params.put("peformingDepartment", getPeformingDepartment()); } @@ -1596,51 +1591,48 @@ public void searchPatientSamples() { } if (specimen != null) { - jpql += " AND i.investigation.sample = :specimen "; + jpql += " AND i.sample = :specimen "; params.put("specimen", getSpecimen()); } if (patientName != null && !patientName.trim().isEmpty()) { - jpql += " AND i.billItem.bill.patient.person.name LIKE :patientName "; + jpql += " AND b.patient.person.name LIKE :patientName "; params.put("patientName", "%" + getPatientName().trim() + "%"); } if (type != null && !type.trim().isEmpty()) { - jpql += " AND i.billItem.bill.ipOpOrCC = :type "; + jpql += " AND b.ipOpOrCC = :type "; params.put("type", getType().trim()); } if (externalDoctor != null && !externalDoctor.trim().isEmpty()) { - jpql += " AND i.billItem.bill.referredByName = :externalDoctor "; + jpql += " AND b.referredByName = :externalDoctor "; params.put("externalDoctor", getExternalDoctor().trim()); } if (equipment != null) { - jpql += " AND i.investigation.machine = :equipment "; - params.put("equipment", getEquipment()); + } if (referringDoctor != null) { - jpql += " AND i.billItem.bill.referringDoctor = :referringDoctor "; + jpql += " AND b.referringDoctor = :referringDoctor "; params.put("referringDoctor", getReferringDoctor()); } if (investigation != null) { - jpql += " AND i.investigation = :investigation "; - params.put("investigation", getInvestigation()); + } if (department != null) { - jpql += " AND i.billItem.bill.toDepartment = :department "; + jpql += " AND ps.department = :department "; params.put("department", getDepartment()); } if (patientInvestigationStatus != null) { - jpql += " AND i.status = :patientInvestigationStatus "; - params.put("patientInvestigationStatus", getPatientInvestigationStatus()); + } - jpql += " ORDER BY i.id DESC"; + jpql += " ORDER BY ps.id DESC"; params.put("ret", false); diff --git a/src/main/java/com/divudi/entity/lab/PatientSample.java b/src/main/java/com/divudi/entity/lab/PatientSample.java index 1cc2f20c0a..026f5383a5 100644 --- a/src/main/java/com/divudi/entity/lab/PatientSample.java +++ b/src/main/java/com/divudi/entity/lab/PatientSample.java @@ -37,6 +37,13 @@ public class PatientSample implements Serializable { @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private Long sampleId; + + @ManyToOne + private Institution institution; + @ManyToOne + private Department department; + + @ManyToOne private Patient patient; @ManyToOne @@ -70,6 +77,14 @@ public class PatientSample implements Serializable { private Department sampleCollectedDepartment; @ManyToOne private Institution sampleCollectedInstitution; + //Sample Received at Lab + //Sample Sent to Lab + private Boolean sampleSent = false; + @ManyToOne + private WebUser sampleSentBy; + @Temporal(javax.persistence.TemporalType.TIMESTAMP) + private Date sampleSentAt; + //Sent To Analyzer private Boolean readyTosentToAnalyzer; @Enumerated(EnumType.STRING) @@ -124,7 +139,7 @@ public class PatientSample implements Serializable { private WebUser sampleReceiverAtLab; @Temporal(javax.persistence.TemporalType.TIMESTAMP) - private Date sampleReceivedAtLabDate; + private Date sampleReceivedAtLabAt; private String sampleReceivedAtLabComments; @@ -360,6 +375,8 @@ public Institution getCancellInstitution() { public void setCancellInstitution(Institution cancellInstitution) { this.cancellInstitution = cancellInstitution; } + + public Bill getBill() { return bill; @@ -617,12 +634,12 @@ public void setSampleReceiverAtLab(WebUser sampleReceiverAtLab) { this.sampleReceiverAtLab = sampleReceiverAtLab; } - public Date getSampleReceivedAtLabDate() { - return sampleReceivedAtLabDate; + public Date getSampleReceivedAtLabAt() { + return sampleReceivedAtLabAt; } - public void setSampleReceivedAtLabDate(Date sampleReceivedAtLabDate) { - this.sampleReceivedAtLabDate = sampleReceivedAtLabDate; + public void setSampleReceivedAtLabAt(Date sampleReceivedAtLabAt) { + this.sampleReceivedAtLabAt = sampleReceivedAtLabAt; } public String getSampleReceivedAtLabComments() { @@ -665,4 +682,44 @@ public void setSampleId(Long sampleId) { this.sampleId = sampleId; } + public Boolean getSampleSent() { + return sampleSent; + } + + public void setSampleSent(Boolean sampleSent) { + this.sampleSent = sampleSent; + } + + public WebUser getSampleSentBy() { + return sampleSentBy; + } + + public void setSampleSentBy(WebUser sampleSentBy) { + this.sampleSentBy = sampleSentBy; + } + + public Date getSampleSentAt() { + return sampleSentAt; + } + + public void setSampleSentAt(Date sampleSentAt) { + this.sampleSentAt = sampleSentAt; + } + + public Institution getInstitution() { + return institution; + } + + public void setInstitution(Institution institution) { + this.institution = institution; + } + + public Department getDepartment() { + return department; + } + + public void setDepartment(Department department) { + this.department = department; + } + } From dd96a6e95ef1828faedb1ff06af3b78f27d38d11 Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 15:39:09 +0530 Subject: [PATCH 10/17] Signed-off-by: Dr M H B Ariyaratne --- src/main/resources/META-INF/persistence.xml | 261 +------------------- 1 file changed, 1 insertion(+), 260 deletions(-) diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 10cc695d37..2552a10a5e 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -3,266 +3,7 @@ org.eclipse.persistence.jpa.PersistenceProvider jdbc/horizon - com.divudi.entity.lab.PatientSample - com.divudi.entity.lab.PatientSampleComponant - com.divudi.entity.lab.ReportFormat - com.divudi.entity.lab.ReportItem - com.divudi.bean.common.FormItemValue - com.divudi.bean.pharmacy.DosageForm - com.divudi.bean.pharmacy.RouteOfAdministration - com.divudi.data.clinical.PersonRelationship - com.divudi.entity.AgentHistory - com.divudi.entity.ApiKey - com.divudi.entity.AppEmail - com.divudi.entity.Appointment - com.divudi.entity.Area - com.divudi.entity.AuditEvent - com.divudi.entity.Bill - com.divudi.entity.BillComponent - com.divudi.entity.BillEntry - com.divudi.entity.BillExpense - com.divudi.entity.BillFee - com.divudi.entity.BillFeePayment - com.divudi.entity.BillItem - com.divudi.entity.BillNumber - com.divudi.entity.BillSession - com.divudi.entity.BilledBill - com.divudi.entity.CancelledBill - com.divudi.entity.CashierItem - com.divudi.entity.Category - com.divudi.entity.CategoryItem - com.divudi.entity.Channeling - com.divudi.entity.ConfigOption - com.divudi.entity.Consultant - com.divudi.entity.Department - com.divudi.entity.Doctor - com.divudi.entity.DoctorSpeciality - com.divudi.entity.EncounterCreditCompany - com.divudi.entity.Family - com.divudi.entity.FamilyMember - com.divudi.entity.Fee - com.divudi.entity.FeeChange - com.divudi.entity.Form - com.divudi.entity.FormFormat - com.divudi.entity.Institution - com.divudi.entity.InventoryCategory - com.divudi.entity.IssueRateMargins - com.divudi.entity.Item - com.divudi.entity.ItemFee - com.divudi.entity.ItemMapping - com.divudi.entity.ItemPackage - com.divudi.entity.ItemsCategories - com.divudi.entity.Logins - com.divudi.entity.Mapping - com.divudi.entity.MedicalPackage - com.divudi.entity.MedicalPackageFee - com.divudi.entity.MedicalPackageItem - com.divudi.entity.MetadataCategory - com.divudi.entity.MetadataSuperCategory - com.divudi.entity.Nationality - com.divudi.entity.Notification - com.divudi.entity.OpdVisit - com.divudi.entity.PackageFee - com.divudi.entity.PackageItem - com.divudi.entity.Packege - com.divudi.entity.Patient - com.divudi.entity.PatientEncounter - com.divudi.entity.PatientFlag - com.divudi.entity.PatientItem - com.divudi.entity.Payment - com.divudi.entity.PaymentGatewayTransaction - com.divudi.entity.PaymentScheme - com.divudi.entity.Person - com.divudi.entity.PersonInstitution - com.divudi.entity.PreBill - com.divudi.entity.PriceMatrix - com.divudi.entity.RefundBill - com.divudi.entity.Relation - com.divudi.entity.Religion - com.divudi.entity.ReportTemplate - com.divudi.entity.Route - com.divudi.entity.Service - com.divudi.entity.ServiceCategory - com.divudi.entity.ServiceSession - com.divudi.entity.ServiceSessionInstance - com.divudi.entity.ServiceSessionLeave - com.divudi.entity.ServiceSubCategory - com.divudi.entity.SessionNumberGenerator - com.divudi.entity.Sex - com.divudi.entity.Sms - com.divudi.entity.Speciality - com.divudi.entity.Staff - com.divudi.entity.Token - com.divudi.entity.TriggerSubscription - com.divudi.entity.Upload - com.divudi.entity.UserIcon - com.divudi.entity.UserNotification - com.divudi.entity.UserPreference - com.divudi.entity.Vocabulary - com.divudi.entity.WebContent - com.divudi.entity.WebLanguage - com.divudi.entity.WebTheme - com.divudi.entity.WebUser - com.divudi.entity.WebUserDashboard - com.divudi.entity.WebUserDepartment - com.divudi.entity.WebUserPaymentScheme - com.divudi.entity.WebUserPrivilege - com.divudi.entity.WebUserRole - com.divudi.entity.WebUserRolePrivilege - com.divudi.entity.WebUserRoleUser - com.divudi.entity.WebUserRoute - com.divudi.entity.cashTransaction.CashTransaction - com.divudi.entity.cashTransaction.CashTransactionHistory - com.divudi.entity.cashTransaction.Drawer - com.divudi.entity.channel.AgentReferenceBook - com.divudi.entity.channel.AgentsFees - com.divudi.entity.channel.AppointmentActivity - com.divudi.entity.channel.ArrivalRecord - com.divudi.entity.channel.DoctorInstitution - com.divudi.entity.channel.PatientSessionInstanceActivity - com.divudi.entity.channel.SessionFee - com.divudi.entity.channel.SessionInstance - com.divudi.entity.channel.SessionInstanceActivity - com.divudi.entity.clinical.ClinicalEntity - com.divudi.entity.clinical.ClinicalFindingItem - com.divudi.entity.clinical.ClinicalFindingValue - com.divudi.entity.clinical.DocumentTemplate - com.divudi.entity.clinical.ItemUsage - com.divudi.entity.clinical.Prescription - com.divudi.entity.clinical.PrescriptionTemplate - com.divudi.entity.forms.ComponentAsignment - com.divudi.entity.hr.AdditionalForm - com.divudi.entity.hr.AmendmentForm - com.divudi.entity.hr.BankAccount - com.divudi.entity.hr.BasicSalary - com.divudi.entity.hr.Designation - com.divudi.entity.hr.FingerPrintRecord - com.divudi.entity.hr.FingerPrintRecordHistory - com.divudi.entity.hr.Grade - com.divudi.entity.hr.HrForm - com.divudi.entity.hr.HrmVariables - com.divudi.entity.hr.LeaveForm - com.divudi.entity.hr.LeaveFormSystem - com.divudi.entity.hr.Loan - com.divudi.entity.hr.PayeeTaxRange - com.divudi.entity.hr.PaysheetComponent - com.divudi.entity.hr.PhDate - com.divudi.entity.hr.Roster - com.divudi.entity.hr.SalaryCycle - com.divudi.entity.hr.SalaryHold - com.divudi.entity.hr.Shift - com.divudi.entity.hr.ShiftAmendment - com.divudi.entity.hr.ShiftPreference - com.divudi.entity.hr.StaffBasics - com.divudi.entity.hr.StaffCategory - com.divudi.entity.hr.StaffDesignation - com.divudi.entity.hr.StaffEmployeeStatus - com.divudi.entity.hr.StaffEmployment - com.divudi.entity.hr.StaffGrade - com.divudi.entity.hr.StaffLeave - com.divudi.entity.hr.StaffLeaveEntitle - com.divudi.entity.hr.StaffLeaveSystem - com.divudi.entity.hr.StaffPaysheetComponent - com.divudi.entity.hr.StaffSalary - com.divudi.entity.hr.StaffSalaryComponant - com.divudi.entity.hr.StaffShift - com.divudi.entity.hr.StaffShiftAmendment - com.divudi.entity.hr.StaffShiftExtra - com.divudi.entity.hr.StaffShiftHistory - com.divudi.entity.hr.StaffShiftReplace - com.divudi.entity.hr.StaffStaffCategory - com.divudi.entity.hr.StaffWorkDay - com.divudi.entity.hr.StaffWorkingDepartment - com.divudi.entity.hr.TransferForm - com.divudi.entity.hr.WorkingTime - com.divudi.entity.inward.Admission - com.divudi.entity.inward.AdmissionType - com.divudi.entity.inward.EncounterComponent - com.divudi.entity.inward.GuardianRoom - com.divudi.entity.inward.InwardFee - com.divudi.entity.inward.InwardPriceAdjustment - com.divudi.entity.inward.InwardService - com.divudi.entity.inward.PatientRoom - com.divudi.entity.inward.Room - com.divudi.entity.inward.RoomCategory - com.divudi.entity.inward.RoomFacilityCharge - com.divudi.entity.inward.TheatreService - com.divudi.entity.inward.TimedItem - com.divudi.entity.inward.TimedItemCategory - com.divudi.entity.inward.TimedItemFee - com.divudi.entity.lab.AnalyzerMessage - com.divudi.entity.lab.Antibiotic - com.divudi.entity.lab.CommonReportItem - com.divudi.entity.lab.DepartmentMachine - com.divudi.entity.lab.Investigation - com.divudi.entity.lab.InvestigationCategory - com.divudi.entity.lab.InvestigationComponent - com.divudi.entity.lab.InvestigationItem - com.divudi.entity.lab.InvestigationItemValue - com.divudi.entity.lab.InvestigationItemValueCategory - com.divudi.entity.lab.InvestigationItemValueFlag - com.divudi.entity.lab.InvestigationItemValueForCategory - com.divudi.entity.lab.InvestigationReportItemValue - com.divudi.entity.lab.InvestigationTube - com.divudi.entity.lab.InvestigationValidaterComponent - com.divudi.entity.lab.InvestigationValidator - com.divudi.entity.lab.ItemForItem - com.divudi.entity.lab.IxCal - com.divudi.entity.lab.Lab - com.divudi.entity.lab.LabVisit - com.divudi.entity.lab.Machine - com.divudi.entity.lab.PatientInvestigation - com.divudi.entity.lab.PatientReport - com.divudi.entity.lab.PatientReportItemValue - com.divudi.entity.lab.Sample - com.divudi.entity.lab.TestFlag - com.divudi.entity.lab.WorksheetFormat - com.divudi.entity.lab.WorksheetItem - com.divudi.entity.membership.AllowedPaymentMethod - com.divudi.entity.membership.ChannellingMemberShipDiscount - com.divudi.entity.membership.InwardMemberShipDiscount - com.divudi.entity.membership.MembershipScheme - com.divudi.entity.membership.OpdMemberShipDiscount - com.divudi.entity.membership.PaymentSchemeDiscount - com.divudi.entity.membership.PharmacyMemberShipDiscount - com.divudi.entity.pharmacy.AdjustmentBillItem - com.divudi.entity.pharmacy.AdjustmentCategory - com.divudi.entity.pharmacy.Amp - com.divudi.entity.pharmacy.Ampp - com.divudi.entity.pharmacy.AssetCategory - com.divudi.entity.pharmacy.Atm - com.divudi.entity.pharmacy.ConsumableCategory - com.divudi.entity.pharmacy.DiscardCategory - com.divudi.entity.pharmacy.FrequencyUnit - com.divudi.entity.pharmacy.ItemBatch - com.divudi.entity.pharmacy.ItemsDistributors - com.divudi.entity.pharmacy.Make - com.divudi.entity.pharmacy.MeasurementUnit - com.divudi.entity.pharmacy.PharmaceuticalBillItem - com.divudi.entity.pharmacy.PharmaceuticalCategory - com.divudi.entity.pharmacy.PharmaceuticalItem - com.divudi.entity.pharmacy.PharmaceuticalItemCategory - com.divudi.entity.pharmacy.PharmaceuticalItemType - com.divudi.entity.pharmacy.Price - com.divudi.entity.pharmacy.PurchasePrice - com.divudi.entity.pharmacy.Reorder - com.divudi.entity.pharmacy.RetailSalePrice - com.divudi.entity.pharmacy.Stock - com.divudi.entity.pharmacy.StockHistory - com.divudi.entity.pharmacy.StockVarientBillItem - com.divudi.entity.pharmacy.StoreItemCategory - com.divudi.entity.pharmacy.UserStock - com.divudi.entity.pharmacy.UserStockContainer - com.divudi.entity.pharmacy.VirtualProductIngredient - com.divudi.entity.pharmacy.Vmp - com.divudi.entity.pharmacy.Vmpp - com.divudi.entity.pharmacy.Vtm - com.divudi.entity.pharmacy.WholeSalePrice - com.divudi.entity.web.CaptureComponent - com.divudi.entity.web.DesignComponent - com.divudi.entity.web.TemplateComponent - com.divudi.entity.web.WebTemplate - true + false From 33e7585878e9c483f460097ac41f49bd104bb759 Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 16:20:16 +0530 Subject: [PATCH 11/17] Signed-off-by: Dr M H B Ariyaratne --- .../FinancialTransactionController.java | 6 +- .../divudi/bean/opd/OpdBillController.java | 1 + src/main/resources/META-INF/persistence.xml | 4 +- src/main/webapp/lab/generate_barcode_p.xhtml | 275 +++++++++--------- 4 files changed, 147 insertions(+), 139 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index b3f49b4b3a..19716302f0 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -428,7 +428,11 @@ public void processShiftEndReport() { WebUser paramUser = nonClosedShiftStartFundBill.getCreater(); Institution paramCreditCompany = null; Long paramStartId = nonClosedShiftStartFundBill.getId(); - Long paramEndId = nonClosedShiftStartFundBill.getReferenceBill().getId(); + Long paramEndId=null; + if(nonClosedShiftStartFundBill.getReferenceBill()!=null){ + paramEndId = nonClosedShiftStartFundBill.getReferenceBill().getId(); + } + ReportTemplateRowBundle tmpChannellingBundle = addChannellingByCategories( channelingType, diff --git a/src/main/java/com/divudi/bean/opd/OpdBillController.java b/src/main/java/com/divudi/bean/opd/OpdBillController.java index 32c812c0a8..674748dea0 100644 --- a/src/main/java/com/divudi/bean/opd/OpdBillController.java +++ b/src/main/java/com/divudi/bean/opd/OpdBillController.java @@ -4164,6 +4164,7 @@ public void setSelectedOpdItemDepartment(Department selectedOpdItemDepartment) { public void fillDepartmentOpdItems() { departmentOpdItems = null; + opdItems=null; itemApplicationController.reloadItems(); getDepartmentOpdItems(); } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 2552a10a5e..51ea0c04a7 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,7 +2,7 @@ org.eclipse.persistence.jpa.PersistenceProvider - jdbc/horizon + jdbc/ruhunu false @@ -13,7 +13,7 @@ - jdbc/HorizonAudit + jdbc/ruhunuaudit false diff --git a/src/main/webapp/lab/generate_barcode_p.xhtml b/src/main/webapp/lab/generate_barcode_p.xhtml index 8867e26ced..2020276b01 100644 --- a/src/main/webapp/lab/generate_barcode_p.xhtml +++ b/src/main/webapp/lab/generate_barcode_p.xhtml @@ -23,168 +23,171 @@
-
-
-
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - +
+ + + + +
+
+ + +
- - - - #{apt.name} - - - #{apt.code} - - - #{apt.fullName} - - - #{apt.department.name} - - - +
+ + +
+
+ + + + + +
- - - - - - - +
+ + +
+
+ + +
- - +
+ + + + + +
- - +
+ + + + #{apt.name} + + + #{apt.code} + + + #{apt.fullName} + + + #{apt.department.name} + + + +
- - - - - +
+ + + + + + + +
- - - - - +
+ + +
- - - - +
+ + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + +
+ +
+ + + + +
+ +
+ + + + + + +
- - +
+ + - - - - + - - - - - - - - + + + +
+
+ - - + -
-
-
-
- +
- +
+ +
-
-
+ From d75f23fd29ea00948cfd7238baa18f88933bd1bc Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 17:11:55 +0530 Subject: [PATCH 12/17] Signed-off-by: Dr M H B Ariyaratne --- .../institutions/department_bulk_delete.xhtml | 3 ++- .../institutions/institution_bulk_delete.xhtml | 9 +++++---- .../create_items_for_new_institution.xhtml | 3 ++- .../items/investigation_list_to_remove.xhtml | 3 ++- .../admin/items/item_bulk_un_delete.xhtml | 3 ++- .../items/manage_department_item_mappings.xhtml | 6 ++++-- .../manage_institution_item_mappings.xhtml | 3 ++- .../webapp/admin/items/multiple_item_edit.xhtml | 3 ++- .../items/opd_service_list_to_remove.xhtml | 3 ++- .../lims/investigation_bulk_un_delete.xhtml | 3 ++- .../lims/investigation_format_multiple.xhtml | 3 ++- .../admin/opd_service_list_to_vatable.xhtml | 3 ++- .../webapp/admin/pricing/item_fee_list.xhtml | 3 ++- .../webapp/admin/pricing/item_fee_upload.xhtml | 3 ++- .../admin/pricing/manage_item_fees_bulk.xhtml | 3 ++- .../pricing/manage_item_fees_multiple.xhtml | 3 ++- .../pricing/membership/change_membership.xhtml | 3 ++- .../webapp/admin/staff/person_institution.xhtml | 3 ++- .../webapp/admin/staff/staff_bulk_delete.xhtml | 3 ++- .../admin/users/user_remove_multiple.xhtml | 3 ++- .../channel_agent_credit_bulk_update.xhtml | 3 ++- .../channel/channel_bill_session_transfer.xhtml | 3 ++- .../channel_payment_session_by_dates.xhtml | 3 ++- ...report_agent_referece_book_bulk_delete.xhtml | 3 ++- .../webapp/collecting_centre/bill_refund.xhtml | 3 ++- .../credit/credit_compnay_bill_inward_all.xhtml | 8 +++++--- .../credit/credit_compnay_bill_opd_all.xhtml | 3 ++- src/main/webapp/lab/generate_barcode_p.xhtml | 17 +++++++++-------- 28 files changed, 71 insertions(+), 41 deletions(-) diff --git a/src/main/webapp/admin/institutions/department_bulk_delete.xhtml b/src/main/webapp/admin/institutions/department_bulk_delete.xhtml index 35189cda17..7dee2e9f57 100644 --- a/src/main/webapp/admin/institutions/department_bulk_delete.xhtml +++ b/src/main/webapp/admin/institutions/department_bulk_delete.xhtml @@ -31,10 +31,11 @@ rowKey="#{sv.id}" selection="#{departmentController.itemsToRemove}" rows="10" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,50,100,500" > - +
@@ -29,10 +29,11 @@ rowKey="#{sv.id}" selection="#{institutionController.itemsToRemove}" rows="10" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,50,100,500" > - + - + @@ -62,7 +63,7 @@ - + diff --git a/src/main/webapp/admin/items/create_items_for_new_institution.xhtml b/src/main/webapp/admin/items/create_items_for_new_institution.xhtml index 01eb3774fc..7d12c9e41a 100644 --- a/src/main/webapp/admin/items/create_items_for_new_institution.xhtml +++ b/src/main/webapp/admin/items/create_items_for_new_institution.xhtml @@ -27,11 +27,12 @@ rowIndexVar="s" rows="20" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100,500,1000,1500" > - + diff --git a/src/main/webapp/admin/items/investigation_list_to_remove.xhtml b/src/main/webapp/admin/items/investigation_list_to_remove.xhtml index aa80eefdc5..0eb5536157 100644 --- a/src/main/webapp/admin/items/investigation_list_to_remove.xhtml +++ b/src/main/webapp/admin/items/investigation_list_to_remove.xhtml @@ -42,10 +42,11 @@ rowKey="#{sv.id}" selection="#{investigationController.itemsToRemove}" rows="10" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15,50,100,500,1000" > - + - + diff --git a/src/main/webapp/admin/items/manage_department_item_mappings.xhtml b/src/main/webapp/admin/items/manage_department_item_mappings.xhtml index 3d18e09576..a542ec8588 100644 --- a/src/main/webapp/admin/items/manage_department_item_mappings.xhtml +++ b/src/main/webapp/admin/items/manage_department_item_mappings.xhtml @@ -59,6 +59,7 @@ paginator="true" paginatorPosition="bottom" rows="10" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="5,10,{ShowAll|'All'}" @@ -67,7 +68,7 @@ - + @@ -103,6 +104,7 @@ rowKey="#{im.id}" selection="#{itemMappingController.selectedItemMappings}" var="im" + selectionMode="multiple" paginator="true" paginatorPosition="bottom" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" @@ -124,7 +126,7 @@
- + diff --git a/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml b/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml index 9096c9719e..c6ec123b65 100644 --- a/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml +++ b/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml @@ -49,6 +49,7 @@ paginator="true" paginatorPosition="bottom" rows="10" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="5,10,{ShowAll|'All'}" @@ -57,7 +58,7 @@ - + diff --git a/src/main/webapp/admin/items/multiple_item_edit.xhtml b/src/main/webapp/admin/items/multiple_item_edit.xhtml index 71a8099d55..ddcd4afdd7 100644 --- a/src/main/webapp/admin/items/multiple_item_edit.xhtml +++ b/src/main/webapp/admin/items/multiple_item_edit.xhtml @@ -104,13 +104,14 @@ rowKey="#{i.id}" rowIndexVar="s" rows="20" + selectionMode="multiple" paginator="true" selection="#{itemController.selectedList}" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100,500,1000,1500" > - + - + diff --git a/src/main/webapp/admin/lims/investigation_bulk_un_delete.xhtml b/src/main/webapp/admin/lims/investigation_bulk_un_delete.xhtml index 8e01b27514..af79a48e97 100644 --- a/src/main/webapp/admin/lims/investigation_bulk_un_delete.xhtml +++ b/src/main/webapp/admin/lims/investigation_bulk_un_delete.xhtml @@ -25,8 +25,9 @@ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="10,30,50,100,250" rows="50" + selectionMode="multiple" selection="#{investigationController.selectedIxs}"> - + diff --git a/src/main/webapp/admin/lims/investigation_format_multiple.xhtml b/src/main/webapp/admin/lims/investigation_format_multiple.xhtml index 7d4ce8179c..b4a409cd9b 100644 --- a/src/main/webapp/admin/lims/investigation_format_multiple.xhtml +++ b/src/main/webapp/admin/lims/investigation_format_multiple.xhtml @@ -91,11 +91,12 @@ rows="5" value="#{investigationItemController.items}" var="ixi" + selectionMode="multiple" selection="#{investigationItemController.selectedItemsToChange}" rowKey="#{ixi.id}" > - + diff --git a/src/main/webapp/admin/opd_service_list_to_vatable.xhtml b/src/main/webapp/admin/opd_service_list_to_vatable.xhtml index 42b0ad16f3..1ab5bf7a31 100644 --- a/src/main/webapp/admin/opd_service_list_to_vatable.xhtml +++ b/src/main/webapp/admin/opd_service_list_to_vatable.xhtml @@ -37,11 +37,12 @@ - + - + diff --git a/src/main/webapp/admin/pricing/item_fee_upload.xhtml b/src/main/webapp/admin/pricing/item_fee_upload.xhtml index 70f13e88f5..f0f6d1d1d8 100644 --- a/src/main/webapp/admin/pricing/item_fee_upload.xhtml +++ b/src/main/webapp/admin/pricing/item_fee_upload.xhtml @@ -94,11 +94,12 @@ rowIndexVar="s" rows="20" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100,500,1000,1500" > - + diff --git a/src/main/webapp/admin/pricing/manage_item_fees_bulk.xhtml b/src/main/webapp/admin/pricing/manage_item_fees_bulk.xhtml index 5ba674af1d..cb9266edd7 100644 --- a/src/main/webapp/admin/pricing/manage_item_fees_bulk.xhtml +++ b/src/main/webapp/admin/pricing/manage_item_fees_bulk.xhtml @@ -43,11 +43,12 @@ rowIndexVar="s" rows="20" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100,500,1000,1500" > - + - + - + diff --git a/src/main/webapp/admin/staff/person_institution.xhtml b/src/main/webapp/admin/staff/person_institution.xhtml index 648642ab31..651044dd10 100644 --- a/src/main/webapp/admin/staff/person_institution.xhtml +++ b/src/main/webapp/admin/staff/person_institution.xhtml @@ -31,9 +31,10 @@ rowKey="#{s.id}" selection="#{personInstitutionController.selectedList}" rowIndexVar="i" + selectionMode="multiple" scrollable="true" scrollHeight="250"> - + diff --git a/src/main/webapp/admin/staff/staff_bulk_delete.xhtml b/src/main/webapp/admin/staff/staff_bulk_delete.xhtml index 601414cf8a..d9408a3e0f 100644 --- a/src/main/webapp/admin/staff/staff_bulk_delete.xhtml +++ b/src/main/webapp/admin/staff/staff_bulk_delete.xhtml @@ -35,10 +35,11 @@ rows="10" paginator="true" paginatorPosition="bottom" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="5,10,15,500" > - + - + - + diff --git a/src/main/webapp/channel/channel_bill_session_transfer.xhtml b/src/main/webapp/channel/channel_bill_session_transfer.xhtml index 995a2d44ae..91e8770115 100644 --- a/src/main/webapp/channel/channel_bill_session_transfer.xhtml +++ b/src/main/webapp/channel/channel_bill_session_transfer.xhtml @@ -71,11 +71,12 @@ - + #{bs.serialNo} #{bs.bill.patient.person.nameWithTitle} diff --git a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml index e8cd82cdf5..08b9c413a2 100644 --- a/src/main/webapp/channel/channel_payment_session_by_dates.xhtml +++ b/src/main/webapp/channel/channel_payment_session_by_dates.xhtml @@ -118,6 +118,7 @@ paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" rowsPerPageTemplate="{ShowAll|'All'}" + selectionMode="multiple" > - + diff --git a/src/main/webapp/channel/channel_report_agent_referece_book_bulk_delete.xhtml b/src/main/webapp/channel/channel_report_agent_referece_book_bulk_delete.xhtml index b900495ae2..b89f48def6 100644 --- a/src/main/webapp/channel/channel_report_agent_referece_book_bulk_delete.xhtml +++ b/src/main/webapp/channel/channel_report_agent_referece_book_bulk_delete.xhtml @@ -34,12 +34,13 @@ id="tbl1" selection="#{agentReferenceBookController.selectedList}" rowIndexVar="i" + selectionMode="multiple" rowKey="#{a.id}"> - + diff --git a/src/main/webapp/collecting_centre/bill_refund.xhtml b/src/main/webapp/collecting_centre/bill_refund.xhtml index be10f29381..d352f8a7a0 100644 --- a/src/main/webapp/collecting_centre/bill_refund.xhtml +++ b/src/main/webapp/collecting_centre/bill_refund.xhtml @@ -94,6 +94,7 @@ @@ -102,7 +103,7 @@ - + diff --git a/src/main/webapp/credit/credit_compnay_bill_inward_all.xhtml b/src/main/webapp/credit/credit_compnay_bill_inward_all.xhtml index 98d85834a4..bddd1e1614 100644 --- a/src/main/webapp/credit/credit_compnay_bill_inward_all.xhtml +++ b/src/main/webapp/credit/credit_compnay_bill_inward_all.xhtml @@ -65,7 +65,9 @@ + rowKey="#{b.searialNo}" + selectionMode="multiple" + selection="#{cashRecieveBillController.selectedBillItems}"> @@ -80,9 +82,9 @@ - + - + diff --git a/src/main/webapp/credit/credit_compnay_bill_opd_all.xhtml b/src/main/webapp/credit/credit_compnay_bill_opd_all.xhtml index a752b8b139..ed580dfcb2 100644 --- a/src/main/webapp/credit/credit_compnay_bill_opd_all.xhtml +++ b/src/main/webapp/credit/credit_compnay_bill_opd_all.xhtml @@ -66,6 +66,7 @@ @@ -81,7 +82,7 @@ - + . diff --git a/src/main/webapp/lab/generate_barcode_p.xhtml b/src/main/webapp/lab/generate_barcode_p.xhtml index 2020276b01..2c7c554101 100644 --- a/src/main/webapp/lab/generate_barcode_p.xhtml +++ b/src/main/webapp/lab/generate_barcode_p.xhtml @@ -155,15 +155,16 @@
- + - +
+ + + + + +
- - - - -
@@ -187,7 +188,7 @@
- + From 7383fc0d260f37253c7ec7cec6f69ad660e3009a Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 19:28:39 +0530 Subject: [PATCH 13/17] Signed-off-by: Dr M H B Ariyaratne --- .../lab/PatientInvestigationController.java | 230 +++++++++++++----- .../bean/lab/PatientReportController.java | 7 + .../com/divudi/entity/lab/PatientReport.java | 20 -- .../com/divudi/entity/lab/PatientSample.java | 15 +- src/main/resources/META-INF/persistence.xml | 2 +- .../manage_institution_item_mappings.xhtml | 3 +- .../credit_compnay_bill_pharmacy_all.xhtml | 3 +- .../dataAdmin/bulk_update_itemsFees.xhtml | 3 +- ..._search_service_with_payment_methord.xhtml | 3 +- .../webapp/dataAdmin/item_list_for_vat.xhtml | 3 +- .../hr/_hr_staff_loan_installment_all.xhtml | 7 +- .../webapp/hr/hr_staff_basic_individual.xhtml | 5 +- .../webapp/hr/hr_staff_loan_installment.xhtml | 3 +- .../hr/hr_staff_paysheet_component_all.xhtml | 7 +- ...all_performace_allovance_percentatge.xhtml | 8 +- ..._component_all_performance_allovance.xhtml | 10 +- src/main/webapp/hr/hr_staff_salary.xhtml | 3 +- src/main/webapp/hr/hr_staff_salary_1.xhtml | 3 +- .../webapp/hr/hr_staff_salary_advance.xhtml | 3 +- .../webapp/hr/hr_staff_salary_checking.xhtml | 3 +- .../webapp/hr/hr_staff_salary_print.xhtml | 3 +- .../webapp/hr/hr_staff_salary_special.xhtml | 3 +- src/main/webapp/lab/generate_barcode_p.xhtml | 166 ++++++++++--- src/main/webapp/lab_patient_report.xhtml | 7 +- 24 files changed, 381 insertions(+), 139 deletions(-) diff --git a/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java b/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java index c4cbd67f81..3ddff8c49a 100644 --- a/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java +++ b/src/main/java/com/divudi/bean/lab/PatientInvestigationController.java @@ -59,6 +59,13 @@ import com.divudi.data.lab.Priority; import com.divudi.data.lab.SampleTubeLabel; import com.divudi.data.lab.SearchDateType; +import static com.divudi.data.lab.SearchDateType.ORDERED_DATE; +import static com.divudi.data.lab.SearchDateType.REPORT_AUTHORIZED; +import static com.divudi.data.lab.SearchDateType.REPORT_PRINTED; +import static com.divudi.data.lab.SearchDateType.SAMPLE_ACCEPTED_DATE; +import static com.divudi.data.lab.SearchDateType.SAMPLE_COLLECTED_DATE; +import static com.divudi.data.lab.SearchDateType.SAMPLE_GENERATED_DATE; +import static com.divudi.data.lab.SearchDateType.SAMPLE_SENT_DATE; import com.divudi.entity.Institution; import com.divudi.entity.Route; import com.divudi.entity.Staff; @@ -160,6 +167,8 @@ public class PatientInvestigationController implements Serializable { private PatientSample currentPatientSample; List currentInvestigationItems; private List items = null; + private List bills = null; + private List selectedBills = null; private List lstToSamle = null; private List lstToReceive = null; private List lstToEnterData = null; @@ -170,8 +179,8 @@ public class PatientInvestigationController implements Serializable { String selectText = ""; private Institution orderedInstitution; private Department orderedDepartment; - private Institution peformingInstitution; - private Department peformingDepartment; + private Institution performingInstitution; + private Department performingDepartment; private Institution collectionCenter; private Route route; private Priority priority; @@ -1274,8 +1283,7 @@ public void generateBarcodesForSelectedPatientInvestigations() { } } - - + public void collectSamples() { if (selectedItems == null) { JsfUtil.addErrorMessage("No Bills Seelcted"); @@ -1288,10 +1296,8 @@ public void collectSamples() { listingEntity = ListingEntity.PATIENT_SAMPLES; for (PatientInvestigation bi : selectedItems) { - - } - + } } @@ -1335,13 +1341,117 @@ public void listBillsToGenerateBarcodes() { } public void searchBills() { + listingEntity = ListingEntity.BILLS; + String jpql; + Map params = new HashMap<>(); + + jpql = "SELECT b FROM Bill b WHERE b.retired = :ret"; + + if (searchDateType == null) { + searchDateType = SearchDateType.ORDERED_DATE; + } + + switch (searchDateType) { + case ORDERED_DATE: + jpql += " AND b.createdAt BETWEEN :fd AND :td"; + params.put("fd", getFromDate()); + params.put("td", getToDate()); + break; + // Add other cases if necessary, with appropriate fields from the Bill entity + } + + if (orderedInstitution != null) { + jpql += " AND b.institution = :orderedInstitution"; + params.put("orderedInstitution", getOrderedInstitution()); + } + + if (orderedDepartment != null) { + jpql += " AND b.toDepartment = :orderedDepartment"; + params.put("orderedDepartment", getOrderedDepartment()); + } + + if (performingInstitution != null) { + // Add logic if needed + } + + if (performingDepartment != null) { + // Add logic if needed + } + + if (collectionCenter != null) { + jpql += " AND (b.collectingCentre = :collectionCenter OR b.fromInstitution = :collectionCenter)"; + params.put("collectionCenter", getCollectionCenter()); + } + + if (route != null) { + jpql += " AND (b.collectingCentre.route = :route OR b.fromInstitution.route = :route)"; + params.put("route", getRoute()); + } + + if (priority != null) { + // Add logic if needed + } + + if (specimen != null) { + // Add logic if needed + } + + if (patientName != null && !patientName.trim().isEmpty()) { + jpql += " AND b.patient.person.name LIKE :patientName"; + params.put("patientName", "%" + getPatientName().trim() + "%"); + } + + if (type != null && !type.trim().isEmpty()) { + jpql += " AND b.ipOpOrCc = :type"; + params.put("type", getType().trim()); + } + + if (externalDoctor != null && !externalDoctor.trim().isEmpty()) { + jpql += " AND b.referredByName = :externalDoctor"; + params.put("externalDoctor", getExternalDoctor().trim()); + } + + if (equipment != null) { + // Add logic if needed + } + + if (referringDoctor != null) { + jpql += " AND b.referredBy = :referringDoctor"; + params.put("referringDoctor", getReferringDoctor()); + } + + if (investigation != null) { + // Add logic if needed + } + + if (department != null) { + jpql += " AND b.toDepartment = :department"; + params.put("department", getDepartment()); + } + + if (patientInvestigationStatus != null) { + // Add logic if needed + } + + jpql += " ORDER BY b.id DESC"; + + params.put("ret", false); + + System.out.println("params = " + params); + System.out.println("jpql = " + jpql); + + bills = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); + System.out.println("items = " + bills); + } + + @Deprecated + public void searchBills1() { listingEntity = ListingEntity.PATIENT_INVESTIGATIONS; String jpql; Map params = new HashMap(); jpql = "SELECT i " + " FROM PatientInvestigation i " + " where i.retired=:ret " - + " and i.barcodeGenerated=:bg " + " and i.billItem.bill.billDate between :fromDate and :toDate "; if (orderedInstitution != null) { @@ -1426,14 +1536,14 @@ public void searchPatientInvestigations() { params.put("orderedDepartment", getOrderedDepartment()); } - if (peformingInstitution != null) { + if (performingInstitution != null) { jpql += " AND i.performInstitution = :peformingInstitution "; - params.put("peformingInstitution", getPeformingInstitution()); + params.put("peformingInstitution", getPerformingInstitution()); } - if (peformingDepartment != null) { + if (performingDepartment != null) { jpql += " AND i.performDepartment = :peformingDepartment "; - params.put("peformingDepartment", getPeformingDepartment()); + params.put("peformingDepartment", getPerformingDepartment()); } if (collectionCenter != null) { @@ -1513,10 +1623,7 @@ public void searchPatientSamples() { String jpql; Map params = new HashMap<>(); - jpql = "SELECT i " - + " FROM PatientSample ps " - + " join ps.bill b " - + " WHERE ps.retired=:ret "; + jpql = "SELECT ps FROM PatientSample ps JOIN ps.bill b WHERE ps.retired = :ret"; if (searchDateType == null) { searchDateType = SearchDateType.ORDERED_DATE; @@ -1524,112 +1631,109 @@ public void searchPatientSamples() { switch (searchDateType) { case ORDERED_DATE: - jpql += " AND b.createdAt BETWEEN :fd AND :td "; + jpql += " AND b.createdAt BETWEEN :fd AND :td"; params.put("fd", getFromDate()); params.put("td", getToDate()); break; - case REPORT_AUTHORIZED: - break; - case REPORT_PRINTED: - break; case SAMPLE_ACCEPTED_DATE: - jpql += " AND ps.sampleReceivedAtLabDate BETWEEN :fd AND :td "; + jpql += " AND ps.sampleReceivedAtLabAt BETWEEN :fd AND :td"; params.put("fd", getFromDate()); params.put("td", getToDate()); break; case SAMPLE_COLLECTED_DATE: - jpql += " AND ps.sampleCollectedAt BETWEEN :fd AND :td "; + jpql += " AND ps.sampleCollectedAt BETWEEN :fd AND :td"; params.put("fd", getFromDate()); params.put("td", getToDate()); break; case SAMPLE_GENERATED_DATE: - jpql += " AND i.sampleGeneratedAt BETWEEN :fd AND :td "; + jpql += " AND ps.createdAt BETWEEN :fd AND :td"; params.put("fd", getFromDate()); params.put("td", getToDate()); break; case SAMPLE_SENT_DATE: - jpql += " AND i.sampleSentAt BETWEEN :fd AND :td "; + jpql += " AND ps.sampleSentAt BETWEEN :fd AND :td"; params.put("fd", getFromDate()); params.put("td", getToDate()); break; - + // Add other cases as needed } if (orderedInstitution != null) { - jpql += " AND b.institution = :orderedInstitution "; + jpql += " AND b.institution = :orderedInstitution"; params.put("orderedInstitution", getOrderedInstitution()); } if (orderedDepartment != null) { - jpql += " AND b.department = :orderedDepartment "; + jpql += " AND b.department = :orderedDepartment"; params.put("orderedDepartment", getOrderedDepartment()); } - if (peformingInstitution != null) { - jpql += " AND ps.institution = :peformingInstitution "; - params.put("peformingInstitution", getPeformingInstitution()); + if (performingInstitution != null) { + jpql += " AND ps.institution = :performingInstitution"; + params.put("performingInstitution", getPerformingInstitution()); } - if (peformingDepartment != null) { - jpql += " AND ps.department = :peformingDepartment "; - params.put("peformingDepartment", getPeformingDepartment()); + if (performingDepartment != null) { + jpql += " AND ps.department = :performingDepartment"; + params.put("performingDepartment", getPerformingDepartment()); } if (collectionCenter != null) { - jpql += " AND (i.billItem.bill.collectingCentre = :collectionCenter OR i.billItem.bill.fromInstitution = :collectionCenter) "; + jpql += " AND (b.collectingCentre = :collectionCenter OR b.fromInstitution = :collectionCenter)"; params.put("collectionCenter", getCollectionCenter()); } if (route != null) { - jpql += " AND (i.billItem.bill.collectingCentre.route = :route OR i.billItem.bill.fromInstitution.route = :route) "; + jpql += " AND (b.collectingCentre.route = :route OR b.fromInstitution.route = :route)"; params.put("route", getRoute()); } if (priority != null) { - jpql += " AND i.billItem.priority = :priority "; + jpql += " AND ps.priority = :priority"; params.put("priority", getPriority()); } if (specimen != null) { - jpql += " AND i.sample = :specimen "; + jpql += " AND ps.sample = :specimen"; params.put("specimen", getSpecimen()); } if (patientName != null && !patientName.trim().isEmpty()) { - jpql += " AND b.patient.person.name LIKE :patientName "; + jpql += " AND b.patient.person.name LIKE :patientName"; params.put("patientName", "%" + getPatientName().trim() + "%"); } if (type != null && !type.trim().isEmpty()) { - jpql += " AND b.ipOpOrCC = :type "; + jpql += " AND b.ipOpOrCc = :type"; params.put("type", getType().trim()); } if (externalDoctor != null && !externalDoctor.trim().isEmpty()) { - jpql += " AND b.referredByName = :externalDoctor "; + jpql += " AND b.referredByName = :externalDoctor"; params.put("externalDoctor", getExternalDoctor().trim()); } if (equipment != null) { - + // Add logic if needed } if (referringDoctor != null) { - jpql += " AND b.referringDoctor = :referringDoctor "; + jpql += " AND b.referringDoctor = :referringDoctor"; params.put("referringDoctor", getReferringDoctor()); } if (investigation != null) { - + // Add logic if needed } if (department != null) { - jpql += " AND ps.department = :department "; + jpql += " AND ps.department = :department"; params.put("department", getDepartment()); } if (patientInvestigationStatus != null) { - + jpql += " AND ps.status = :status"; + params.put("status", getPatientInvestigationStatus()); } jpql += " ORDER BY ps.id DESC"; @@ -1640,7 +1744,7 @@ public void searchPatientSamples() { System.out.println("jpql = " + jpql); patientSamples = patientSampleFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); - System.out.println("items = " + items); + System.out.println("patientSamples = " + patientSamples); } public void listBillsWithGeneratedBarcodes() { @@ -2607,20 +2711,20 @@ public void setOrderedDepartment(Department orderedDepartment) { this.orderedDepartment = orderedDepartment; } - public Institution getPeformingInstitution() { - return peformingInstitution; + public Institution getPerformingInstitution() { + return performingInstitution; } - public void setPeformingInstitution(Institution peformingInstitution) { - this.peformingInstitution = peformingInstitution; + public void setPerformingInstitution(Institution performingInstitution) { + this.performingInstitution = performingInstitution; } - public Department getPeformingDepartment() { - return peformingDepartment; + public Department getPerformingDepartment() { + return performingDepartment; } - public void setPeformingDepartment(Department peformingDepartment) { - this.peformingDepartment = peformingDepartment; + public void setPerformingDepartment(Department performingDepartment) { + this.performingDepartment = performingDepartment; } public SearchDateType getSearchDateType() { @@ -2770,6 +2874,22 @@ public void setListingEntity(ListingEntity listingEntity) { this.listingEntity = listingEntity; } + public List getBills() { + return bills; + } + + public void setBills(List bills) { + this.bills = bills; + } + + public List getSelectedBills() { + return selectedBills; + } + + public void setSelectedBills(List selectedBills) { + this.selectedBills = selectedBills; + } + /** * */ diff --git a/src/main/java/com/divudi/bean/lab/PatientReportController.java b/src/main/java/com/divudi/bean/lab/PatientReportController.java index d6a5871ab8..cb1ed0b7bf 100644 --- a/src/main/java/com/divudi/bean/lab/PatientReportController.java +++ b/src/main/java/com/divudi/bean/lab/PatientReportController.java @@ -1065,6 +1065,13 @@ public void savePatientReport() { currentPatientReport.setDataEntryDepartment(getSessionController().getLoggedUser().getDepartment()); currentPatientReport.setDataEntryInstitution(getSessionController().getLoggedUser().getInstitution()); currentPatientReport.setDataEntryUser(getSessionController().getLoggedUser()); + +// boolean hadHtml=false; +// for(PatientReportItemValue priv: currentPatientReport.getPatientReportItemValues()){ +// if(priv.getInvestigationItem().getIxItemType()==InvestigationItemType.Html){ +// hadHtml=true; +// } +// } getFacade().edit(currentPatientReport); getPiFacade().edit(currentPtIx); diff --git a/src/main/java/com/divudi/entity/lab/PatientReport.java b/src/main/java/com/divudi/entity/lab/PatientReport.java index 26449aa52f..9e2839fb0b 100644 --- a/src/main/java/com/divudi/entity/lab/PatientReport.java +++ b/src/main/java/com/divudi/entity/lab/PatientReport.java @@ -39,17 +39,6 @@ public class PatientReport implements Serializable { @OneToMany(mappedBy = "patientReport", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List patientReportItemValues; -// @Transient -// private List patientReportItemOfValueType; -// -// @Transient -// private List patientReportItemOfFlagType; -// -// @Transient -// private List patientReportItemOfCalculationType; -// -// @Transient -// private List patientReportItemOfDynamicLabelType; private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) @@ -322,10 +311,6 @@ public void sortValues() { Collections.sort(patientReportItemValues, new PatientReportItemValueComparator()); } catch (Exception e) { } -// patientReportItemOfCalculationType = null; -// patientReportItemOfDynamicLabelType = null; -// patientReportItemOfFlagType = null; -// patientReportItemOfValueType = null; filteredAndSorted = true; } } @@ -337,16 +322,11 @@ public List getPatientReportItemValues() { Collections.sort(patientReportItemValues, new PatientReportItemValueComparator()); } catch (Exception e) { } -// patientReportItemOfCalculationType = null; -// patientReportItemOfDynamicLabelType = null; -// patientReportItemOfFlagType = null; -// patientReportItemOfValueType = null; filteredAndSorted = true; } } else { patientReportItemValues = new ArrayList<>(); } -// //System.out.println("patientReportItemValues = " + patientReportItemValues.size()); return patientReportItemValues; } diff --git a/src/main/java/com/divudi/entity/lab/PatientSample.java b/src/main/java/com/divudi/entity/lab/PatientSample.java index 026f5383a5..f9601f30dd 100644 --- a/src/main/java/com/divudi/entity/lab/PatientSample.java +++ b/src/main/java/com/divudi/entity/lab/PatientSample.java @@ -6,6 +6,7 @@ package com.divudi.entity.lab; import com.divudi.data.lab.PatientInvestigationStatus; +import com.divudi.data.lab.Priority; import com.divudi.data.lab.SampleRequestType; import com.divudi.entity.Bill; import com.divudi.entity.Department; @@ -27,7 +28,8 @@ /** * - * @author buddhika_ari + * @author buddhika.ari@gmail.com + * */ @Entity public class PatientSample implements Serializable { @@ -85,6 +87,9 @@ public class PatientSample implements Serializable { @Temporal(javax.persistence.TemporalType.TIMESTAMP) private Date sampleSentAt; + @Enumerated + private Priority priority; + //Sent To Analyzer private Boolean readyTosentToAnalyzer; @Enumerated(EnumType.STRING) @@ -722,4 +727,12 @@ public void setDepartment(Department department) { this.department = department; } + public Priority getPriority() { + return priority; + } + + public void setPriority(Priority priority) { + this.priority = priority; + } + } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 51ea0c04a7..755636ee5e 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -5,7 +5,7 @@ jdbc/ruhunu false - + diff --git a/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml b/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml index c6ec123b65..cfd73335c4 100644 --- a/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml +++ b/src/main/webapp/admin/items/manage_institution_item_mappings.xhtml @@ -91,6 +91,7 @@ rowKey="#{im.id}" selection="#{itemMappingController.selectedItemMappings}" var="im" + selectionMode="multiple" paginator="true" paginatorPosition="both" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records" @@ -104,7 +105,7 @@ ajax="false" action="#{itemMappingController.removeSelectedItemMappingForInstitution()}"> - + diff --git a/src/main/webapp/credit/credit_compnay_bill_pharmacy_all.xhtml b/src/main/webapp/credit/credit_compnay_bill_pharmacy_all.xhtml index 371b399a35..87093621f5 100644 --- a/src/main/webapp/credit/credit_compnay_bill_pharmacy_all.xhtml +++ b/src/main/webapp/credit/credit_compnay_bill_pharmacy_all.xhtml @@ -65,6 +65,7 @@ @@ -81,7 +82,7 @@ - + . diff --git a/src/main/webapp/dataAdmin/bulk_update_itemsFees.xhtml b/src/main/webapp/dataAdmin/bulk_update_itemsFees.xhtml index affaadac7e..cb8c3cfa13 100644 --- a/src/main/webapp/dataAdmin/bulk_update_itemsFees.xhtml +++ b/src/main/webapp/dataAdmin/bulk_update_itemsFees.xhtml @@ -27,11 +27,12 @@ rowIndexVar="s" rows="20" paginator="true" + selectionMode="multiple" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" rowsPerPageTemplate="20,50,100,500,1000,1500" > - + diff --git a/src/main/webapp/dataAdmin/inward_search_service_with_payment_methord.xhtml b/src/main/webapp/dataAdmin/inward_search_service_with_payment_methord.xhtml index d9d49deb87..ea59e8d3aa 100644 --- a/src/main/webapp/dataAdmin/inward_search_service_with_payment_methord.xhtml +++ b/src/main/webapp/dataAdmin/inward_search_service_with_payment_methord.xhtml @@ -29,9 +29,10 @@ selection="#{dataAdministrationController.selectedBills}" rowIndexVar="i" rowKey="#{bill.id}" + selectionMode="multiple" rowStyleClass="#{bill.paymentMethod eq 'Card' ? 'greenText':''}" > - + diff --git a/src/main/webapp/dataAdmin/item_list_for_vat.xhtml b/src/main/webapp/dataAdmin/item_list_for_vat.xhtml index ceb50bc982..35c745c56f 100644 --- a/src/main/webapp/dataAdmin/item_list_for_vat.xhtml +++ b/src/main/webapp/dataAdmin/item_list_for_vat.xhtml @@ -93,11 +93,12 @@ rowKey="#{i.id}" selection="#{dataAdministrationController.selectedItems}" scrollable="true" + selectionMode="multiple" scrollHeight="300"> - + diff --git a/src/main/webapp/hr/_hr_staff_loan_installment_all.xhtml b/src/main/webapp/hr/_hr_staff_loan_installment_all.xhtml index 807ffdafef..edb9da966d 100644 --- a/src/main/webapp/hr/_hr_staff_loan_installment_all.xhtml +++ b/src/main/webapp/hr/_hr_staff_loan_installment_all.xhtml @@ -66,10 +66,11 @@ filteredValue="#{staffController.filteredStaff}" scrollHeight="300" rowKey="#{s.id}" + selectionMode="multiple" selection="#{staffController.selectedList}" rowIndexVar="i"> - + @@ -124,11 +125,11 @@ var="i" scrollHeight="350" editable="true" rowStyleClass="#{i.exist eq true ? 'exist':null}" scrollable="true" selection="#{staffPaySheetComponentAllController.selectedStaffComponent}" - rowKey="#{i.id}" > + rowKey="#{i.id}" selectionMode="multiple" > - + diff --git a/src/main/webapp/hr/hr_staff_basic_individual.xhtml b/src/main/webapp/hr/hr_staff_basic_individual.xhtml index bad1d90903..f952e6203c 100644 --- a/src/main/webapp/hr/hr_staff_basic_individual.xhtml +++ b/src/main/webapp/hr/hr_staff_basic_individual.xhtml @@ -137,11 +137,12 @@ + rowKey="#{i.id}" rowIndexVar="a" + selectionMode="multiple"> - + diff --git a/src/main/webapp/hr/hr_staff_loan_installment.xhtml b/src/main/webapp/hr/hr_staff_loan_installment.xhtml index e4c3391cf3..2b8348ea24 100644 --- a/src/main/webapp/hr/hr_staff_loan_installment.xhtml +++ b/src/main/webapp/hr/hr_staff_loan_installment.xhtml @@ -135,11 +135,12 @@ - + diff --git a/src/main/webapp/hr/hr_staff_paysheet_component_all.xhtml b/src/main/webapp/hr/hr_staff_paysheet_component_all.xhtml index e775783220..0d84a91a3c 100644 --- a/src/main/webapp/hr/hr_staff_paysheet_component_all.xhtml +++ b/src/main/webapp/hr/hr_staff_paysheet_component_all.xhtml @@ -116,10 +116,11 @@ filteredValue="#{staffController.filteredStaff}" scrollHeight="300" rowKey="#{s.id}" + selectionMode="multiple" selection="#{staffController.selectedList}" rowIndexVar="i"> - + @@ -146,11 +147,11 @@ var="i" scrollHeight="350" editable="true" rowStyleClass="#{i.exist eq true ? 'exist':null}" scrollable="true" selection="#{staffPaySheetComponentAllController.selectedStaffComponent}" - rowKey="#{i.id}" > + rowKey="#{i.id}" selectionMode="multiple" > - + diff --git a/src/main/webapp/hr/hr_staff_paysheet_component_all_performace_allovance_percentatge.xhtml b/src/main/webapp/hr/hr_staff_paysheet_component_all_performace_allovance_percentatge.xhtml index 59c55815a1..ade045cb24 100644 --- a/src/main/webapp/hr/hr_staff_paysheet_component_all_performace_allovance_percentatge.xhtml +++ b/src/main/webapp/hr/hr_staff_paysheet_component_all_performace_allovance_percentatge.xhtml @@ -59,10 +59,11 @@ filteredValue="#{staffController.filteredStaff}" scrollHeight="300" rowKey="#{s.id}" + selectionMode="multiple" selection="#{staffController.selectedList}" rowIndexVar="i"> - + @@ -139,12 +140,13 @@ var="i" editable="true" rowStyleClass="#{i.exist eq true ? 'exist':null}" selection="#{staffPaySheetComponentAllPerformancePercentageController.selectedStaffComponent}" - rowKey="#{i.id}" rowIndexVar="a" > + rowKey="#{i.id}" rowIndexVar="a" + selectionMode="multiple"> - + diff --git a/src/main/webapp/hr/hr_staff_paysheet_component_all_performance_allovance.xhtml b/src/main/webapp/hr/hr_staff_paysheet_component_all_performance_allovance.xhtml index 7620e3e5e8..764241fe03 100644 --- a/src/main/webapp/hr/hr_staff_paysheet_component_all_performance_allovance.xhtml +++ b/src/main/webapp/hr/hr_staff_paysheet_component_all_performance_allovance.xhtml @@ -62,12 +62,13 @@ - + @@ -149,13 +150,14 @@ var="i" editable="true" rowStyleClass="#{i.exist eq true ? 'exist':null}" selection="#{staffPaySheetComponentAllPerformanceAllowanceController.selectedStaffComponent}" - rowKey="#{i.id}" rowIndexVar="a" > + rowKey="#{i.id}" rowIndexVar="a" + selectionMode="multiple"> - + diff --git a/src/main/webapp/hr/hr_staff_salary.xhtml b/src/main/webapp/hr/hr_staff_salary.xhtml index 4875a0aea6..902ce7fb11 100644 --- a/src/main/webapp/hr/hr_staff_salary.xhtml +++ b/src/main/webapp/hr/hr_staff_salary.xhtml @@ -88,9 +88,10 @@ rowKey="#{s.id}" selection="#{staffController.selectedList}" rowIndexVar="i" + selectionMode="multiple" scrollable="true" rowStyleClass="#{((s.dateJoined eq staffSalaryController.salaryCycle.salaryFromDate)or(s.dateJoined gt staffSalaryController.salaryCycle.salaryFromDate)) and ((s.dateJoined eq staffSalaryController.salaryCycle.salaryToDate)or (s.dateJoined lt staffSalaryController.salaryCycle.salaryToDate)) ? 'greenText':''}" scrollHeight="250"> - + diff --git a/src/main/webapp/hr/hr_staff_salary_1.xhtml b/src/main/webapp/hr/hr_staff_salary_1.xhtml index 5fb2a97985..a8caffba35 100644 --- a/src/main/webapp/hr/hr_staff_salary_1.xhtml +++ b/src/main/webapp/hr/hr_staff_salary_1.xhtml @@ -55,9 +55,10 @@ rowKey="#{s.id}" selection="#{staffController.selectedList}" rowIndexVar="i" + selectionMode="multiple" scrollable="true" rowStyleClass="#{((s.dateJoined eq staffSalaryController.salaryCycle.salaryFromDate)or(s.dateJoined gt staffSalaryController.salaryCycle.salaryFromDate)) and ((s.dateJoined eq staffSalaryController.salaryCycle.salaryToDate)or (s.dateJoined lt staffSalaryController.salaryCycle.salaryToDate)) ? 'greenText':''}" scrollHeight="250"> - + #{i+1} diff --git a/src/main/webapp/hr/hr_staff_salary_advance.xhtml b/src/main/webapp/hr/hr_staff_salary_advance.xhtml index 1d480089a7..da0f417ca5 100644 --- a/src/main/webapp/hr/hr_staff_salary_advance.xhtml +++ b/src/main/webapp/hr/hr_staff_salary_advance.xhtml @@ -88,8 +88,9 @@ selection="#{staffController.selectedList}" rowIndexVar="i" scrollable="true" + selectionMode="multiple" scrollHeight="250"> - + diff --git a/src/main/webapp/hr/hr_staff_salary_checking.xhtml b/src/main/webapp/hr/hr_staff_salary_checking.xhtml index e5397456ed..4876b2d555 100644 --- a/src/main/webapp/hr/hr_staff_salary_checking.xhtml +++ b/src/main/webapp/hr/hr_staff_salary_checking.xhtml @@ -87,9 +87,10 @@ rowKey="#{s.id}" selection="#{staffController.selectedList}" rowIndexVar="i" + selectionMode="multiple" scrollable="true" rowStyleClass="#{((s.dateJoined eq staffSalaryController.salaryCycle.salaryFromDate)or(s.dateJoined gt staffSalaryController.salaryCycle.salaryFromDate)) and ((s.dateJoined eq staffSalaryController.salaryCycle.salaryToDate)or (s.dateJoined lt staffSalaryController.salaryCycle.salaryToDate)) ? 'greenText':''}" scrollHeight="250"> - + diff --git a/src/main/webapp/hr/hr_staff_salary_print.xhtml b/src/main/webapp/hr/hr_staff_salary_print.xhtml index 87b12399a1..f01c025ae0 100644 --- a/src/main/webapp/hr/hr_staff_salary_print.xhtml +++ b/src/main/webapp/hr/hr_staff_salary_print.xhtml @@ -84,9 +84,10 @@ - + diff --git a/src/main/webapp/hr/hr_staff_salary_special.xhtml b/src/main/webapp/hr/hr_staff_salary_special.xhtml index 5dc582deaf..4b49a71d67 100644 --- a/src/main/webapp/hr/hr_staff_salary_special.xhtml +++ b/src/main/webapp/hr/hr_staff_salary_special.xhtml @@ -88,9 +88,10 @@ rowKey="#{s.id}" selection="#{staffController.selectedList}" rowIndexVar="i" + selectionMode="multiple" scrollable="true" rowStyleClass="#{((s.dateJoined eq staffSalaryController.salaryCycle.salaryFromDate)or(s.dateJoined gt staffSalaryController.salaryCycle.salaryFromDate)) and ((s.dateJoined eq staffSalaryController.salaryCycle.salaryToDate)or (s.dateJoined lt staffSalaryController.salaryCycle.salaryToDate)) ? 'greenText':''}" scrollHeight="250"> - + diff --git a/src/main/webapp/lab/generate_barcode_p.xhtml b/src/main/webapp/lab/generate_barcode_p.xhtml index 2c7c554101..78c002d81f 100644 --- a/src/main/webapp/lab/generate_barcode_p.xhtml +++ b/src/main/webapp/lab/generate_barcode_p.xhtml @@ -154,42 +154,81 @@
-
- - -
- - - - - -
+
+ + + + +
+
+ + + + + + +
-
- - +
+ +
+ + + + + + + + + +
+
+ +
+ + + + + + + + + + + +
+
+
+
+
+
+
+
- -
- - - +
+ + @@ -464,6 +505,7 @@ + @@ -473,14 +515,73 @@ + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +
@@ -512,8 +613,8 @@ - - + +    @@ -542,7 +643,7 @@ type="#{configOptionApplicationController.getShortTextValueByKey('Sample Sticker - Barcode Type','code128')}" height="#{configOptionApplicationController.getShortTextValueByKey('Sample Sticker - Barcode Height in Pixles','80')}" width="#{configOptionApplicationController.getShortTextValueByKey('Sample Sticker - Barcode Width in Pixles','300')}" - orientation="0" > + orientation="0">
@@ -551,10 +652,7 @@ - -
-
diff --git a/src/main/webapp/lab_patient_report.xhtml b/src/main/webapp/lab_patient_report.xhtml index 0333b1f66c..50431f2338 100644 --- a/src/main/webapp/lab_patient_report.xhtml +++ b/src/main/webapp/lab_patient_report.xhtml @@ -332,7 +332,7 @@

E

+ value="#{patientReportController.currentPatientReport.templateItem.lobValue}" widgetVar="editor" height="650" > @@ -392,6 +392,11 @@
+ +
+ +
+
From edb6c909ace03d450c2eed304755e1b2379e2b4b Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 20:25:08 +0530 Subject: [PATCH 14/17] Signed-off-by: Dr M H B Ariyaratne --- .../divudi/bean/common/EnumController.java | 8 +- .../bean/lab/PatientReportController.java | 81 ++++++++++++++++--- .../divudi/data/InvestigationReportType.java | 2 +- .../com/divudi/entity/lab/Investigation.java | 3 + .../webapp/admin/lims/investigation.xhtml | 6 +- src/main/webapp/lab_patient_report.xhtml | 14 +++- 6 files changed, 97 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/EnumController.java b/src/main/java/com/divudi/bean/common/EnumController.java index 82d7c775e9..1b005c2206 100644 --- a/src/main/java/com/divudi/bean/common/EnumController.java +++ b/src/main/java/com/divudi/bean/common/EnumController.java @@ -20,6 +20,7 @@ import com.divudi.data.FeeType; import com.divudi.data.InvestigationItemType; import com.divudi.data.InvestigationItemValueType; +import com.divudi.data.InvestigationReportType; import com.divudi.data.ItemBarcodeGenerationStrategy; import com.divudi.data.ItemListingStrategy; import com.divudi.data.ItemType; @@ -147,6 +148,10 @@ public List getPaymentMethodsForChanneling() { return paymentMethodsForChanneling; } + public List getInvestigationReportTypes() { + return Arrays.asList(InvestigationReportType.values()); + } + public List getPaymentMethodsForChannelSettling() { if (paymentMethodsForChannelSettling == null) { fillPaymentMethodsForChannelSettling(); @@ -221,8 +226,7 @@ public > E getEnumValue(Class enumType, String enumName) { return null; // Return null if no match is found } - - public List getPriorities() { + public List getPriorities() { return Arrays.asList(Priority.values()); } diff --git a/src/main/java/com/divudi/bean/lab/PatientReportController.java b/src/main/java/com/divudi/bean/lab/PatientReportController.java index cb1ed0b7bf..6b5b9ff5e5 100644 --- a/src/main/java/com/divudi/bean/lab/PatientReportController.java +++ b/src/main/java/com/divudi/bean/lab/PatientReportController.java @@ -1065,13 +1065,63 @@ public void savePatientReport() { currentPatientReport.setDataEntryDepartment(getSessionController().getLoggedUser().getDepartment()); currentPatientReport.setDataEntryInstitution(getSessionController().getLoggedUser().getInstitution()); currentPatientReport.setDataEntryUser(getSessionController().getLoggedUser()); - -// boolean hadHtml=false; -// for(PatientReportItemValue priv: currentPatientReport.getPatientReportItemValues()){ -// if(priv.getInvestigationItem().getIxItemType()==InvestigationItemType.Html){ -// hadHtml=true; -// } -// } + + Investigation currentInvestigation = (Investigation) currentPatientReport.getItem(); + if (currentInvestigation == null || currentPatientReport == null) { + return; // Handle the case where the investigation or report is null + } + + List htmlComponentsWithPlaceHoldersList = new ArrayList<>(); + if (currentInvestigation.getReportType() == InvestigationReportType.HtmlTemplate) { + for (InvestigationItem ixi : currentInvestigation.getReportItems()) { + if (ixi != null && ixi.getIxItemType() == InvestigationItemType.Html) { + htmlComponentsWithPlaceHoldersList.add(ixi); + } + } + } + + for (InvestigationItem htmlComponentWithPlaceholders : htmlComponentsWithPlaceHoldersList) { + List placeholders = extractPlaceholders(htmlComponentWithPlaceholders.getHtmltext()); + + for (String placeholder : placeholders) { + for (PatientReportItemValue priv : currentPatientReport.getPatientReportItemValues()) { + if (priv == null || priv.getInvestigationItem() == null) { + continue; // Skip null values to avoid null pointer exceptions + } + + String valueToReplacePlaceholder = null; + if (placeholder.equals(priv.getInvestigationItem().getName())) { + switch (priv.getInvestigationItem().getIxItemValueType()) { + case Varchar: + valueToReplacePlaceholder = priv.getStrValue(); + break; + case Double: + Double dbl = priv.getDoubleValue(); + if (dbl != null) { + String formatString = priv.getInvestigationItem().getFormatString() != null ? priv.getInvestigationItem().getFormatString() : ""; + String suffix = priv.getInvestigationItem().getFormatSuffix() != null ? priv.getInvestigationItem().getFormatSuffix() : ""; + String prefix = priv.getInvestigationItem().getFormatPrefix() != null ? priv.getInvestigationItem().getFormatPrefix() : ""; + valueToReplacePlaceholder = prefix + String.format(formatString, dbl) + suffix; + } + break; + case Memo: + valueToReplacePlaceholder = priv.getLobValue(); + break; + default: + valueToReplacePlaceholder = ""; // Handle other types if necessary + break; + } + + if (valueToReplacePlaceholder != null) { + // Replace the placeholder in the HTML content with the actual value + htmlComponentWithPlaceholders.setHtmltext( + htmlComponentWithPlaceholders.getHtmltext().replace("{" + placeholder + "}", valueToReplacePlaceholder) + ); + } + } + } + } + } getFacade().edit(currentPatientReport); getPiFacade().edit(currentPtIx); @@ -1079,6 +1129,19 @@ public void savePatientReport() { //JsfUtil.addSuccessMessage("Saved"); } + // Utility method to extract placeholders from HTML content + private List extractPlaceholders(String htmlContent) { + List placeholders = new ArrayList<>(); + if (htmlContent != null) { + Pattern pattern = Pattern.compile("\\{(.*?)\\}"); + Matcher matcher = pattern.matcher(htmlContent); + while (matcher.find()) { + placeholders.add(matcher.group(1)); + } + } + return placeholders; + } + public String emailMessageBody(PatientReport r) { String b = "" + "" @@ -1829,7 +1892,7 @@ public void printPatientReport() { getFacade().edit(currentPatientReport); } - + public void printPatientLabReport() { if (currentPatientReport == null) { JsfUtil.addErrorMessage("Nothing to approve"); @@ -1848,7 +1911,7 @@ public void printPatientLabReport() { currentPatientReport.setPrintingInstitution(getSessionController().getLoggedUser().getInstitution()); currentPatientReport.setPrintingUser(getSessionController().getLoggedUser()); currentPatientReport.setPrinted(true); - + getFacade().edit(currentPatientReport); } diff --git a/src/main/java/com/divudi/data/InvestigationReportType.java b/src/main/java/com/divudi/data/InvestigationReportType.java index ce831e1d2e..a2426b3fc4 100644 --- a/src/main/java/com/divudi/data/InvestigationReportType.java +++ b/src/main/java/com/divudi/data/InvestigationReportType.java @@ -10,8 +10,8 @@ * @author Buddhika */ public enum InvestigationReportType { - General, Microbiology, PathologyOrHaematology, + HtmlTemplate, } diff --git a/src/main/java/com/divudi/entity/lab/Investigation.java b/src/main/java/com/divudi/entity/lab/Investigation.java index 56c647edbc..5c7e8b8d4b 100644 --- a/src/main/java/com/divudi/entity/lab/Investigation.java +++ b/src/main/java/com/divudi/entity/lab/Investigation.java @@ -67,6 +67,9 @@ public void setSampleVolume(Double SampleVolume) { InvestigationReportType reportType; public InvestigationReportType getReportType() { + if (reportType == null) { + reportType = InvestigationReportType.General; + } return reportType; } diff --git a/src/main/webapp/admin/lims/investigation.xhtml b/src/main/webapp/admin/lims/investigation.xhtml index b24f2c0c3a..f76fcf7281 100644 --- a/src/main/webapp/admin/lims/investigation.xhtml +++ b/src/main/webapp/admin/lims/investigation.xhtml @@ -103,10 +103,8 @@ - - - + + diff --git a/src/main/webapp/lab_patient_report.xhtml b/src/main/webapp/lab_patient_report.xhtml index 50431f2338..bb7ce27394 100644 --- a/src/main/webapp/lab_patient_report.xhtml +++ b/src/main/webapp/lab_patient_report.xhtml @@ -382,8 +382,20 @@ + + +
+ + +
+ +
+
+
+
- +
From 84b79047ba8030a7d0929e371b7b62f94aac18fe Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 22:55:41 +0530 Subject: [PATCH 15/17] Signed-off-by: Dr M H B Ariyaratne --- .../bean/lab/PatientReportController.java | 156 +++-- .../com/divudi/ejb/PatientReportBean.java | 2 +- .../admin/lims/investigation_format.xhtml | 4 +- src/main/webapp/lab/patient_report.xhtml | 22 +- src/main/webapp/lab_patient_report.xhtml | 590 ------------------ 5 files changed, 136 insertions(+), 638 deletions(-) delete mode 100644 src/main/webapp/lab_patient_report.xhtml diff --git a/src/main/java/com/divudi/bean/lab/PatientReportController.java b/src/main/java/com/divudi/bean/lab/PatientReportController.java index 6b5b9ff5e5..b3a0c948a1 100644 --- a/src/main/java/com/divudi/bean/lab/PatientReportController.java +++ b/src/main/java/com/divudi/bean/lab/PatientReportController.java @@ -40,6 +40,8 @@ import com.divudi.facade.SmsFacade; import com.divudi.facade.TestFlagFacade; import com.divudi.bean.common.util.JsfUtil; +import static com.divudi.data.InvestigationItemValueType.Memo; +import static com.divudi.data.InvestigationItemValueType.Varchar; import com.divudi.entity.clinical.ClinicalFindingValue; import com.divudi.facade.ClinicalFindingValueFacade; import com.lowagie.text.DocumentException; @@ -1066,70 +1068,142 @@ public void savePatientReport() { currentPatientReport.setDataEntryInstitution(getSessionController().getLoggedUser().getInstitution()); currentPatientReport.setDataEntryUser(getSessionController().getLoggedUser()); + updateTemplate(); + + getFacade().edit(currentPatientReport); + getPiFacade().edit(currentPtIx); + + getFacade().edit(currentPatientReport); + getPiFacade().edit(currentPtIx); + + //JsfUtil.addSuccessMessage("Saved"); + } + + public void updateTemplate() { Investigation currentInvestigation = (Investigation) currentPatientReport.getItem(); if (currentInvestigation == null || currentPatientReport == null) { + System.out.println("currentInvestigation or currentPatientReport is null."); return; // Handle the case where the investigation or report is null } - List htmlComponentsWithPlaceHoldersList = new ArrayList<>(); + // Identify the InvestigationItem with placeholders + InvestigationItem templateItem = null; if (currentInvestigation.getReportType() == InvestigationReportType.HtmlTemplate) { for (InvestigationItem ixi : currentInvestigation.getReportItems()) { if (ixi != null && ixi.getIxItemType() == InvestigationItemType.Html) { - htmlComponentsWithPlaceHoldersList.add(ixi); + templateItem = ixi; + System.out.println("Selected InvestigationItem with Html content: " + ixi.getHtmltext()); + break; // Assume there is only one template; exit loop after finding it } } } - for (InvestigationItem htmlComponentWithPlaceholders : htmlComponentsWithPlaceHoldersList) { - List placeholders = extractPlaceholders(htmlComponentWithPlaceholders.getHtmltext()); + if (templateItem == null) { + System.out.println("No HtmlTemplate found in the current investigation."); + return; + } + + // Extract placeholders from the identified template + List placeholders = extractPlaceholders(templateItem.getHtmltext()); + System.out.println("Placeholders found: " + placeholders); - for (String placeholder : placeholders) { - for (PatientReportItemValue priv : currentPatientReport.getPatientReportItemValues()) { - if (priv == null || priv.getInvestigationItem() == null) { - continue; // Skip null values to avoid null pointer exceptions - } + // Store replacements in a map + Map replacementMap = new HashMap<>(); - String valueToReplacePlaceholder = null; - if (placeholder.equals(priv.getInvestigationItem().getName())) { - switch (priv.getInvestigationItem().getIxItemValueType()) { - case Varchar: - valueToReplacePlaceholder = priv.getStrValue(); - break; - case Double: - Double dbl = priv.getDoubleValue(); - if (dbl != null) { - String formatString = priv.getInvestigationItem().getFormatString() != null ? priv.getInvestigationItem().getFormatString() : ""; - String suffix = priv.getInvestigationItem().getFormatSuffix() != null ? priv.getInvestigationItem().getFormatSuffix() : ""; - String prefix = priv.getInvestigationItem().getFormatPrefix() != null ? priv.getInvestigationItem().getFormatPrefix() : ""; - valueToReplacePlaceholder = prefix + String.format(formatString, dbl) + suffix; - } - break; - case Memo: - valueToReplacePlaceholder = priv.getLobValue(); - break; - default: - valueToReplacePlaceholder = ""; // Handle other types if necessary - break; - } + // Iterate through patient values and match with placeholders + for (PatientReportItemValue priv : currentPatientReport.getPatientReportItemValues()) { + if (priv == null || priv.getInvestigationItem() == null) { + System.out.println("Skipping null PatientReportItemValue or InvestigationItem."); + continue; // Skip null values to avoid null pointer exceptions + } + + String itemName = priv.getInvestigationItem().getName(); + if (placeholders.contains(itemName)) { + String valueToReplacePlaceholder = null; - if (valueToReplacePlaceholder != null) { - // Replace the placeholder in the HTML content with the actual value - htmlComponentWithPlaceholders.setHtmltext( - htmlComponentWithPlaceholders.getHtmltext().replace("{" + placeholder + "}", valueToReplacePlaceholder) - ); + switch (priv.getInvestigationItem().getIxItemValueType()) { + case Varchar: + valueToReplacePlaceholder = priv.getStrValue(); + break; + case Double: + Double dbl = priv.getDoubleValue(); + if (dbl != null) { + String formatString = priv.getInvestigationItem().getFormatString(); + if (formatString == null || formatString.isEmpty()) { + formatString = "%.2f"; // Default format if none provided + } + String suffix = priv.getInvestigationItem().getFormatSuffix() != null ? priv.getInvestigationItem().getFormatSuffix() : ""; + String prefix = priv.getInvestigationItem().getFormatPrefix() != null ? priv.getInvestigationItem().getFormatPrefix() : ""; + valueToReplacePlaceholder = prefix + String.format(formatString, dbl) + suffix; + System.out.println("dbl = " + dbl + ", formatted value = " + valueToReplacePlaceholder); + } else { + System.out.println("Double value is null for: " + itemName); } - } + break; + case Memo: + valueToReplacePlaceholder = priv.getLobValue(); + break; + default: + valueToReplacePlaceholder = ""; // Handle other types if necessary + System.out.println("No matching value for: " + itemName); + break; + } + + if (valueToReplacePlaceholder != null && !valueToReplacePlaceholder.isEmpty()) { + replacementMap.put(itemName, valueToReplacePlaceholder); + System.out.println("Mapping placeholder: " + itemName + " to value: " + valueToReplacePlaceholder); + } else { + System.out.println("Value for placeholder " + itemName + " is null or empty."); } } } - getFacade().edit(currentPatientReport); - getPiFacade().edit(currentPtIx); + // Replace placeholders in the template with values from the map + String updatedHtmlText = templateItem.getHtmltext(); + for (String placeholder : placeholders) { + String replacementValue = replacementMap.get(placeholder); + if (replacementValue != null && !replacementValue.isEmpty()) { + updatedHtmlText = updatedHtmlText.replace("{" + placeholder + "}", replacementValue); + System.out.println("Replaced {" + placeholder + "} with " + replacementValue); + } else { + System.out.println("No replacement found for placeholder {" + placeholder + "}"); + } + } + + // Save the updated HTML text back to the patient-specific report item + for (PatientReportItemValue privHtml : currentPatientReport.getPatientReportItemValues()) { + System.out.println("privHtml = " + privHtml); + + if (privHtml == null) { + System.out.println("Skipping null privHtml."); + continue; // Skip null PatientReportItemValue + } + + if (privHtml.getInvestigationItem() == null) { + System.out.println("Skipping privHtml with null InvestigationItem."); + continue; // Skip if InvestigationItem is null + } + + System.out.println("privHtml.getInvestigationItem() = " + privHtml.getInvestigationItem()); + System.out.println("templateItem = " + templateItem); + + if (privHtml.getInvestigationItem().equals(templateItem)) { + System.out.println("InvestigationItem matches the templateItem."); + + // Set the updated HTML content + privHtml.setLobValue(updatedHtmlText); + + System.out.println("Set updated HTML content for PatientReportItemValue: " + + "ID: " + privHtml.getId() + ", Name: " + + privHtml.getInvestigationItem().getName()); + } else { + System.out.println("InvestigationItem does not match the templateItem."); + } + } - //JsfUtil.addSuccessMessage("Saved"); } - // Utility method to extract placeholders from HTML content +// Utility method to extract placeholders from HTML content private List extractPlaceholders(String htmlContent) { List placeholders = new ArrayList<>(); if (htmlContent != null) { diff --git a/src/main/java/com/divudi/ejb/PatientReportBean.java b/src/main/java/com/divudi/ejb/PatientReportBean.java index 3b7dbb3cef..f831b467f4 100644 --- a/src/main/java/com/divudi/ejb/PatientReportBean.java +++ b/src/main/java/com/divudi/ejb/PatientReportBean.java @@ -146,7 +146,7 @@ public void addPatientReportItemValuesForReport(PatientReport ptReport) { Investigation temIx = (Investigation) ptReport.getItem(); for (ReportItem ii : temIx.getReportItems()) { PatientReportItemValue val = null; - if ((ii.getIxItemType() == InvestigationItemType.Value || ii.getIxItemType() == InvestigationItemType.Calculation || ii.getIxItemType() == InvestigationItemType.Flag || ii.getIxItemType() == InvestigationItemType.Template) && ii.isRetired() == false) { + if ((ii.getIxItemType() == InvestigationItemType.Value || ii.getIxItemType() == InvestigationItemType.Calculation || ii.getIxItemType() == InvestigationItemType.Flag || ii.getIxItemType() == InvestigationItemType.Html || ii.getIxItemType() == InvestigationItemType.Template) && ii.isRetired() == false) { if (ptReport.getId() == null || ptReport.getId() == 0) { val = new PatientReportItemValue(); diff --git a/src/main/webapp/admin/lims/investigation_format.xhtml b/src/main/webapp/admin/lims/investigation_format.xhtml index 138d145c4d..e0801d4cbb 100644 --- a/src/main/webapp/admin/lims/investigation_format.xhtml +++ b/src/main/webapp/admin/lims/investigation_format.xhtml @@ -343,7 +343,7 @@ @@ -354,7 +354,7 @@ diff --git a/src/main/webapp/lab/patient_report.xhtml b/src/main/webapp/lab/patient_report.xhtml index 547ed1a4d1..2ccb39c642 100644 --- a/src/main/webapp/lab/patient_report.xhtml +++ b/src/main/webapp/lab/patient_report.xhtml @@ -534,7 +534,21 @@ - + + + +
+ + +
+ +
+
+
+
+ +
+ patientReport="#{patientReportController.currentPatientReport}"/>
-
-
+
+
diff --git a/src/main/webapp/lab_patient_report.xhtml b/src/main/webapp/lab_patient_report.xhtml deleted file mode 100644 index bb7ce27394..0000000000 --- a/src/main/webapp/lab_patient_report.xhtml +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - -
- - - - - - - - - -
-
- -
- - - - - - - - - - -
- - - - - -
-
- - - - - - - - - - -
- - - - - - -
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
-
- -
- - - - - - - - - - - - -

#{patientReportController.investigationItem}

- - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - - - -
-
- - - - - -
- -
- - -

A

- #{patientReportController.currentPatientReport} -

B

- - #{e.investigationItem.ixItemType} - -

C

- #{patientReportController.currentPatientReport.templateItem.lobValue} -

D

-

E

-
- - - -
- -
- -
- - -
- - - -
- - - -
- - - -
- -
- - -
- - - - - - - - - - - - - - -
- - - - - - -
- - -
- -
-
-
-
- - -
- - -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- -
-
- -
- - - -
-
- -
- -
-
-
-
- -
- -
-
- -
-
-
- - -
-
- -
-
-
- -
-
-
-
- -
- -
- - -
-
- -
-
-
- -
- -
-
- - -
-
- -
-
-
- -
-
-
-
-
- -
-
-
-
- -
- - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- ixItemType - - ixItemValueType - - - - - - - - - - -
- - - - - - - - - - - - - -
-
- - -
- - - -
- -
- From 78ffd4a30f2788cd6077de7a117c55e03cf247fa Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Sun, 11 Aug 2024 23:04:05 +0530 Subject: [PATCH 16/17] Signed-off-by: Dr M H B Ariyaratne --- .../java/com/divudi/bean/lab/PatientReportController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/divudi/bean/lab/PatientReportController.java b/src/main/java/com/divudi/bean/lab/PatientReportController.java index b3a0c948a1..92379a63c0 100644 --- a/src/main/java/com/divudi/bean/lab/PatientReportController.java +++ b/src/main/java/com/divudi/bean/lab/PatientReportController.java @@ -1158,7 +1158,7 @@ public void updateTemplate() { } } - // Replace placeholders in the template with values from the map + // Replace placeholders in the template with values from the map, or make them blank if no value is found String updatedHtmlText = templateItem.getHtmltext(); for (String placeholder : placeholders) { String replacementValue = replacementMap.get(placeholder); @@ -1166,11 +1166,13 @@ public void updateTemplate() { updatedHtmlText = updatedHtmlText.replace("{" + placeholder + "}", replacementValue); System.out.println("Replaced {" + placeholder + "} with " + replacementValue); } else { - System.out.println("No replacement found for placeholder {" + placeholder + "}"); + // Replace with an empty string if no replacement value is found + updatedHtmlText = updatedHtmlText.replace("{" + placeholder + "}", ""); + System.out.println("Replaced {" + placeholder + "} with an empty string."); } } - // Save the updated HTML text back to the patient-specific report item +// Save the updated HTML text back to the patient-specific report item for (PatientReportItemValue privHtml : currentPatientReport.getPatientReportItemValues()) { System.out.println("privHtml = " + privHtml); From d8ebc39463d09398f7cd8b27e3d02eb812e15253 Mon Sep 17 00:00:00 2001 From: Dr M H B Ariyaratne Date: Mon, 12 Aug 2024 04:26:53 +0530 Subject: [PATCH 17/17] Closes #6847 Signed-off-by: Dr M H B Ariyaratne --- .../com/divudi/ejb/PatientReportBean.java | 10 +- .../admin/lims/investigation_format.xhtml | 252 +++++++++--------- 2 files changed, 138 insertions(+), 124 deletions(-) diff --git a/src/main/java/com/divudi/ejb/PatientReportBean.java b/src/main/java/com/divudi/ejb/PatientReportBean.java index f831b467f4..16569a04dd 100644 --- a/src/main/java/com/divudi/ejb/PatientReportBean.java +++ b/src/main/java/com/divudi/ejb/PatientReportBean.java @@ -132,8 +132,14 @@ public String getDefaultVarcharValue(InvestigationItem item, Patient patient) { } public String getDefaultMemoValue(InvestigationItem item, Patient patient) { - //TODO: Create Logic - return ""; + String defaultValue = ""; + if(item==null){ + return defaultValue; + } + if(item.getHtmltext()!=null){ + defaultValue=item.getHtmltext(); + } + return defaultValue; } public byte[] getDefaultImageValue(InvestigationItem item, Patient patient) { diff --git a/src/main/webapp/admin/lims/investigation_format.xhtml b/src/main/webapp/admin/lims/investigation_format.xhtml index e0801d4cbb..0b6fe91fa4 100644 --- a/src/main/webapp/admin/lims/investigation_format.xhtml +++ b/src/main/webapp/admin/lims/investigation_format.xhtml @@ -9,27 +9,19 @@ - - - - - - - - - - - - - - - - - + + + +
+
+
+ + + - + @@ -343,7 +335,7 @@ @@ -354,7 +346,7 @@ @@ -629,113 +621,129 @@ +
+
+ + + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ + +
+
+
+ + + + +
+ + +
+
+
+ +
+
+ +
+
+ + +
+ +
+ + + + + + + + + + + - - - -

- - Press Following Keys for Making Changes - -
- Up Arrow - Move Up
- Down Arrow - Move Down
- Left Arrow - Move Left
- Right Arrow - Move Right
- d - delete
- b - bold
- i - italic
- n - remove bold and italic
- r - align right
- l - align left
- c - align centre
- j - justified
- g - grow font
- s - shrink font
- w - widen
- o - narrower
- t - taller
- h - shorter
-

-
- - - - - - - - - - - -
- - - - - - - -
- - - - - - - - - -
- -
- -
- - - - - - - - - - - - - - - - - -
-
-
-
-
-
+
-

#{investigationItemController.currentInvestigation.reportFormat}

+