Skip to content

Commit

Permalink
#10079 improving microbiology report antibiotic list and print report (
Browse files Browse the repository at this point in the history
…#10080)

* Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>

* Signed-off-by: Buddhika Ariyaratne <buddhika.ari@gmail.com>

* closes #10079
Signed-off-by: DamithDeshan <hkddrajapaksha@gmail.com>

---------

Co-authored-by: Buddhika Ariyaratne <buddhika.ari@gmail.com>
Co-authored-by: Geeth Sandaru Madhushan <geeth.gsm@gmail.com>
  • Loading branch information
3 people authored Jan 12, 2025
1 parent 34a6f2d commit 018027c
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1882,12 +1882,7 @@ public void searchBillsWithoutSampleId() {
jpql += " AND pi.billItem.bill.toDepartment = :department";
params.put("department", getDepartment());
}

if (bills != null) {
jpql += " AND pi.billItem.bill IN :bills";
params.put("bills", getBills());
}


if (patientInvestigationStatus != null) {
jpql += " AND pi.billItem.bill.status = :status";
params.put("status", patientInvestigationStatus);
Expand Down Expand Up @@ -2309,7 +2304,7 @@ public void searchPatientReports() {

if (investigationName != null && !investigationName.trim().isEmpty()) {
jpql += " AND r.patientInvestigation.billItem.item.name like :investigation ";
params.put("investigation", "%"+ investigationName.trim() + "%");
params.put("investigation", "%" + investigationName.trim() + "%");
}

if (department != null) {
Expand Down Expand Up @@ -2759,7 +2754,7 @@ public void searchPatientInvestigationsWithoutSampleId() {

if (investigationName != null && !investigationName.trim().isEmpty()) {
jpql += " AND i.billItem.item.name like :investigation ";
params.put("investigation", "%"+ investigationName.trim() + "%");
params.put("investigation", "%" + investigationName.trim() + "%");
}

if (department != null) {
Expand Down Expand Up @@ -3117,14 +3112,12 @@ public void listBillItemsForLabs() {
btas.add(BillTypeAtomic.OPD_BILL_REFUND);
btas.add(BillTypeAtomic.OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);


btas.add(BillTypeAtomic.PACKAGE_OPD_BILL_WITH_PAYMENT);
btas.add(BillTypeAtomic.PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER);
btas.add(BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION);
btas.add(BillTypeAtomic.PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION);
btas.add(BillTypeAtomic.PACKAGE_OPD_BILL_REFUND);


// Starting from BillItem and joining to PatientInvestigation if needed
jpql = "SELECT DISTINCT b "
+ " FROM BillItem b "
Expand Down Expand Up @@ -3408,7 +3401,7 @@ public void searchPatientInvestigationsWithSampleId() {

if (investigationName != null && !investigationName.trim().isEmpty()) {
jpql += " AND i.billItem.item.name like :investigation ";
params.put("investigation", "%"+ investigationName.trim() + "%");
params.put("investigation", "%" + investigationName.trim() + "%");
}

if (department != null) {
Expand Down Expand Up @@ -4158,6 +4151,38 @@ public void markAsReceived() {
getLabReportSearchByInstitutionController().createPatientInvestigaationList();
}

private List<PatientReportItemValue> column1AntibioticList;
private List<PatientReportItemValue> column2AntibioticList;

public List<PatientReportItemValue> findAntibioticForMicrobiologyReport(List<PatientReportItemValue> ptivList) {
List<PatientReportItemValue> antibioticItems = new ArrayList<>();
column1AntibioticList = new ArrayList<>();
column2AntibioticList = new ArrayList<>();

for (PatientReportItemValue ptiv : ptivList) {
if (ptiv.getInvestigationItem().getIxItemType() == InvestigationItemType.Antibiotic && !ptiv.getInvestigationItem().isRetired()) {
if (ptiv.getStrValue() != null) {
if (!"".equals(ptiv.getStrValue())) {
antibioticItems.add(ptiv);
}
}
}
}

for (int i = 0; i < antibioticItems.size(); i++) {
if (i % 2 == 0) {
column1AntibioticList.add(antibioticItems.get(i));
} else {
column2AntibioticList.add(antibioticItems.get(i));
}
}

// System.out.println("Antibiotic = " + antibioticItems.size());
// System.out.println("Column 1 = " + column1AntibioticList.size());
// System.out.println("Column 2 = " + column2AntibioticList.size());
return antibioticItems;
}

public void markSelectedAsReceived() {
for (PatientInvestigation pi : getSelectedToReceive()) {
pi.setReceived(Boolean.TRUE);
Expand Down Expand Up @@ -4943,6 +4968,22 @@ public void setInvestigationName(String investigationName) {
this.investigationName = investigationName;
}

public List<PatientReportItemValue> getColumn1AntibioticList() {
return column1AntibioticList;
}

public void setColumn1AntibioticList(List<PatientReportItemValue> column1AntibioticList) {
this.column1AntibioticList = column1AntibioticList;
}

public List<PatientReportItemValue> getColumn2AntibioticList() {
return column2AntibioticList;
}

public void setColumn2AntibioticList(List<PatientReportItemValue> column2AntibioticList) {
this.column2AntibioticList = column2AntibioticList;
}

/**
*
*/
Expand Down
Loading

0 comments on commit 018027c

Please sign in to comment.