Cambiado tipo de datos de Date a LocalDate para pruebas médicas.
This commit is contained in:
@@ -46,7 +46,10 @@
|
|||||||
<p:ajax event="select" listener="#{mt.onSelectMT}" update="frmNEW,frmImage" />
|
<p:ajax event="select" listener="#{mt.onSelectMT}" update="frmNEW,frmImage" />
|
||||||
<o:converter converterId="omnifaces.ListConverter" list="#{mt.medicalTests}" />
|
<o:converter converterId="omnifaces.ListConverter" list="#{mt.medicalTests}" />
|
||||||
<p:column>
|
<p:column>
|
||||||
<h:outputText value="#{el.onlyDate} - #{el.type.testTypeName}" />
|
<h:outputText value="#{el.date}">
|
||||||
|
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" />
|
||||||
|
</h:outputText>
|
||||||
|
- <h:outputText value="#{el.type.testTypeName}" />
|
||||||
<br />
|
<br />
|
||||||
<h:outputText rendered="#{mt.patientFilterSelected == null}" value="#{el.patient.displayName}" style="font-size: 0.8em !important; font-style: italic;" />
|
<h:outputText rendered="#{mt.patientFilterSelected == null}" value="#{el.patient.displayName}" style="font-size: 0.8em !important; font-style: italic;" />
|
||||||
</p:column>
|
</p:column>
|
||||||
@@ -66,7 +69,7 @@
|
|||||||
<div class="ui-g-3">Fecha:</div>
|
<div class="ui-g-3">Fecha:</div>
|
||||||
<div class="ui-g-9">
|
<div class="ui-g-9">
|
||||||
<h:outputText value="#{mt.selected.date}">
|
<h:outputText value="#{mt.selected.date}">
|
||||||
<f:convertDateTime type="Date" pattern="dd/MM/yyyy" timeStyle="short" />
|
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" timeStyle="short" />
|
||||||
</h:outputText>
|
</h:outputText>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-3">Hora:</div>
|
<div class="ui-g-3">Hora:</div>
|
||||||
@@ -134,7 +137,9 @@
|
|||||||
<div class="ui-g-3">Fecha:</div>
|
<div class="ui-g-3">Fecha:</div>
|
||||||
<div class="ui-g-9">
|
<div class="ui-g-9">
|
||||||
<p:datePicker id="fecha" value="#{mt.selected.date}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
<p:datePicker id="fecha" value="#{mt.selected.date}" pattern="dd/MM/yyyy" showIcon="true" showButtonBar="true" autocomplete="true" required="true"
|
||||||
requiredMessage="Especifique la fecha de la prueba médica" />
|
requiredMessage="Especifique la fecha de la prueba médica">
|
||||||
|
<f:convertDateTime type="localDate" pattern="dd/MM/yyyy" timeStyle="short" />
|
||||||
|
</p:datePicker>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-g-3">Hora:</div>
|
<div class="ui-g-3">Hora:</div>
|
||||||
|
|||||||
@@ -1,11 +1,8 @@
|
|||||||
package TO;
|
package TO;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.text.DateFormat;
|
import java.time.LocalDate;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
@@ -22,7 +19,7 @@ public class MedicalTestTO implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private Date date;
|
private LocalDate date;
|
||||||
private LocalTime time;
|
private LocalTime time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String highresimage;
|
private String highresimage;
|
||||||
@@ -33,13 +30,13 @@ public class MedicalTestTO implements Serializable {
|
|||||||
|
|
||||||
public MedicalTestTO() {
|
public MedicalTestTO() {
|
||||||
super();
|
super();
|
||||||
this.date = new Date();
|
this.date = LocalDate.now();
|
||||||
this.time = LocalTime.now();
|
this.time = LocalTime.now();
|
||||||
this.patient = new PatientTO();
|
this.patient = new PatientTO();
|
||||||
this.specialistDoctor = new SpecialistDoctorTO();
|
this.specialistDoctor = new SpecialistDoctorTO();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MedicalTestTO(int id, Date date, LocalTime time, String observations, String highresimage, MedicalTestType type,
|
public MedicalTestTO(int id, LocalDate date, LocalTime time, String observations, String highresimage, MedicalTestType type,
|
||||||
PatientTO patiend, SpecialistDoctorTO specialistDoctor) {
|
PatientTO patiend, SpecialistDoctorTO specialistDoctor) {
|
||||||
this.setId(id);
|
this.setId(id);
|
||||||
this.setDate(date);
|
this.setDate(date);
|
||||||
@@ -59,11 +56,11 @@ public class MedicalTestTO implements Serializable {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDate() {
|
public LocalDate getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate(Date date) {
|
public void setDate(LocalDate date) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,11 +116,4 @@ public class MedicalTestTO implements Serializable {
|
|||||||
public String toString() {
|
public String toString() {
|
||||||
return Integer.toString(this.getId());
|
return Integer.toString(this.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOnlyDate() {
|
|
||||||
DateFormat df = DateFormat.getDateInstance(DateFormat.DATE_FIELD, new Locale("es", "ES"));
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
|
||||||
return sdf.format(this.getDate());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package TO;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlRootElement;
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
|
||||||
|
|||||||
@@ -619,19 +619,19 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
|
|||||||
return qsTO;
|
return qsTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MedicalTestTO getPOJOforMedicalTestJPA(MedicalTestJPA vi, int nestedProps) {
|
public MedicalTestTO getPOJOforMedicalTestJPA(MedicalTestJPA mt, int nestedProps) {
|
||||||
MedicalTestTO qsTO = null;
|
MedicalTestTO qsTO = null;
|
||||||
|
|
||||||
if (vi != null) {
|
if (mt != null) {
|
||||||
SpecialistDoctorJPA fd = null;
|
SpecialistDoctorJPA fd = null;
|
||||||
PatientJPA pat = null;
|
PatientJPA pat = null;
|
||||||
if (nestedProps > 0) {
|
if (nestedProps > 0) {
|
||||||
fd = vi.getSpecialistDoctor();
|
fd = mt.getSpecialistDoctor();
|
||||||
pat = vi.getPatient();
|
pat = mt.getPatient();
|
||||||
}
|
}
|
||||||
|
|
||||||
nestedProps--;
|
nestedProps--;
|
||||||
qsTO = new MedicalTestTO(vi.getId(), vi.getDate(), vi.getTime(), vi.getObservations(), vi.getHighresimage(), vi.getType(),
|
qsTO = new MedicalTestTO(mt.getId(), mt.getDate(), mt.getTime(), mt.getObservations(), mt.getHighresimage(), mt.getType(),
|
||||||
this.getPOJOforPatientJPA(pat, nestedProps), this.getPOJOforSpecialistDoctorJPA(fd, nestedProps));
|
this.getPOJOforPatientJPA(pat, nestedProps), this.getPOJOforSpecialistDoctorJPA(fd, nestedProps));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package ejb.medicalTest;
|
package ejb.medicalTest;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ejb.EJB;
|
import javax.ejb.EJB;
|
||||||
@@ -158,7 +158,7 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
|
|||||||
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
||||||
* @param observations
|
* @param observations
|
||||||
*/
|
*/
|
||||||
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, Date date, LocalTime time, MedicalTestType testType, String observations) throws Exception {
|
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, LocalDate date, LocalTime time, MedicalTestType testType, String observations) throws Exception {
|
||||||
SpecialistDoctorJPA specDoctor = entman.find(SpecialistDoctorJPA.class, doctorSpecialistID);
|
SpecialistDoctorJPA specDoctor = entman.find(SpecialistDoctorJPA.class, doctorSpecialistID);
|
||||||
PatientJPA pat = entman.find(PatientJPA.class, patientID);
|
PatientJPA pat = entman.find(PatientJPA.class, patientID);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package ejb.medicalTest;
|
package ejb.medicalTest;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.ejb.Remote;
|
import javax.ejb.Remote;
|
||||||
@@ -88,7 +88,7 @@ public interface MedicalTestFacadeRemote {
|
|||||||
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias magnéticas y TAC
|
||||||
* @param observations
|
* @param observations
|
||||||
*/
|
*/
|
||||||
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, Date date, LocalTime time, MedicalTestType testType, String observations) throws Exception;
|
public MedicalTestTO addMedicalTest(int patientID, int doctorSpecialistID, LocalDate date, LocalTime time, MedicalTestType testType, String observations) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recuperar una prueba médica por ID
|
* Recuperar una prueba médica por ID
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package jpa;
|
package jpa;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
@@ -36,7 +36,7 @@ public class MedicalTestJPA implements Serializable {
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
private int id;
|
private int id;
|
||||||
private Date date;
|
private LocalDate date;
|
||||||
private LocalTime time;
|
private LocalTime time;
|
||||||
private String observations;
|
private String observations;
|
||||||
private String highresimage;
|
private String highresimage;
|
||||||
@@ -57,7 +57,7 @@ public class MedicalTestJPA implements Serializable {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MedicalTestJPA(Date date, LocalTime time, String observations, String highresimage, MedicalTestType type, PatientJPA patient, SpecialistDoctorJPA specialistDoctor) {
|
public MedicalTestJPA(LocalDate date, LocalTime time, String observations, String highresimage, MedicalTestType type, PatientJPA patient, SpecialistDoctorJPA specialistDoctor) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.observations = observations;
|
this.observations = observations;
|
||||||
@@ -75,11 +75,11 @@ public class MedicalTestJPA implements Serializable {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getDate() {
|
public LocalDate getDate() {
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDate(Date date) {
|
public void setDate(LocalDate date) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package managedbean.visit;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.faces.application.FacesMessage;
|
import javax.faces.application.FacesMessage;
|
||||||
@@ -54,7 +52,6 @@ public class AddVisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
public void saveData() {
|
public void saveData() {
|
||||||
// Comprobamos que la fecha fijada para la visita no sea anterior a la actual
|
// Comprobamos que la fecha fijada para la visita no sea anterior a la actual
|
||||||
int error = 0;
|
int error = 0;
|
||||||
LocalTime midnight = LocalTime.MIDNIGHT;
|
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
if (this.date.isBefore(today)) {
|
if (this.date.isBefore(today)) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package managedbean.visit;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package managedbean.visit;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
@@ -37,7 +36,6 @@ public class UpdateVisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
public UpdateVisitMBean() {
|
public UpdateVisitMBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
@@ -95,7 +93,6 @@ public class UpdateVisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
// Administrador y paciente pueden actualizar la fecha y hora de la visita (excepto el resultado)
|
// Administrador y paciente pueden actualizar la fecha y hora de la visita (excepto el resultado)
|
||||||
// Comprobamos que la fecha fijada para la visita no sea anterior a la actual
|
// Comprobamos que la fecha fijada para la visita no sea anterior a la actual
|
||||||
int error = 0;
|
int error = 0;
|
||||||
LocalTime midnight = LocalTime.MIDNIGHT;
|
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
|
|
||||||
if (this.date.isBefore(today)) {
|
if (this.date.isBefore(today)) {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ package managedbean.visit;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ public class VisitMBean extends ManagedBeanBase implements Serializable {
|
|||||||
public VisitMBean() {
|
public VisitMBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
// Inicialización de variables y propiedades van aquí.
|
// Inicialización de variables y propiedades van aquí.
|
||||||
|
|||||||
Reference in New Issue
Block a user