Nueva vista para ver visitas de un día.
This commit is contained in:
78
1.sources/MyHealth/docroot/visit/VisitList.xhtml
Normal file
78
1.sources/MyHealth/docroot/visit/VisitList.xhtml
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||||
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
|
<ui:composition template="../header.xhtml">
|
||||||
|
<ui:define name="content">
|
||||||
|
<h:form id="frmVisitList">
|
||||||
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
|
<p:panel id="PanelUnderConstruction" header="Pagina en construcción de Visitas">
|
||||||
|
<div class="ui-g ui-fluid">
|
||||||
|
|
||||||
|
<div class="ui-g-3">
|
||||||
|
<p:outputLabel for="fecha" value="Ver agenda del día:" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-3">
|
||||||
|
<div class="ui-inputgroup">
|
||||||
|
<p:calendar id="fecha" value="#{VisitList.selectedDate}" pattern="dd/MM/yyyy" showButtonPanel="true" autocomplete="true" />
|
||||||
|
<p:commandButton value="Consultar" onclick="dtVisitList.getPaginator().setPage(0);"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-7">
|
||||||
|
<p:message for="fecha" display="text" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p:dataTable widgetVar="dtVisitList" var="v" value="#{VisitList.lazyDataModelVisitList}" lazy="true" paginator="true" rows="10" paginatorPosition="bottom"
|
||||||
|
paginatorAlwaysVisible="true" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
|
||||||
|
rowsPerPageTemplate="10,20,30,40">
|
||||||
|
<p:column headerText="Id" width="60px;">
|
||||||
|
<h:outputText value="#{v.id}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Fecha" width="auto">
|
||||||
|
<h:outputText value="#{v.date}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Hora" width="auto">
|
||||||
|
<h:outputText value="#{v.time}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Paciente" width="auto">
|
||||||
|
<h:outputText value="#{v.patient.displayName}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Observaciones" width="auto">
|
||||||
|
<h:outputText value="#{v.observations}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Resultado" width="auto">
|
||||||
|
<h:outputText value="#{v.result}" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<p:column headerText="Acción" width="80px;">
|
||||||
|
<p:commandButton value="Ver" action="showVisit" icon="pi pi-check" />
|
||||||
|
</p:column>
|
||||||
|
|
||||||
|
<f:facet name="paginatorBottomLeft">
|
||||||
|
<p:commandButton type="button" action="#{VisitList.showData}" icon="pi pi-refresh" onclick="PF('dtVisitList').getPaginator().setPage(0);" />
|
||||||
|
</f:facet>
|
||||||
|
</p:dataTable>
|
||||||
|
|
||||||
|
<div class="ui-g-12 ui-g-nopad">
|
||||||
|
<div class="ui-g-4 ui-md-4" />
|
||||||
|
<div class="ui-g-2 ui-md-2 ">
|
||||||
|
<p:commandButton validateClient="true" value="Consultar" update="frmVisitList" action="#{VisitList.consultar}" icon="pi pi-check" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-2 ui-md-2">
|
||||||
|
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||||
|
</div>
|
||||||
|
<div class="ui-g-4 ui-md-4" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p:panel>
|
||||||
|
</h:form>
|
||||||
|
</ui:define>
|
||||||
|
</ui:composition>
|
||||||
|
</html>
|
||||||
70
1.sources/MyHealth/src/managedbean/visit/VisitListMBean.java
Normal file
70
1.sources/MyHealth/src/managedbean/visit/VisitListMBean.java
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
package managedbean.visit;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import org.primefaces.model.LazyDataModel;
|
||||||
|
import org.primefaces.model.SortOrder;
|
||||||
|
|
||||||
|
import TO.VisitTO;
|
||||||
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
import managedbean.common.SessionUtils;
|
||||||
|
|
||||||
|
@Named("VisitList")
|
||||||
|
@RequestScoped
|
||||||
|
public class VisitListMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private int familyDoctorId;
|
||||||
|
private LazyDataModel<VisitTO> lazyDataModelVisitList;
|
||||||
|
private Date selectedDate;
|
||||||
|
|
||||||
|
public VisitListMBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
// El usuario actual es un medico de familia, recuperamos su Id de la sessión actual
|
||||||
|
this.familyDoctorId = Integer.valueOf(SessionUtils.getUserId());
|
||||||
|
this.selectedDate = new Date();
|
||||||
|
|
||||||
|
this.lazyDataModelVisitList = new LazyDataModel<VisitTO>() {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VisitTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
|
||||||
|
Long totalRowCount = getRemoteManagerMedicalTest().getPendingQuestionsCount(familyDoctorId);
|
||||||
|
this.setRowCount(totalRowCount.intValue());
|
||||||
|
|
||||||
|
return getRemoteManagerVisit().listAllScheduledVisitsPaged(familyDoctorId, selectedDate, (first / pageSize), pageSize);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public LazyDataModel<VisitTO> getLazyDataModelVisitList() {
|
||||||
|
return lazyDataModelVisitList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getSelectedDate() {
|
||||||
|
return selectedDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSelectedDate(Date selectedDate) {
|
||||||
|
this.selectedDate = selectedDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user