- Creado Question transferObject

-- Se le ha añadido la relación con FamilyDoctor inexistente en el diseño inicial
-- Tiene integrado en formato String la response en lugar de un objeto (tabla en BBDD)
- Modificado MedicalTest transferObject
-- Se le ha creado el tipo de dato de prueba médica (en lugar de un entero sin más sentido en BL)
- Actualizado el diseño de BBDD
-- Con las restricciones/características anteriormente comentadas
-- Todas las tablas tienen una PK como INT AI, excepto administrator
- Se actualiza la interfaz para Remoto y el EJB
This commit is contained in:
Roberto Orden Erena
2019-12-15 18:17:32 +01:00
parent 7854ca85bc
commit e5900a8d0f
5 changed files with 280 additions and 60 deletions

View File

@@ -20,11 +20,16 @@ public class MedicalTestTO implements Serializable {
private long time; private long time;
private String observations; private String observations;
private String highresimage; private String highresimage;
private int type; private MedicalTestType type;
private PatientTO patient; private PatientTO patient;
private SpecialistDoctorTO specialistDoctor; private SpecialistDoctorTO specialistDoctor;
public MedicalTestTO(int id, Date date, int time, String observations, String highresimage, int type, PatientTO patiend, 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) {
this.setId(id); this.setId(id);
this.setDate(date); this.setDate(date);
this.setTime(time); this.setTime(time);
@@ -33,89 +38,70 @@ public class MedicalTestTO implements Serializable {
this.setType(type); this.setType(type);
this.setPatient(patiend); this.setPatient(patiend);
this.setSpecialistDoctor(specialistDoctor); this.setSpecialistDoctor(specialistDoctor);
} }
public int getId() { public int getId() {
return id; return id;
} }
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
public Date getDate() { public Date getDate() {
return date; return date;
} }
public void setDate(Date date) { public void setDate(Date date) {
this.date = date; this.date = date;
} }
public long getTime() { public long getTime() {
return time; return time;
} }
public void setTime(long time) { public void setTime(long time) {
this.time = time; this.time = time;
} }
public String getObservations() { public String getObservations() {
return observations; return observations;
} }
public void setObservations(String observations) { public void setObservations(String observations) {
this.observations = observations; this.observations = observations;
} }
public String getHighresimage() { public String getHighresimage() {
return highresimage; return highresimage;
} }
public void setHighresimage(String highresimage) { public void setHighresimage(String highresimage) {
this.highresimage = highresimage; this.highresimage = highresimage;
} }
public MedicalTestType getType() {
public int getType() {
return type; return type;
} }
public void setType(MedicalTestType type) {
public void setType(int type) {
this.type = type; this.type = type;
} }
public PatientTO getPatient() { public PatientTO getPatient() {
return patient; return patient;
} }
public void setPatient(PatientTO patient) { public void setPatient(PatientTO patient) {
this.patient = patient; this.patient = patient;
} }
public SpecialistDoctorTO getSpecialistDoctor() { public SpecialistDoctorTO getSpecialistDoctor() {
return specialistDoctor; return specialistDoctor;
} }
public void setSpecialistDoctor(SpecialistDoctorTO specialistDoctor) { public void setSpecialistDoctor(SpecialistDoctorTO specialistDoctor) {
this.specialistDoctor = specialistDoctor; this.specialistDoctor = specialistDoctor;
} }
} }

View File

