Esqueleto de vista para visualizar una visita.
This commit is contained in:
@@ -3,7 +3,8 @@
|
|||||||
|
|
||||||
<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"
|
<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">
|
xmlns:p="http://primefaces.org/ui">
|
||||||
|
|
||||||
|
<f:viewParam name="id" value="#{VisitView.id}" required="true" />
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="visitForm">
|
<h:form id="visitForm">
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
<p:outputLabel for="paciente" value="Paciente:" />
|
<p:outputLabel for="paciente" value="Paciente:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-8">
|
<div class="ui-g-8">
|
||||||
<p:inputText id="paciente" value="#{VisitView.patientDisplayName}" readonly="true" />
|
<p:inputText id="paciente" value="#{VisitView.patient.displayName}" readonly="true" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<p:message for="paciente" display="text" />
|
<p:message for="paciente" display="text" />
|
||||||
@@ -25,7 +26,7 @@
|
|||||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
<p:outputLabel for="medico" value="Médico de familia:" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-8">
|
<div class="ui-g-8">
|
||||||
<p:inputText id="medico" value="#{VisitView.familyDoctorDisplayName}" readonly="true" />
|
<p:inputText id="medico" value="#{VisitView.familyDoctor.displayName}" readonly="true" />
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2">
|
<div class="ui-g-2">
|
||||||
<p:message for="medico" display="text" />
|
<p:message for="medico" display="text" />
|
||||||
|
|||||||
@@ -3,11 +3,17 @@ package managedbean.visit;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.sql.Time;
|
import java.sql.Time;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
|
import javax.faces.context.FacesContext;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import TO.FamilyDoctorTO;
|
||||||
|
import TO.PatientTO;
|
||||||
|
import TO.VisitTO;
|
||||||
import managedbean.common.ManagedBeanBase;
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
|
||||||
@Named("VisitView")
|
@Named("VisitView")
|
||||||
@@ -16,12 +22,13 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
private Date date;
|
private Date date;
|
||||||
private Time time;
|
private Time time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String result;
|
private String result;
|
||||||
private String patientDisplayName;
|
private PatientTO patient;
|
||||||
private String familyDoctorDisplayName;
|
private FamilyDoctorTO familyDoctor;
|
||||||
|
|
||||||
public VisitMBean() {
|
public VisitMBean() {
|
||||||
}
|
}
|
||||||
@@ -29,9 +36,31 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
// Inicialización de variables y propiedades van aquí.
|
// Inicialización de variables y propiedades van aquí.
|
||||||
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
|
||||||
// Como realizar llamadas al EJB Remoto
|
Map<String, String> requestParams = context.getExternalContext().getRequestParameterMap();
|
||||||
// this.getRemoteManagerSystemAdmin().MetodoEJB
|
|
||||||
|
VisitTO vi = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Parámetro con el "name" de la especialidad a editar.
|
||||||
|
int id = Integer.valueOf(requestParams.get("id").toString());
|
||||||
|
|
||||||
|
vi = this.getRemoteManagerVisit().getVisit(id);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.manageException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vi != null) {
|
||||||
|
this.date = vi.getDate();
|
||||||
|
this.time = vi.getTime();
|
||||||
|
this.observations = vi.getObservations();
|
||||||
|
this.result = vi.getResult();
|
||||||
|
this.patient = vi.getPatient();
|
||||||
|
this.familyDoctor = vi.getFamilyDoctor();
|
||||||
|
} else {
|
||||||
|
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Identificador de visita no válido", "No se ha podido recuperar el identificador de visita especificado. Por favor, vuelva a intentarlo seleccionando de nuevo la visita.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveData() {
|
public void saveData() {
|
||||||
@@ -70,12 +99,28 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
this.result = result;
|
this.result = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPatientDisplayName() {
|
public PatientTO getPatient() {
|
||||||
return patientDisplayName;
|
return patient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFamilyDoctorDisplayName() {
|
public void setPatient(PatientTO patient) {
|
||||||
return familyDoctorDisplayName;
|
this.patient = patient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FamilyDoctorTO getFamilyDoctor() {
|
||||||
|
return familyDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFamilyDoctor(FamilyDoctorTO familyDoctor) {
|
||||||
|
this.familyDoctor = familyDoctor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user