Skip to content

Commit

Permalink
Merge pull request #6828 from hmislk/Issue#6827
Browse files Browse the repository at this point in the history
Issue#6827 Closes #6827
  • Loading branch information
Irani96 authored Aug 20, 2024
2 parents c112f5b + 9781804 commit 37a0696
Show file tree
Hide file tree
Showing 55 changed files with 3,829 additions and 634 deletions.
57 changes: 29 additions & 28 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>

<artifactId>ruhunu-dev</artifactId>
<artifactId>demo</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>ruhunu-dev</name>
<name>demo</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand All @@ -15,6 +15,32 @@
</properties>

<dependencies>
<!-- HAPI FHIR -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>6.1.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r5</artifactId>
<version>6.1.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v24</artifactId>
<version>2.3</version>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
Expand Down Expand Up @@ -245,32 +271,7 @@
<version>2.0</version>
</dependency>

<!-- HAPI FHIR -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>6.1.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r5</artifactId>
<version>6.1.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-base</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v24</artifactId>
<version>2.3</version>
</dependency>


<!-- Java EE -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@
package com.divudi.bean.channel;

import com.divudi.bean.common.*;
import com.divudi.entity.Doctor;
import com.divudi.entity.Institution;
import com.divudi.entity.Speciality;
import com.divudi.entity.Staff;
import com.divudi.entity.channel.SessionInstance;
import com.divudi.facade.SessionInstanceFacade;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.faces.component.UIComponent;
Expand All @@ -22,6 +30,7 @@
import javax.faces.convert.FacesConverter;
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.TemporalType;

