From 2726d2564a5a16ec8547cf253cf628cd1847bacc Mon Sep 17 00:00:00 2001 From: Roberto Orden Erena Date: Thu, 26 Dec 2019 12:26:02 +0100 Subject: [PATCH] =?UTF-8?q?Cambiar=20nombre=20a=20TestType=20por=20Medical?= =?UTF-8?q?TestType=20para=20ser=20m=C3=A1s=20explicito=20y=20refactorizac?= =?UTF-8?q?i=C3=B3n=20de=20todos=20sus=20usos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.sources/MyHealth/src/TO/MedicalTestTO.java | 7 +++---- 1.sources/MyHealth/src/common/MedicalTestType.java | 4 ++-- .../src/ejb/medicalTest/MedicalTestFacadeBean.java | 2 +- .../src/ejb/medicalTest/MedicalTestFacadeRemote.java | 2 +- 1.sources/MyHealth/src/jpa/MedicalTestJPA.java | 10 +++++----- .../src/managedbean/medicalTest/QuestionsMBean.java | 1 - 6 files changed, 12 insertions(+), 14 deletions(-) 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;