@@ -0,0 +1,102 @@
package TO;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
/**
*
* @author Roberto Orden Erena <rorden@uoc.edu>
*
*/
@XmlRootElement(name = "Question")
public class QuestionTO implements Serializable {
public static enum QuestionStatus {
ANSWERED, PENDING
}
private static final long serialVersionUID = 1L;
private int id;
private String title;
private String message;
private QuestionStatus status;
private String response;
private PatientTO patient;
private FamilyDoctorTO fdoctor;
public QuestionTO() {
super();
}
public QuestionTO(int id, String title, String message, QuestionStatus status, PatientTO patient,
FamilyDoctorTO fdoctor, String response) {
super();
this.id = id;
this.title = title;
this.message = message;
this.status = status;
this.patient = patient;
this.fdoctor = fdoctor;
this.response = response;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public QuestionStatus getStatus() {
return status;
}
public void setStatus(QuestionStatus status) {
this.status = status;
}
public PatientTO getPatient() {
return patient;
}
public void setPatient(PatientTO patient) {
this.patient = patient;
}
public FamilyDoctorTO getDoctor() {
return fdoctor;
}
public void setDoctor(FamilyDoctorTO fdoctor) {
this.fdoctor = fdoctor;
}
public String getResponse() {
return response;
}
public void setResponse(String response) {
this.response = response;
}
}

View File

@@ -2,19 +2,24 @@ package ejb.medicalTest;
import java.util.Date; import java.util.Date;
import javax.ejb.EJB;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import TO.MedicalSpecialtyTO; import TO.MedicalSpecialtyTO;
import TO.MedicalTestTO.MedicalTestType;
import ejb.common.CommonFacadeLocal;
/** /**
* EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los * EJB Session Bean Class para la Practica 2, Ejercicio 1 (ISCSD) Implementa los
* métodos de la capa de negocio que implementan la logica de negocio y la * métodos de la capa de negocio que implementan la logica de negocio y la
* interacción con la capa de persistencia. * interacción con la capa de persistencia.
* *
* @author mark * Tanto los pacientes como los médicos deben acceder a la vista de pruebas
* médicas.
*
* @author rorden
* *
*/ */
@Stateless @Stateless
@@ -24,67 +29,115 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
@PersistenceContext(unitName = "MyHealth") @PersistenceContext(unitName = "MyHealth")
private EntityManager entman; private EntityManager entman;
public void ejbMethod(String parameter) { @EJB
CommonFacadeLocal commonServices;
} // ********************************************************************* QUESTION_RESPONSE
/**
* Realizar una pregunta al médico por un paciente
*
* @param professionalNumber
* @param title
* @param message
*/
@Override @Override
public void askQuestion(int professionalNumber, String title, String message) { public void askQuestion(int professionalNumber, String title, String message) {
// TODO Auto-generated method stub
} }
/**
* El médico responde a una pregunta
*
* @param question
* @param response
*/
@Override @Override
public void answerQuestion(String question, String response) { public void answerQuestion(String question, String response) {
// TODO Auto-generated method stub
} }
/**
* Recuperar las preguntas sin respuesta para un médico
*
* @param professionalNumber
*/
@Override @Override
public void listAllPendingQuestions(int professionalNumber) { public void listAllPendingQuestions(int professionalNumber) {
// TODO Auto-generated method stub
}
@Override
public void addMedicalTest(int idMedicalTest, Date date, long time, int testType, String observations) {
// TODO Auto-generated method stub
}
@Override
public void getMedicalTest(int idMedicalTest) {
// TODO Auto-generated method stub
} }
/**
* Recuperar una pregunta por su String
*
* @param question
*/
@Override @Override
public void getQuestion(String question) { public void getQuestion(String question) {
// TODO Auto-generated method stub
} }
// ********************************************************************* MEDICAL_TEST
/**
* Añadir pruebas médicas a una cita
*
* Sólo médicos especialistas pueden gestionar pruebas médicas en el sistema.
*
* @param idMedicalTest
* @param date
* @param time
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias
* magnéticas y TAC
* @param observations
*/
@Override
public void addMedicalTest(int idMedicalTest, Date date, long time, MedicalTestType testType, String observations) {
}
/**
* Recuperar una prueba médica por ID
*
* Pueden ser consultas por médicos de familia
*
* @param idMedicalTest
*/
@Override
public void getMedicalTest(int idMedicalTest) {
}
/**
* Añadir una imagen a una prueba médica
*
* @param idMedicalTest
* @param image
*/
@Override @Override
public void addImage(int idMedicalTest, String image) { public void addImage(int idMedicalTest, String image) {
// TODO Auto-generated method stub
} }
/**
* Actualizar/Pisar una imagen a una prueba médica
*
* @param idMedicalTest
* @param image
*/
@Override @Override
public void updateImage(int idMedicalTest, String image) { public void updateImage(int idMedicalTest, String image) {
// TODO Auto-generated method stub
} }
/**
* Eliminar una imagen a una prueba médica
*
* @param idMedicalTest
*/
@Override @Override
public void removeImage(int idMedicalTest) { public void removeImage(int idMedicalTest) {
// TODO Auto-generated method stub
} }
/**
* Listar médicos con una especialidad concreta
*
* @param speciality
*/
@Override @Override
public void findSpecialistDoctorByMedicalSpeciality(MedicalSpecialtyTO speciality) { public void findSpecialistDoctorByMedicalSpeciality(MedicalSpecialtyTO speciality) {
// TODO Auto-generated method stub
} }
} }

