diff --git a/1.sources/MyHealth/src/TO/MedicalTestTO.java b/1.sources/MyHealth/src/TO/MedicalTestTO.java index 1836589..79f8e21 100644 --- a/1.sources/MyHealth/src/TO/MedicalTestTO.java +++ b/1.sources/MyHealth/src/TO/MedicalTestTO.java @@ -5,6 +5,8 @@ import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; +import common.MedicalTestType; + /** * * @author Roberto Orden Erena @@ -23,10 +25,7 @@ public class MedicalTestTO implements Serializable { private MedicalTestType type; private PatientTO patient; private SpecialistDoctorTO specialistDoctor; - - public static enum MedicalTestType { - BLOD_TEST, MAGNETIC_RESONANCE, TAC - } + public MedicalTestTO(int id, Date date, int time, String observations, String highresimage, MedicalTestType type, PatientTO patiend, SpecialistDoctorTO specialistDoctor) { diff --git a/1.sources/MyHealth/src/common/MedicalTestType.java b/1.sources/MyHealth/src/common/MedicalTestType.java index d413bdd..8f8df1a 100644 --- a/1.sources/MyHealth/src/common/MedicalTestType.java +++ b/1.sources/MyHealth/src/common/MedicalTestType.java @@ -5,12 +5,12 @@ package common; * @author Marcos García Núñez (mgarcianun@uoc.edu) * */ -public enum TestType { +public enum MedicalTestType { MAGNETIC_RESONANCE_IMAGING("Imagen por Resonancia Magnética"), CT_SCAN("Tomografía Áxial Computerizada"), BLOOD_TEST("Análisis de sangre"); private String testTypeName; - private TestType(String typeName) { + private MedicalTestType(String typeName) { this.testTypeName = typeName; } diff --git a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeBean.java b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeBean.java index 53ad005..18a9f76 100644 --- a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeBean.java +++ b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeBean.java @@ -12,8 +12,8 @@ import javax.persistence.TypedQuery; import TO.LoggedUserTO; import TO.MedicalSpecialtyTO; -import TO.MedicalTestTO.MedicalTestType; import TO.QuestionTO; +import common.MedicalTestType; import common.QuestionStatus; import common.UserType; import ejb.common.CommonFacadeLocal; diff --git a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java index ac7b219..199aadb 100644 --- a/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java +++ b/1.sources/MyHealth/src/ejb/medicalTest/MedicalTestFacadeRemote.java @@ -6,8 +6,8 @@ import java.util.List; import javax.ejb.Remote; import TO.MedicalSpecialtyTO; -import TO.MedicalTestTO.MedicalTestType; import TO.QuestionTO; +import common.MedicalTestType; /** * Interfaz remota del EJB Definimos los métodos que estarán disponibles para diff --git a/1.sources/MyHealth/src/jpa/MedicalTestJPA.java b/1.sources/MyHealth/src/jpa/MedicalTestJPA.java index 9dc8d3a..963c96a 100644 --- a/1.sources/MyHealth/src/jpa/MedicalTestJPA.java +++ b/1.sources/MyHealth/src/jpa/MedicalTestJPA.java @@ -14,7 +14,7 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; -import common.TestType; +import common.MedicalTestType; /** * Los nombres de los decortadores relacionados con la BBDD pueden estar en @@ -42,7 +42,7 @@ public class MedicalTestJPA implements Serializable { @Enumerated(EnumType.STRING) @Column(name = "type") // Con esto podríamos cambiar los nombres de las propiedades de la clase y // mantener la relación con la BBDD a través de JPA - private TestType type; + private MedicalTestType type; @ManyToOne @JoinColumn(name = "patientid") @@ -56,7 +56,7 @@ public class MedicalTestJPA implements Serializable { super(); } - public MedicalTestJPA(int id, Date date, long time, String observations, String highresimage, TestType type, PatientJPA patient, SpecialistDoctorJPA specialistDoctor) { + public MedicalTestJPA(int id, Date date, long time, String observations, String highresimage, MedicalTestType type, PatientJPA patient, SpecialistDoctorJPA specialistDoctor) { this.id = id; this.date = date; this.time = time; @@ -107,11 +107,11 @@ public class MedicalTestJPA implements Serializable { this.highresimage = highresimage; } - public TestType getType() { + public MedicalTestType getType() { return type; } - public void setType(TestType type) { + public void setType(MedicalTestType type) { this.type = type; } diff --git a/1.sources/MyHealth/src/managedbean/medicalTest/QuestionsMBean.java b/1.sources/MyHealth/src/managedbean/medicalTest/QuestionsMBean.java index b8d4f4e..84d64e0 100644 --- a/1.sources/MyHealth/src/managedbean/medicalTest/QuestionsMBean.java +++ b/1.sources/MyHealth/src/managedbean/medicalTest/QuestionsMBean.java @@ -9,7 +9,6 @@ import javax.inject.Named; import org.primefaces.event.SelectEvent; -import TO.PatientTO; import TO.QuestionTO; import common.QuestionStatus; import common.UserType;