Skip to content

Commit

Permalink
closes #10062
Browse files Browse the repository at this point in the history
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>
  • Loading branch information
DamithDeshan committed Jan 10, 2025
1 parent 2d370b0 commit 06cc404
Showing 1 changed file with 17 additions and 9 deletions.
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() != 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() != 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

0 comments on commit 06cc404

Please # to comment.