This commit is contained in:
Roberto Orden Erena committed 2019-12-15 20:53:51 +01:00
1 parent 91f6bc396b
commit fbe7b34a32
6 files changed
+113 -259

No files matched your search

@@ -57,9 +57,9 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
if (SessionUtils.getUserType() == UserType.PATIENT) {
LoggedUserTO user = SessionUtils.getloggedOnUser();
// 0. Conseguir el paciente en sesión
PatientTO patient = this.commonServices.findPatientById(Integer.parseInt(user.getId()));
PatientJPA patient = entman.find(PatientJPA.class, user.getId());
// 1. Buscar el médico de familia con ese professionalNumber
FamilyDoctorTO fdoctor = this.commonServices.findFamilyDoctorById(professionalNumber);
FamilyDoctorJPA fdoctor = entman.find(FamilyDoctorJPA.class, professionalNumber);
// 2. Crear un objeto de Question para ese médico desde el paciente en sesión
QuestionJPA question = new QuestionJPA(0, title, message, QuestionStatus.PENDING, patient, fdoctor, null);
// 3. Guardar