Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

10062 cannot admit opd cards without room no #10063

Open
wants to merge 8 commits into
base: coop-prod
Choose a base branch
from
26 changes: 17 additions & 9 deletions src/main/java/com/divudi/bean/inward/AdmissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public String navigateToListAdmissions() {
clearSearchValues();
return "/inward/inpatient_search?faces-redirect=true;";
}

public String navigateToListChildAdmissions() {
perantAddmission = current;
searchAdmissions();
Expand Down Expand Up @@ -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;
Expand All @@ -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;
}
}
Expand All @@ -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");
Expand Down Expand Up @@ -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());
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/divudi/bean/inward/BillBhtController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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()) {
Expand Down