Esqueleto de vista para visualizar una visita.
This commit is contained in:
@@ -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