Skip to content

Commit

Permalink
Merge pull request #10063
Browse files Browse the repository at this point in the history
* Signed-off-by: DamithDeshan <[email protected]>

* Fixed #10013

* Signed-off-by: Lawan Samarasekara <[email protected]>

* Signed-off-by: Lawan Samarasekara <[email protected]>

* Merge branch 'coop-prod' of https://github.com/hmislk/hmis.git into I…

* Merge branch 'Issue#10013-Bug_Fix_on_OPD_Card_Can't_Add_Drug' of http…

* closes #10062

* Signed-off-by: DamithDeshan <[email protected]>
  • Loading branch information
DamithDeshan authored Jan 11, 2025
1 parent 7e0d50a commit 2ccd3a6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 21 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().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

0 comments on commit 2ccd3a6

Please sign in to comment.