diff --git a/pom.xml b/pom.xml index 309dfbdffb..65afc125dc 100644 --- a/pom.xml +++ b/pom.xml @@ -2,6 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.divudi + sethma 3.0.0 war diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index 9fdf181f64..5e2f98a257 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -139,11 +139,6 @@ public class FinancialTransactionController implements Serializable { private ReportTemplateRowBundle paymentSummaryBundle; - private Date fromDate; - private Date toDate; - - private ReportTemplateRowBundle paymentSummaryBundle; - // // public FinancialTransactionController() { diff --git a/src/main/java/com/divudi/bean/common/BillPackageController.java b/src/main/java/com/divudi/bean/common/BillPackageController.java index bbddbd3e93..550857e2b3 100644 --- a/src/main/java/com/divudi/bean/common/BillPackageController.java +++ b/src/main/java/com/divudi/bean/common/BillPackageController.java @@ -125,6 +125,11 @@ public class BillPackageController implements Serializable, ControllerWithPatien @Inject ConfigOptionApplicationController configOptionApplicationController; + private List malePackaes; + private List femalePackaes; + private List bothPackaes; + private List packaes; + // // private static final long serialVersionUID = 1L; @@ -221,7 +226,6 @@ public void putToBills() { } } myBill.setBillItems(list); - //////System.out.println("555"); getBillBean().calculateBillItems(myBill, tmp); bills.add(myBill); } @@ -288,7 +292,6 @@ public void cancellAll() { getBillSearch().setBill((BilledBill) b); getBillSearch().setPaymentMethod(b.getPaymentMethod()); getBillSearch().setComment("Batch Cancell"); - //////System.out.println("ggg : " + getBillSearch().getComment()); getBillSearch().cancelOpdBill(); } @@ -302,9 +305,7 @@ public void cancellAll() { private void saveBillItemSessions() { for (BillEntry be : lstBillEntries) { BillItem temBi = be.getBillItem(); - ////System.out.println("temBi = " + temBi); BillSession temBs = getServiceSessionBean().createBillSession(temBi); - ////System.out.println("temBs = " + temBs); temBi.setBillSession(temBs); if (temBs != null) { getBillSessionFacade().create(temBs); @@ -326,9 +327,7 @@ public void settleBill() { getBills().add(b); } else { - // //////System.out.println("11"); putToBills(); - // //////System.out.println("22"); } saveBatchBill(); @@ -354,7 +353,6 @@ public void settleBill() { saveBillItemSessions(); clearBillItemValues(); - //////System.out.println("33"); JsfUtil.addSuccessMessage( "Bill Saved"); @@ -798,8 +796,6 @@ private void addEntry(BillItem bi) { } public void addToBill() { -// System.out.println("getCurrentBillItem = " + getCurrentBillItem()); -// System.out.println("getCurrentBillItem.item = " + getCurrentBillItem().getItem().getName()); if (getLstBillEntries().size() > 0) { JsfUtil.addErrorMessage("You can not add more than on package at a time create new bill"); return; @@ -945,7 +941,7 @@ public void recreateList(BillEntry r) { for (BillEntry b : getLstBillEntries()) { if (b.getBillItem().getItem() != r.getBillItem().getItem()) { temp.add(b); - //////System.out.println(b.getBillItem().getNetValue()); + } } lstBillEntries = temp; @@ -1448,4 +1444,101 @@ public void setToStaff(Staff toStaff) { this.toStaff = toStaff; } + public List getMalePackaes() { + return malePackaes; + } + + public void setMalePackaes(List malePackaes) { + this.malePackaes = malePackaes; + } + + public List getFemalePackaes() { + return femalePackaes; + } + + public void setFemalePackaes(List femalePackaes) { + this.femalePackaes = femalePackaes; + } + + public List getBothPackaes() { + return bothPackaes; + } + + public void setBothPackaes(List bothPackaes) { + this.bothPackaes = bothPackaes; + } + + + + public List getGenderBasedPackaes() { + //System.out.println("getPackages"); + if (packaes == null) { + fillPackages(); + } + if (configOptionApplicationController.getBooleanValueByKey("Package bill – Reloading of Packages with Consideration of Gender")) { + //System.out.println("option ok"); + if (getPatient() == null) { + //System.out.println("pt is null"); + return packaes; + } else if (getPatient().getPerson().getSex() == null) { + //System.out.println("sex is null"); + return packaes; + } else if (getPatient().getPerson().getSex() == Sex.Male) { + //System.out.println("males"); + return malePackaes; + } else if (getPatient().getPerson().getSex() == Sex.Female) { + //System.out.println("females"); + return femalePackaes; + } else { + return bothPackaes; + } + } + return packaes; + } + + public void setPackaes(List packaes) { + this.packaes = packaes; + } + + public List getPackaes() { + if(packaes==null){ + packaes=itemController.getPackaes(); + fillPackages(); + } + return packaes; + } + + private void fillPackages() { + //System.out.println("fillPackages"); + packaes = itemController.getPackaes(); + //System.out.println("packaes = " + packaes); + if (packaes == null) { + return; + } + malePackaes = new ArrayList<>(); + femalePackaes = new ArrayList<>(); + bothPackaes = new ArrayList<>(); + for (Item i : packaes) { + //System.out.println("i = " + i); + if (i.getForGender() == null) { + //System.out.println("gender nill"); + bothPackaes.add(i); + } else if (i.getForGender().equalsIgnoreCase("Male")) { + //System.out.println("mp = " ); + malePackaes.add(i); + } else if (i.getForGender().equalsIgnoreCase("Female")) { + //System.out.println("fp = " ); + femalePackaes.add(i); + } else if (i.getForGender().equalsIgnoreCase("Both")) { + bothPackaes.add(i); + malePackaes.add(i); + femalePackaes.add(i); + } else { + bothPackaes.add(i); + } + } + } + + + } diff --git a/src/main/java/com/divudi/bean/common/ItemController.java b/src/main/java/com/divudi/bean/common/ItemController.java index 86fda9aa96..8508decc0e 100644 --- a/src/main/java/com/divudi/bean/common/ItemController.java +++ b/src/main/java/com/divudi/bean/common/ItemController.java @@ -32,6 +32,7 @@ import com.divudi.facade.ItemFeeFacade; import com.divudi.bean.common.util.JsfUtil; import com.divudi.data.SessionNumberType; +import com.divudi.data.Sex; import com.divudi.entity.UserPreference; import com.divudi.facade.DepartmentFacade; import com.divudi.facade.ItemMappingFacade; @@ -138,6 +139,7 @@ public class ItemController implements Serializable { private InstitutionItemCount institutionItemCount; private List suggestItems; boolean masterItem; + private Sex patientGender; ReportKeyWord reportKeyWord; @@ -1018,10 +1020,7 @@ public void unmarkSelectedItemsFeesChangableAtBilling() { } JsfUtil.addSuccessMessage("All Unmarked as Fees Changable at Billing"); } - - - - + public void markSelectedItemsAsPrintSessionNumber() { if (selectedList == null || selectedList.isEmpty()) { JsfUtil.addErrorMessage("Nothing is selected"); @@ -1045,7 +1044,6 @@ public void unmarkSelectedItemsAsNotToPrintSessionNumber() { } JsfUtil.addSuccessMessage("All Marked as Not to Print Session Numbers"); } - public void unmarkSelectedItemsAsDiscountableAtBilling() { if (selectedList == null || selectedList.isEmpty()) { @@ -1082,7 +1080,7 @@ public void unMarkSelectedItemsForPrintSeparateFees() { } JsfUtil.addSuccessMessage("All Unmarked for Print Separate Fees"); } - + public void addSessionNumberType() { if (selectedList == null || selectedList.isEmpty()) { JsfUtil.addErrorMessage("Nothing is selected"); @@ -1160,7 +1158,6 @@ public void setDepartments(List departments) { } public void createNewItemsFromMasterItems() { - ////// // System.out.println("createNewItemsFromMasterItems"); if (institution == null) { JsfUtil.addErrorMessage("Select institution"); return; @@ -1174,7 +1171,6 @@ public void createNewItemsFromMasterItems() { return; } for (Item i : selectedList) { - ////// // System.out.println("i.getName() = " + i.getName()); Item ni = null; if (i instanceof Investigation) { try { @@ -1203,13 +1199,9 @@ public void createNewItemsFromMasterItems() { ni.setItemFee(null); getFacade().create(ni); i.setItemFees(itemFeeManager.fillFees(i)); - ////// // System.out.println("ni = " + ni); - ////// // System.out.println("i.getItemFees() = " + i.getItemFees()); - ////// // System.out.println("ni.getItemFees() = " + ni.getItemFees()); for (ItemFee f : i.getItemFees()) { ItemFee nf = new ItemFee(); - ////// // System.out.println("f = " + f); try { BeanUtils.copyProperties(nf, f); } catch (IllegalAccessException | InvocationTargetException ex) { @@ -1225,7 +1217,6 @@ public void createNewItemsFromMasterItems() { nf.setItem(ni); ni.getItemFees().add(nf); getItemFeeFacade().create(nf); - ////// // System.out.println("nf = " + nf); } getFacade().edit(ni); List ifis = itemForItemController.getItemsForParentItem(i); @@ -1238,7 +1229,6 @@ public void createNewItemsFromMasterItems() { ifin.setCreater(getSessionController().getLoggedUser()); } } - ////// // System.out.println("ni.getItemFees() = " + ni.getItemFees()); } } @@ -1313,7 +1303,6 @@ public List completeDealorItem(String query) { + " (c.item.barcode) like :q or (c.item.code) like :q )order by c.item.name"; hm.put("ins", getInstitution()); hm.put("q", "%" + query + "%"); - //////// // System.out.println(sql); suggestions = getFacade().findByJpql(sql, hm, 20); } return suggestions; @@ -1330,7 +1319,6 @@ public List getDealorItem() { + " order by c.item.name"; hm.put("ins", getInstitution()); - //////// // System.out.println(sql); suggestions = getFacade().findByJpql(sql, hm); return suggestions; @@ -1419,24 +1407,6 @@ public List completeMasterItems(String query) { public List completeItem(String query) { return completeItem(query, null, null, 20); -// List suggestions; -// String sql; -// HashMap hm = new HashMap(); -// if (query == null) { -// suggestions = new ArrayList<>(); -// } else { -// sql = "select c from Item c " -// + " where c.retired=false" -// + " and ((c.name) like :q" -// + " or (c.barcode) like :q" -// + " or (c.code) like :q )" -// + " order by c.name"; -// hm.put("q", "%" + query.toUpperCase() + "%"); -////////// // System.out.println(sql); -// suggestions = getFacade().findByJpql(sql, hm, 20); -// } -// return suggestions; -// } List itemList; @@ -1665,7 +1635,6 @@ public List fetchStoreItem() { + " (type(c)= :amp) " + " and c.departmentType=:dep " + " order by c.name"; - //////// // System.out.println(sql); tmpMap.put("amp", Amp.class); tmpMap.put("dep", DepartmentType.Store); @@ -1688,7 +1657,6 @@ public List completeAmpAndAmppItem(String query) { sql = "select c from Item c where c.retired=false and (type(c)= :amp or type(c)=:ampp ) and ((c.name) like '%" + query.toUpperCase() + "%' or (c.code) like '%" + query.toUpperCase() + "%') order by c.name"; } -//////// // System.out.println(sql); tmpMap.put("amp", Amp.class); tmpMap.put("ampp", Ampp.class); suggestions = getFacade().findByJpql(sql, tmpMap, TemporalType.TIMESTAMP, 30); @@ -1720,18 +1688,21 @@ public List completeAmpAndVmpItem(String query) { } public List fillpackages() { - List suggestions; String sql; sql = "select c from Item c where c.retired=false" + " and (c.inactive=false or c.inactive is null) " + " and type(c)=Packege " + " order by c.name"; - //////// // System.out.println(sql); + //System.out.println("sql = " + sql); packaes = getFacade().findByJpql(sql); //System.out.println("packaes = " + packaes); + if (packaes == null) { + return new ArrayList<>(); + } return packaes; } + public List completePackage(String query) { List suggestions; String sql; @@ -1742,7 +1713,6 @@ public List completePackage(String query) { + " and (c.inactive=false or c.inactive is null) " + "and type(c)=Packege " + "and (c.name) like '%" + query.toUpperCase() + "%' order by c.name"; - //////// // System.out.println(sql); suggestions = getFacade().findByJpql(sql); } return suggestions; @@ -1920,7 +1890,6 @@ public List completeInwardItems(String query) { m.put("ward", InwardService.class); m.put("the", TheatreService.class); m.put("q", "%" + query.toUpperCase() + "%"); - // //////// // System.out.println(sql); suggestions = getFacade().findByJpql(sql, m, 20); } return suggestions; @@ -1943,7 +1912,6 @@ public void fillItemsForInward() { m.put("inv", Investigation.class); m.put("ward", InwardService.class); m.put("the", TheatreService.class); - // //////// // System.out.println(sql); suggestItems = getFacade().findByJpql(sql, m); } @@ -1976,7 +1944,6 @@ public List completeTheatreItems(String query) { // m.put("inv", Investigation.class); m.put("the", TheatreService.class); m.put("q", "%" + query.toUpperCase() + "%"); - // //////// // System.out.println(sql); suggestions = getFacade().findByJpql(sql, m, 20); } return suggestions; @@ -2159,10 +2126,8 @@ public List completeOpdItemsByNamesAndCodeInstitutionSpecificOrNotSpecific m.put("inv", Investigation.class); m.put("q", "%" + query.toUpperCase() + "%"); -// //// // System.out.println(sql); -// //// // System.out.println("m = " + m); mySuggestions = getFacade().findByJpql(sql, m, 20); -// //// // System.out.println("mySuggestions = " + mySuggestions); + return mySuggestions; } @@ -2225,7 +2190,7 @@ public List completeServicesPlusInvestigationsAll(String query) { m.put("ser", Service.class); m.put("inv", Investigation.class); m.put("q", "%" + query.toUpperCase() + "%"); - // //////// // System.out.println(sql); + mySuggestions = getFacade().findByJpql(sql, m, 20); } return mySuggestions; @@ -2278,7 +2243,7 @@ public List completeOpdItemsForItemListringStrategyLoggedInstitution(Strin m.put("ins", sessionController.getInstitution()); m.put("q", "%" + query.toUpperCase() + "%"); - // //////// // System.out.println(sql); + mySuggestions = getFacade().findByJpql(sql, m, 20); } return mySuggestions; @@ -2291,7 +2256,7 @@ public List completeItemWithoutPackOwn(String query) { suggestions = new ArrayList(); } else { sql = "select c from Item c where c.institution.id = " + getSessionController().getInstitution().getId() + " and c.retired=false and type(c)!=Packege and type(c)!=TimedItem and (c.name) like '%" + query.toUpperCase() + "%' order by c.name"; - //////// // System.out.println(sql); + suggestions = getFacade().findByJpql(sql); } return suggestions; @@ -2299,9 +2264,7 @@ public List completeItemWithoutPackOwn(String query) { public void makeSelectedAsMasterItems() { for (Item i : selectedList) { - ////// // System.out.println("i = " + i.getInstitution()); if (i.getInstitution() != null) { - ////// // System.out.println("i = " + i.getInstitution().getName()); i.setInstitution(null); getFacade().edit(i); } @@ -2330,7 +2293,6 @@ public List fetchOPDItemList(boolean ins) { m.put("inw", InwardService.class); m.put("ser", Service.class); m.put("inv", Investigation.class); - ////// // System.out.println(sql); items = getFacade().findByJpql(sql, m); return items; } @@ -2362,7 +2324,7 @@ public List fetchOPDItemFeeList(boolean ins, FeeType ftype) { m.put("inw", InwardService.class); m.put("ser", Service.class); m.put("inv", Investigation.class); - ////// // System.out.println(sql); + itemFees = getItemFeeFacade().findByJpql(sql, m); return itemFees; } @@ -3052,14 +3014,12 @@ public Department getFilterDepartment() { public void setFilterDepartment(Department filterDepartment) { this.filterDepartment = filterDepartment; - } public List getPackaes() { if (packaes == null) { packaes = fillpackages(); } - // System.out.println("getPackaes = " + packaes); return packaes; } @@ -3075,6 +3035,14 @@ public void setSuggestItems(List suggestItems) { this.suggestItems = suggestItems; } + public Sex getPatientGender() { + return patientGender; + } + + public void setPatientGender(Sex patientGender) { + this.patientGender = patientGender; + } + @FacesConverter("itemLightConverter") public static class ItemLightConverter implements Converter { diff --git a/src/main/java/com/divudi/entity/Item.java b/src/main/java/com/divudi/entity/Item.java index 6f32cccd5c..4e025c8647 100644 --- a/src/main/java/com/divudi/entity/Item.java +++ b/src/main/java/com/divudi/entity/Item.java @@ -1398,6 +1398,9 @@ public void setCanRemoveItemfromPackage(boolean canRemoveItemfromPackage) { } public String getForGender() { + if(forGender==null||forGender.trim().equals("")){ + forGender = "Both"; + } return forGender; } diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index 42fe5625f4..6d8623993e 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -2,14 +2,14 @@ - jdbc/hims + jdbc/arogya false - jdbc/himsAduit + jdbc/arogyaAudit false diff --git a/src/main/webapp/admin/pricing/package_name.xhtml b/src/main/webapp/admin/pricing/package_name.xhtml index 8c18479dac..74e689512c 100644 --- a/src/main/webapp/admin/pricing/package_name.xhtml +++ b/src/main/webapp/admin/pricing/package_name.xhtml @@ -91,6 +91,7 @@ id="cmbSex" value="#{packageNameController.current.forGender}" class="w-100"> + diff --git a/src/main/webapp/opd/opd_bill_package.xhtml b/src/main/webapp/opd/opd_bill_package.xhtml index aed333c8ee..abcdba8ea6 100644 --- a/src/main/webapp/opd/opd_bill_package.xhtml +++ b/src/main/webapp/opd/opd_bill_package.xhtml @@ -9,7 +9,8 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:ez="http://xmlns.jcp.org/jsf/composite/ezcomp" xmlns:pa="http://xmlns.jcp.org/jsf/composite/paymentMethod" - xmlns:common="http://xmlns.jcp.org/jsf/composite/ezcomp/common"> + xmlns:common="http://xmlns.jcp.org/jsf/composite/ezcomp/common" + xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"> > @@ -39,7 +40,377 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #{ps.person.name} + + + #{ps.person.phone} + + + #{ps.person.mobile} + + + + + + + + + + + + + + + + +
+
+ + + + + +
+
+ + + + + + +
+
+ +
+
+ + + + + + + +
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ +
+
+ +
+
+ +
+ + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -47,39 +418,19 @@ - + - - - - @@ -89,6 +440,15 @@ + + + + + @@ -100,6 +460,7 @@ process="advanced btnAddIx" update="tblBillItem pBillDetails pIxAdd msg" icon="fa fa-plus" + style="" class=" mx-1 ui-button-success my-2" action="#{billPackageController.addToBill()}" > @@ -108,118 +469,118 @@ - - - - - - - - -
- - -
-
- - + - - No - #{rowIndex+1} - - - Item - #{bi.billItem.item.name} - - - Fee - - - - - - Department - #{bi.billItem.item.department.name} - - +
+
+ + + + + + + + +
+ - + action="#{billPackageController.removeBillItem}" + ajax="false" /> +
+
+ + - - - - - - No - #{rowIndex+1} - - - Name - #{bix.item.name} - + + No + #{rowIndex+1} + + + Item + #{bi.billItem.item.name} + + + Fee + + + + + + Department + #{bi.billItem.item.department.name} + + + + - - - - - - No - #{rowIndex+1} - - - - Item - - - - - Fee - - - - - - - Payee - - - - - - - - - - -
-
+ + + + + + No + #{rowIndex+1} + + + Name + #{bix.item.name} + -
+ + + + + + No + #{rowIndex+1} + + + + Item + + + + + Fee + + + + + + + Payee + + + + + + + + + + + + -
-
@@ -236,18 +597,7 @@ listener="#{billPackageController.listnerForPaymentMethodChange}"/>
-
- +
- +
@@ -640,7 +980,6 @@