Cambiar nombre a TestType por MedicalTestType para ser más explicito

y refactorización de todos sus usos.
This commit is contained in:
Roberto Orden Erena
2019-12-26 12:26:02 +01:00
parent 066ddeba51
commit 2726d2564a
6 changed files with 12 additions and 14 deletions

View File

@@ -5,6 +5,8 @@ import java.util.Date;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
import common.MedicalTestType;
/** /**
* *
* @author Roberto Orden Erena <rorden@uoc.edu> * @author Roberto Orden Erena <rorden@uoc.edu>
@@ -24,9 +26,6 @@ public class MedicalTestTO implements Serializable {
private PatientTO patient; private PatientTO patient;
private SpecialistDoctorTO specialistDoctor; 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, public MedicalTestTO(int id, Date date, int time, String observations, String highresimage, MedicalTestType type,
PatientTO patiend, SpecialistDoctorTO specialistDoctor) { PatientTO patiend, SpecialistDoctorTO specialistDoctor) {

View File

@@ -5,12 +5,12 @@ package common;
* @author Marcos García Núñez (mgarcianun@uoc.edu) * @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"); MAGNETIC_RESONANCE_IMAGING("Imagen por Resonancia Magnética"), CT_SCAN("Tomografía Áxial Computerizada"), BLOOD_TEST("Análisis de sangre");
private String testTypeName; private String testTypeName;
private TestType(String typeName) { private MedicalTestType(String typeName) {
this.testTypeName = typeName; this.testTypeName = typeName;
} }

View File

@@ -12,8 +12,8 @@ import javax.persistence.TypedQuery;
import TO.LoggedUserTO; import TO.LoggedUserTO;
import TO.MedicalSpecialtyTO; import TO.MedicalSpecialtyTO;
import TO.MedicalTestTO.MedicalTestType;
import TO.QuestionTO; import TO.QuestionTO;
import common.MedicalTestType;
import common.QuestionStatus; import common.QuestionStatus;
import common.UserType; import common.UserType;
import ejb.common.CommonFacadeLocal; import ejb.common.CommonFacadeLocal;

View File

@@ -6,8 +6,8 @@ import java.util.List;
import javax.ejb.Remote; import javax.ejb.Remote;
import TO.MedicalSpecialtyTO; import TO.MedicalSpecialtyTO;
import TO.MedicalTestTO.MedicalTestType;
import TO.QuestionTO; import TO.QuestionTO;
import common.MedicalTestType;
/** /**
* Interfaz remota del EJB Definimos los métodos que estarán disponibles para * Interfaz remota del EJB Definimos los métodos que estarán disponibles para

View File

@@ -14,7 +14,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne; import javax.persistence.ManyToOne;
import javax.persistence.Table; import javax.persistence.Table;
import common.TestType; import common.MedicalTestType;
/** /**
* Los nombres de los decortadores relacionados con la BBDD pueden estar en * Los nombres de los decortadores relacionados con la BBDD pueden estar en
@@ -42,7 +42,7 @@ public class MedicalTestJPA implements Serializable {
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
@Column(name = "type") // Con esto podríamos cambiar los nombres de las propiedades de la clase y @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 // mantener la relación con la BBDD a través de JPA
private TestType type; private MedicalTestType type;
@ManyToOne @ManyToOne
@JoinColumn(name = "patientid") @JoinColumn(name = "patientid")
@@ -56,7 +56,7 @@ public class MedicalTestJPA implements Serializable {
super(); 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.id = id;
this.date = date; this.date = date;
this.time = time; this.time = time;
@@ -107,11 +107,11 @@ public class MedicalTestJPA implements Serializable {
this.highresimage = highresimage; this.highresimage = highresimage;
} }
public TestType getType() { public MedicalTestType getType() {
return type; return type;
} }
public void setType(TestType type) { public void setType(MedicalTestType type) {
this.type = type; this.type = type;
} }

View File

@@ -9,7 +9,6 @@ import javax.inject.Named;
import org.primefaces.event.SelectEvent; import org.primefaces.event.SelectEvent;
import TO.PatientTO;
import TO.QuestionTO; import TO.QuestionTO;
import common.QuestionStatus; import common.QuestionStatus;
import common.UserType; import common.UserType;