/**
*
Expand Down Expand Up @@ -59,6 +68,38 @@ public void save(SessionInstance pa) {
}

public SessionInstanceController() {
}

public List<SessionInstance> findSessionInstance(Institution institution ,Speciality speciality, Doctor consultant, Date fromDate, Date toDate) {
List<SessionInstance> sessionInstances;
Date currentDate = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(currentDate);
calendar.add(Calendar.DAY_OF_MONTH, 2);
Map<String, Object> m = new HashMap<>();
StringBuilder jpql = new StringBuilder("select i from "
+ " SessionInstance i "
+ " where i.retired=:ret "
+ " and i.sessionDate BETWEEN :fd AND :td ");
if (consultant != null) {
jpql.append(" and i.originatingSession.staff=:os");
m.put("os", consultant);
}
if (institution != null) {
jpql.append(" and i.originatingSession.institution=:ins");
m.put("ins", institution);
}
if (speciality != null) {
jpql.append(" and i.originatingSession.staff.speciality in :spe ");
m.put("spe", speciality);
}
m.put("ret", false);
m.put("fd", fromDate);
m.put("td", toDate);
sessionInstances = ejbFacade.findByJpql(jpql.toString(), m, TemporalType.DATE);
return sessionInstances;


}

public SessionInstanceFacade getFacade() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/divudi/bean/common/BillBeanController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.divudi.data.dataStructure.PaymentMethodData;
import com.divudi.data.inward.InwardChargeType;
import com.divudi.data.inward.SurgeryBillType;
import com.divudi.data.lab.PatientInvestigationStatus;
import com.divudi.ejb.ServiceSessionBean;
import com.divudi.entity.Bill;
import com.divudi.entity.BillComponent;
Expand Down Expand Up @@ -3386,6 +3387,9 @@ private void savePatientInvestigation(BillEntry e, BillComponent bc, WebUser wu)

ptIx.setCreatedAt(Calendar.getInstance().getTime());
ptIx.setCreater(wu);

ptIx.setStatus(PatientInvestigationStatus.ORDERED);


ptIx.setBillItem(e.getBillItem());
ptIx.setBillComponent(bc);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/divudi/bean/common/BillSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
import javax.persistence.TemporalType;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import kotlin.collections.ArrayDeque;
import org.apache.commons.beanutils.BeanUtils;
import org.primefaces.event.RowEditEvent;
import org.primefaces.model.LazyDataModel;
Expand Down Expand Up @@ -1717,7 +1716,7 @@ private boolean saveRefundBill(Bill rb) {
billController.saveBillItem(bi);
}

List<Bill> refundBills = new ArrayDeque<>();
List<Bill> refundBills = new ArrayList<>();
refundBills.addAll(bill.getRefundBills());
refundBills.add(rb);

Expand Down
15 changes: 14 additions & 1 deletion src/main/java/com/divudi/bean/common/DepartmentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public List<Department> getInstitutionDepatrments(Institution ins, DepartmentTyp
public List<Department> getInstitutionDepatrments(DepartmentType departmentType) {
return getInstitutionDepatrments(null, true, departmentType);
}

public List<Department> getInstitutionDepatrments(Institution ins) {
return getInstitutionDepatrments(ins, true, null);
}
Expand Down Expand Up @@ -696,6 +696,19 @@ public Department findDepartment(Long id) {
return getFacade().find(id);
}

public Department findDepartment(String strId) {
if (strId == null) {
return null;
}
Long id;
try {
id = Long.valueOf(strId);
} catch (Exception e) {
return null;
}
return getFacade().find(id);
}

public Department getSuperDepartment() {
return superDepartment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ public void prepareToAddNew() {
current.setMachine(machine);

}

public void clearDeptAndDept() {
department=null;
institution=null;
department = null;
institution = null;
}

public void save(DepartmentMachine depMachine) {
Expand Down Expand Up @@ -130,6 +130,50 @@ public DepartmentMachine getCurrent() {
return current;
}

public DepartmentMachine findDepartmentMachine(Long id) {
return ejbFacade.find(id);
}

public DepartmentMachine findDepartmentMachine(String strId) {
if (strId == null) {
return null;
}
Long id;
try {
id = Long.valueOf(strId);
} catch (Exception e) {
return null;
}
return ejbFacade.find(id);
}

public DepartmentMachine findDepartmentMachine(Department department, Machine machine, boolean createNewIfNotFound) {
if (department == null) {
return null;
}
if (machine == null) {
return null;
}
Map parameters = new HashMap();
String jpql = "select dm "
+ " from DepartmentMachine dm "
+ " where dm.retired=:ret "
+ " and dm.department=:dep "
+ " and dm.setMachine=:ma ";
parameters.put("dep", department);
parameters.put("ma", machine);
DepartmentMachine dm = ejbFacade.findFirstByJpql(jpql, parameters);
if (dm == null) {
if (createNewIfNotFound) {
dm = new DepartmentMachine();
dm.setDepartment(department);
dm.setMachine(machine);
ejbFacade.create(dm);
}
}
return dm;
}

public void setCurrent(DepartmentMachine current) {
this.current = current;
}
Expand Down
17 changes: 15 additions & 2 deletions src/main/java/com/divudi/bean/common/EnumController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
import com.divudi.data.inward.AdmissionTypeEnum;
import com.divudi.data.inward.InwardChargeType;
import com.divudi.data.inward.PatientEncounterComponentType;
import com.divudi.data.lab.PatientInvestigationStatus;
import com.divudi.data.lab.Priority;
import com.divudi.data.lab.SearchDateType;
import com.divudi.entity.PaymentScheme;
import com.divudi.entity.Person;
import java.io.Serializable;
Expand Down Expand Up @@ -78,6 +80,7 @@ public class EnumController implements Serializable {
private List<PaymentMethod> paymentMethodsForPatientDeposit;
private List<PaymentMethod> paymentMethodsForOpdBillCanceling;
SessionNumberType[] sessionNumberTypes;
private List<PatientInvestigationStatus> patientInvestigationStatuses;

@PostConstruct
public void init() {
Expand Down Expand Up @@ -190,6 +193,10 @@ public void fillPaymentMethodsForPharmacyBilling() {
}
}

public List<SearchDateType> getSearchDateTypes() {
return Arrays.asList(SearchDateType.values());
}

public List<String> getEnumValues(String enumClassName) {
try {
Class<?> enumClass = Class.forName(enumClassName);
Expand All @@ -214,8 +221,9 @@ public <E extends Enum<E>> E getEnumValue(Class<E> enumType, String enumName) {
return null; // Return null if no match is found
}

public Priority[] getPriorities() {
return Priority.values();

public List<Priority> getPriorities() {
return Arrays.asList(Priority.values());
}

public Dashboard[] getDashboardTypes() {
Expand All @@ -227,6 +235,11 @@ public SessionNumberType[] getSessionNumberTypes() {
return sessionNumberTypes;
}

public List<PatientInvestigationStatus> getPatientInvestigationStatuses() {
patientInvestigationStatuses = Arrays.asList(PatientInvestigationStatus.values());
return patientInvestigationStatuses;
}

public List<LoginPage> getLoginPages() {
return Arrays.asList(LoginPage.values());
}
Expand Down
17 changes: 9 additions & 8 deletions src/main/java/com/divudi/bean/common/InstitutionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public String toEditInstitution() {
}
return "/admin/institutions/institution?faces-redirect=true";
}
public void makeNull(){

public void makeNull() {
current = null;

}

public String deleteInstitution() {
Expand Down Expand Up @@ -247,8 +247,6 @@ public List<Institution> getAgencies() {
agencies = completeInstitution(selectText, InstitutionType.Agency);
}



return agencies;
}

Expand Down Expand Up @@ -357,7 +355,7 @@ public Institution findAndSaveInstitutionByName(String name) {
+ " where i.name=:name"
+ " and i.retired=:ret";
Institution i = getFacade().findFirstByJpql(sql, m);

if (i == null) {
i = new Institution();
i.setName(name);
Expand All @@ -368,7 +366,7 @@ public Institution findAndSaveInstitutionByName(String name) {
}
return i;
}

public Institution findAndSaveInstitutionByCode(String code) {
if (code == null || code.trim().equals("")) {
return null;
Expand All @@ -384,7 +382,7 @@ public Institution findAndSaveInstitutionByCode(String code) {
Institution i = getFacade().findFirstByJpql(sql, m);
return i;
}

public Institution findExistingInstitutionByName(String name) {
if (name == null || name.trim().equals("")) {
return null;
Expand Down Expand Up @@ -616,6 +614,9 @@ public void createAgentCreditLimitUpdateHistory(Institution ins, double historyV
}

public Institution findInstitution(Long id) {
if (id == null) {
return null;
}
return getFacade().find(id);
}

Expand Down
Loading

0 comments on commit 37a0696

Please sign in to comment.