Skip to content

Commit

Permalink
Merge pull request #6667 from hmislk/Issue#6666
Browse files Browse the repository at this point in the history
Issue#6666 Closes #6666
  • Loading branch information
DeshaniPubudu committed Jul 29, 2024
2 parents f87f00c + 267191a commit bba7e94
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,58 @@ public void fillToDepartmentPatientInvestigations() {

}


public void fillToSelectedDepartmentPatientInvestigations() {
Date startTime = new Date();

String jpql = "select pi "
+ " from PatientInvestigation pi "
+ " join pi.investigation i "
+ " join pi.billItem.bill b "
+ " join b.patient.person p "
+ " where "
+ " b.createdAt between :fromDate and :toDate "
+ " and pi.investigation.department=:dep ";

Map temMap = new HashMap();
temMap.put("toDate", getToDate());
temMap.put("fromDate", getFromDate());
temMap.put("dep", getReportKeyWord().getDepartment());

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
jpql += " and ((p.name) like :patientName )";
temMap.put("patientName", "%" + getSearchKeyword().getPatientName().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getBillNo() != null && !getSearchKeyword().getBillNo().trim().equals("")) {
jpql += " and ((b.insId) like :billNo )";
temMap.put("billNo", "%" + getSearchKeyword().getBillNo().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getPatientPhone() != null && !getSearchKeyword().getPatientPhone().trim().equals("")) {
jpql += " and ((p.phone) like :patientPhone )";
temMap.put("patientPhone", "%" + getSearchKeyword().getPatientPhone().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getItemName() != null && !getSearchKeyword().getItemName().trim().equals("")) {
jpql += " and ((i.name) like :itm )";
temMap.put("itm", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%");
}

if (patientEncounter != null) {
jpql += "and pi.encounter=:en";
temMap.put("en", patientEncounter);
}

jpql += " order by pi.id desc ";
//

patientInvestigations = getPatientInvestigationFacade().findByJpql(jpql, temMap, TemporalType.TIMESTAMP, 50);
checkRefundBillItems(patientInvestigations);

}


public void createPreRefundTable() {

bills = null;
Expand Down
9 changes: 9 additions & 0 deletions src/main/webapp/lab/search_for_reporting_ondemand.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@
forceSelection="true"
value="#{searchController.reportKeyWord.department}"
/>

<h:commandLink
id="btnSearch0"
action="#{searchController.fillToSelectedDepartmentPatientInvestigations()}"
styleClass="mt-2 btn btn-success">
<h:outputText value="Selected Department Only" />
<i class="fa fa-search" style="margin-left: 5px;"></i>
</h:commandLink>

<h:commandLink
id="btnSearch4"
action="#{searchController.fillToMyDepartmentPatientInvestigations()}"
Expand Down

0 comments on commit bba7e94

Please sign in to comment.