Skip to content

Commit

Permalink
Closes #5379
Browse files Browse the repository at this point in the history
Signed-off-by: Dr M H B Ariyaratne <buddhika.ari@gmail.com>
  • Loading branch information
buddhika75 committed May 26, 2024
1 parent 7f3c46b commit 023f002
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 19 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/divudi/bean/common/DoctorController.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public List<Doctor> completeDoctor(String query) {
return suggestions;
}



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

Expand All @@ -128,7 +130,7 @@ public String navigateToDoctorsIncludingConsultants() {
fillDoctorsIncludingConsultants();
return "/admin/staff/doctors_including_consultants?faces-redirect=true";
}

public String navigateToDoctorsExcludingConsultants() {
fillDoctorsExcludingConsultants();
return "/admin/staff/doctors_excluding_consultants?faces-redirect=true";
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/divudi/bean/hr/WorkingTimeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.divudi.entity.Doctor;
import com.divudi.entity.PatientEncounter;
import com.divudi.entity.Payment;
import com.divudi.entity.Speciality;
import com.divudi.entity.Staff;
import com.divudi.entity.inward.Admission;
import com.divudi.facade.BillFeeFacade;
Expand Down Expand Up @@ -106,6 +107,7 @@ public class WorkingTimeController implements Serializable {
@Inject
ConfigOptionApplicationController configOptionApplicationController;

private Speciality speciality;
List<WorkingTime> selectedItems;
private WorkingTime current;
private List<WorkingTime> items = null;
Expand Down Expand Up @@ -826,6 +828,30 @@ public void setPaymentMethod(PaymentMethod paymentMethod) {
this.paymentMethod = paymentMethod;
}

public Speciality getSpeciality() {
return speciality;
}

public void setSpeciality(Speciality speciality) {
this.speciality = speciality;
}

public List<Doctor> getListOfDoctors() {
List<Doctor> suggestions;
String sql;
sql = " select p from Doctor p "
+ " where p.retired=:ret ";
HashMap hm = new HashMap();
hm.put("ret", false);
if (speciality != null) {
sql += "and p.speciality=:sp ";
hm.put("sp", speciality);
}
sql += " order by p.person.name";
suggestions = getFacade().findByJpql(sql, hm);
return suggestions;
}

/**
*
*/
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<persistence version="2.2" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/sethmagc</jta-data-source>
<jta-data-source>jdbc/sethma</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
Expand Down
62 changes: 45 additions & 17 deletions src/main/webapp/opd/pay_doctor.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,58 @@
<h:panelGroup rendered="#{(webUserController.hasPrivilege('OpdBilling'))}" >

<h:form class="container-fluid" >
<p:panel >
<p:panel class="text-center">
<f:facet name="header" >
<h:outputText value="Pay Staff" >
</h:outputText>
</f:facet>

<p:panelGrid columns="4" class="w-75" rendered="#{workingTimeController.staff eq null}">
<p:panelGrid columns="2"
class="w-75 mx-auto"
rendered="#{workingTimeController.staff eq null}">
<f:facet name="header" >
<h:outputText value="Select Doctor" ></h:outputText>
</f:facet>

<p:outputLabel value="Doctor / Staff" ></p:outputLabel>
<p:autoComplete value="#{workingTimeController.staff}"
completeMethod="#{doctorController.completeDoctor}"
var="s"
itemLabel="#{s.person.name}"
itemValue="#{s}"
>
<p:column headerText="Speciality">
<h:outputText value="#{s.speciality.name}" ></h:outputText>
</p:column>
<p:column headerText="Doctor">
<h:outputText value="#{s.person.nameWithTitle}" ></h:outputText>
</p:column>
</p:autoComplete>
<p:selectOneMenu
id="acSpeciality"
filter="true"
filterMatchMode="contains"
value="#{workingTimeController.speciality}"
class="w-100 fullHeightListbox"
>
<p:ajax
event="change"
process="@this"
update="scStaff"
listener="#{bookingController.listnerStaffListForRowSelect}"/>
<f:selectItem itemLabel="All" ></f:selectItem>
<f:selectItems
value="#{doctorSpecialityController.selectedItems}"
var="spe"
itemValue="#{spe}"
itemLabel="#{spe.name}">
</f:selectItems>
</p:selectOneMenu>

<p:outputLabel value="Doctor / Staff" ></p:outputLabel>
<p:selectOneMenu
id="scStaff"
value="#{workingTimeController.staff}"
filter="true"
filterMatchMode="contains"
class="w-100"
>
<f:selectItems value="#{workingTimeController.listOfDoctors}"
var="s"
itemLabel="#{s.person.name}"
itemValue="#{s}"></f:selectItems>
</p:selectOneMenu>


<p:spacer rendered="#{not configOptionApplicationController.getBooleanValueByKey('OPD Doctor Payments can be given without closing the shift.')}"></p:spacer>

<p:commandButton
ajax="false"
value="Select for Shift Payments"
Expand All @@ -53,10 +80,11 @@
<p:commandButton
ajax="false"
value="Select for All Payments"
rendered="#{configOptionApplicationController.getBooleanValueByKey('OPD Doctor Payments can be given without closing the shift.')}"
action="#{workingTimeController.selectStaffForOpdPaymentForAll()}" ></p:commandButton>



</p:panelGrid>


Expand Down

0 comments on commit 023f002

Please sign in to comment.