View File

@@ -5,24 +5,103 @@ import java.util.Date;
import javax.ejb.Remote; import javax.ejb.Remote;
import TO.MedicalSpecialtyTO; import TO.MedicalSpecialtyTO;
import TO.MedicalTestTO.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
* los clientes del EJB * los clientes del EJB
* *
* @author mark * @author rorden
* *
*/ */
@Remote @Remote
public interface MedicalTestFacadeRemote { public interface MedicalTestFacadeRemote {
// *********************************************************************
// QUESTION RESPONSE
/**
* Realizar una pregunta al médico por un paciente
*
* @param professionalNumber
* @param title
* @param message
*/
public void askQuestion(int professionalNumber, String title, String message); public void askQuestion(int professionalNumber, String title, String message);
/**
* El médico responde a una pregunta
*
* @param question
* @param response
*/
public void answerQuestion(String question, String response); public void answerQuestion(String question, String response);
/**
* Recuperar las preguntas sin respuesta para un médico
*
* De utilidad para paciente y médico de familia. No para médico especialista.
*
* @param professionalNumber
*/
public void listAllPendingQuestions(int professionalNumber); public void listAllPendingQuestions(int professionalNumber);
public void addMedicalTest(int idMedicalTest, Date date, long time, int testType, String observations);
public void getMedicalTest(int idMedicalTest); /**
* Recuperar una pregunta por su String
*
* @param question
*/
public void getQuestion(String question); public void getQuestion(String question);
// ********************************************************************* MEDICAL
// TEST
/**
* Añadir una prueba médica a un paciente
*
* @param idMedicalTest
* @param date
* @param time
* @param testType Pudiera llegar a ser: Análisis de sangre, resonancias
* magnéticas y TAC
* @param observations
*/
public void addMedicalTest(int id, Date date, long time, MedicalTestType testType, String observations);
/**
* Recuperar una prueba médica por ID
*
* @param idMedicalTest
*/
public void getMedicalTest(int idPatient);
/**
* Añadir una imagen a una prueba médica
*
* @param idMedicalTest
* @param image
*/
public void addImage(int idMedicalTest, String image); public void addImage(int idMedicalTest, String image);
/**
* Actualizar/Pisar una imagen a una prueba médica
*
* @param idMedicalTest
* @param image
*/
public void updateImage(int idMedicalTest, String image); public void updateImage(int idMedicalTest, String image);
/**
* Eliminar una imagen a una prueba médica
*
* @param idMedicalTest
*/
public void removeImage(int idMedicalTest); public void removeImage(int idMedicalTest);
/**
* Listar médicos con una especialidad concreta
*
* @param speciality
*/
public void findSpecialistDoctorByMedicalSpeciality(MedicalSpecialtyTO speciality); public void findSpecialistDoctorByMedicalSpeciality(MedicalSpecialtyTO speciality);
} }

Binary file not shown.