diff --git a/src/main/java/com/divudi/bean/inward/AdmissionController.java b/src/main/java/com/divudi/bean/inward/AdmissionController.java index 05334f4ac7..d00b2ae1d4 100644 --- a/src/main/java/com/divudi/bean/inward/AdmissionController.java +++ b/src/main/java/com/divudi/bean/inward/AdmissionController.java @@ -754,7 +754,7 @@ public String navigateToListAdmissions() { clearSearchValues(); return "/inward/inpatient_search?faces-redirect=true;"; } - + public String navigateToListChildAdmissions() { perantAddmission = current; searchAdmissions(); @@ -1023,7 +1023,8 @@ private boolean errorCheck() { return true; } } - if (getCurrent().getAdmissionType().isRoomChargesAllowed() || getPatientRoom().getRoomFacilityCharge() != null) { + + if (getCurrent().getAdmissionType().isRoomChargesAllowed()) { if (getPatientRoom().getRoomFacilityCharge() == null) { JsfUtil.addErrorMessage("Select Room "); return true; @@ -1044,9 +1045,14 @@ private boolean errorCheck() { } } - if (getCurrent().getAdmissionType().isRoomChargesAllowed() || getPatientRoom().getRoomFacilityCharge() != null) { - if (getInwardBean().isRoomFilled(getPatientRoom().getRoomFacilityCharge().getRoom())) { - JsfUtil.addErrorMessage("Select Empty Room"); + if (getCurrent().getAdmissionType().isRoomChargesAllowed()) { + if (getPatientRoom() != null) { + if (getInwardBean().isRoomFilled(getPatientRoom().getRoomFacilityCharge().getRoom())) { + JsfUtil.addErrorMessage("Select Empty Room"); + return true; + } + } else { + JsfUtil.addErrorMessage("Room is Empty"); return true; } } @@ -1055,10 +1061,12 @@ private boolean errorCheck() { JsfUtil.addErrorMessage("Please Select Referring Doctor"); return true; } + if (getCurrent().getPatient() == null) { JsfUtil.addErrorMessage("Select Patient"); return true; } + if (getCurrent().getAdmissionType().getAdmissionTypeEnum().equals(AdmissionTypeEnum.DayCase) && sessionController.getApplicationPreference().getApplicationInstitution().equals(ApplicationInstitution.Cooperative)) { if (getCurrent().getComments() == null || getCurrent().getComments().isEmpty()) { JsfUtil.addErrorMessage("Please Add Reference No"); @@ -1170,11 +1178,11 @@ public void saveSelected() { savePatientAllergies(); saveGuardian(); boolean bhtCanBeEdited = configOptionApplicationController.getBooleanValueByKey("BHT Number can be edited at the time of admission"); - if(bhtText==null||bhtText.trim().equals("")){ + if (bhtText == null || bhtText.trim().equals("")) { bhtText = getInwardBean().getBhtText(getCurrent().getAdmissionType()); - }else{ - if(!bhtCanBeEdited){ - bhtText = getInwardBean().getBhtText(getCurrent().getAdmissionType()); + } else { + if (!bhtCanBeEdited) { + bhtText = getInwardBean().getBhtText(getCurrent().getAdmissionType()); } } // bhtText = getInwardBean().getBhtText(getCurrent().getAdmissionType()); diff --git a/src/main/java/com/divudi/bean/inward/BillBhtController.java b/src/main/java/com/divudi/bean/inward/BillBhtController.java index 37ba3d5e9c..df923b23b2 100644 --- a/src/main/java/com/divudi/bean/inward/BillBhtController.java +++ b/src/main/java/com/divudi/bean/inward/BillBhtController.java @@ -515,7 +515,7 @@ public void settleBill() { } //for daily return credit card transaction paymentMethod = null; - if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge() != null) { + if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom() != null) { settleBill(getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge().getDepartment(), getPatientEncounter().getPaymentMethod()); } else { settleBill(getPatientEncounter().getDepartment(), getPatientEncounter().getPaymentMethod()); @@ -628,7 +628,7 @@ private boolean errorCheck() { return true; } - if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge() != null) { + if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom() != null) { if (getPatientEncounter().getCurrentPatientRoom() == null) { return true; } @@ -728,7 +728,7 @@ public void addToBill() { return; } - if (patientEncounter.getAdmissionType().isRoomChargesAllowed() || patientEncounter.getCurrentPatientRoom().getRoomFacilityCharge() != null) { + if (patientEncounter.getAdmissionType().isRoomChargesAllowed() || patientEncounter.getCurrentPatientRoom() != null) { if (errorCheckForPatientRoomDepartment()) { return; } @@ -753,7 +753,7 @@ public void addToBill() { bItem.setQty(1.0); addingEntry.setBillItem(bItem); addingEntry.setLstBillComponents(getBillBean().billComponentsFromBillItem(bItem)); - if (patientEncounter.getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge() != null) { + if (patientEncounter.getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom() != null) { addingEntry.setLstBillFees(billFeeFromBillItemWithMatrix(bItem, getPatientEncounter(), getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge().getDepartment(), getPatientEncounter().getPaymentMethod())); } else { addingEntry.setLstBillFees(billFeeFromBillItemWithMatrix(bItem, getPatientEncounter(), getPatientEncounter().getDepartment(), getPatientEncounter().getPaymentMethod())); diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacySaleBhtController.java b/src/main/java/com/divudi/bean/pharmacy/PharmacySaleBhtController.java index a6da9adc9c..9cb3854503 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacySaleBhtController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacySaleBhtController.java @@ -740,7 +740,11 @@ public void settlePharmacyBhtIssue() { } BillTypeAtomic bta = BillTypeAtomic.DIRECT_ISSUE_INWARD_MEDICINE; BillType bt = BillType.PharmacyBhtPre; - settleBhtIssue(bt, bta, getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge().getDepartment()); + if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom() != null) { + settleBhtIssue(bt, bta, getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge().getDepartment()); + } else { + settleBhtIssue(bt, bta, getPatientEncounter().getDepartment()); + } } public void settlePharmacyBhtIssueAccept() { @@ -784,14 +788,18 @@ private boolean errorCheck() { return true; } - if (getPatientEncounter().getCurrentPatientRoom() == null) { - JsfUtil.addErrorMessage("Please Select Patient Room"); - return true; - } + if (getPatientEncounter().getAdmissionType().isRoomChargesAllowed() || getPatientEncounter().getCurrentPatientRoom() != null) { + + if (getPatientEncounter().getCurrentPatientRoom() == null) { + JsfUtil.addErrorMessage("Please Select Patient Room"); + return true; + } + + if (getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge() == null) { + JsfUtil.addErrorMessage("Please Set Room"); + return true; + } - if (getPatientEncounter().getCurrentPatientRoom().getRoomFacilityCharge() == null) { - JsfUtil.addErrorMessage("Please Set Room"); - return true; } if (getPatientEncounter().isDischarged()) {