Esqueleto de vista para visualizar una visita.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<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">
|
||||
|
||||
<f:viewParam name="id" value="#{VisitView.id}" required="true" />
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="visitForm">
|
||||
@@ -15,7 +16,7 @@
|
||||
<p:outputLabel for="paciente" value="Paciente:" />
|
||||
</div>
|
||||
<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 class="ui-g-2">
|
||||
<p:message for="paciente" display="text" />
|
||||
@@ -25,7 +26,7 @@
|
||||
<p:outputLabel for="medico" value="Médico de familia:" />
|
||||
</div>
|
||||
<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 class="ui-g-2">
|
||||
<p:message for="medico" display="text" />
|
||||
|
||||
@@ -3,11 +3,17 @@ package managedbean.visit;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Time;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.PatientTO;
|
||||
import TO.VisitTO;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
|
||||
@Named("VisitView")
|
||||
@@ -16,12 +22,13 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Integer id;
|
||||
private Date date;
|
||||
private Time time;
|
||||
private String observations;
|
||||
private String result;
|
||||
private String patientDisplayName;
|
||||
private String familyDoctorDisplayName;
|
||||
private PatientTO patient;
|
||||
private FamilyDoctorTO familyDoctor;
|
||||
|
||||
public VisitMBean() {
|
||||
}
|
||||
@@ -29,9 +36,31 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// Inicialización de variables y propiedades van aquí.
|
||||
FacesContext context = FacesContext.getCurrentInstance();
|
||||
|
||||
// Como realizar llamadas al EJB Remoto
|
||||
// this.getRemoteManagerSystemAdmin().MetodoEJB
|
||||
Map<String, String> requestParams = context.getExternalContext().getRequestParameterMap();
|
||||
|
||||
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() {
|
||||
@@ -70,12 +99,28 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getPatientDisplayName() {
|
||||
return patientDisplayName;
|
||||
public PatientTO getPatient() {
|
||||
return patient;
|
||||
}
|
||||
|
||||
public String getFamilyDoctorDisplayName() {
|
||||
return familyDoctorDisplayName;
|
||||
public void setPatient(PatientTO patient) {
|
||||
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