Avances en la pantalla de registro de usuarios nuevos (pacientes).
* Actualización de script para crear tablas (Todo a minusculas, no case sensitive) * Script de datos de pruebas de especialides médicas. * Nuevo bean para registro de usuarios (Quidato de filtro de seguridad de login, acceso sin login). * Actualización de entidades JPA con campos Identity. * Enumerado para gestionar tipos de usuarios (Paciente, Medico Familia, Especialista y Administrador) * Clase común para realizar validaciones (función para validar nif).
This commit is contained in:
@@ -27,7 +27,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
@PersistenceContext(unitName = "MyHealth")
|
||||
private EntityManager entman;
|
||||
|
||||
public PatientTO changeFamilyDoctor(String id, String ProfessionalNumberId) {
|
||||
public PatientTO changeFamilyDoctor(Integer id, Integer ProfessionalNumberId) {
|
||||
PatientTO paTO = null;
|
||||
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, ProfessionalNumberId);
|
||||
@@ -42,7 +42,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return paTO;
|
||||
}
|
||||
|
||||
public PatientTO registerPacient(String id, String nif, String name, String surname, String password, String email) {
|
||||
public PatientTO registerPatient(Integer id, String nif, String name, String surname, String password, String email) {
|
||||
PatientTO paTO = null;
|
||||
|
||||
PatientJPA ms = new PatientJPA(id, nif, name, surname, password, email);
|
||||
@@ -52,7 +52,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return paTO;
|
||||
}
|
||||
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(String id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) {
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(Integer id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) {
|
||||
SpecialistDoctorTO sdTO = null;
|
||||
|
||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, specialty.getName());
|
||||
@@ -67,7 +67,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return sdTO;
|
||||
}
|
||||
|
||||
public FamilyDoctorTO registerFamilyDoctor1(String id, String nif, String name, String surname, String password, String email, String cap) {
|
||||
public FamilyDoctorTO registerFamilyDoctor1(Integer id, String nif, String name, String surname, String password, String email, String cap) {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
PrimaryHealthCareCenterJPA phcC = entman.find(PrimaryHealthCareCenterJPA.class, cap);
|
||||
@@ -86,7 +86,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return fdTO;
|
||||
}
|
||||
|
||||
public PatientTO updatePacientData(String id, String nif, String name, String surname, String password, String email) {
|
||||
public PatientTO updatePacientData(Integer id, String nif, String name, String surname, String password, String email) {
|
||||
PatientJPA fd = entman.find(PatientJPA.class, id);
|
||||
PatientTO ptTO = null;
|
||||
|
||||
@@ -105,7 +105,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return ptTO;
|
||||
}
|
||||
|
||||
public SpecialistDoctorTO updateSpecialistDoctorData(String id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) {
|
||||
public SpecialistDoctorTO updateSpecialistDoctorData(Integer id, String nif, String name, String surname, String password, String email, MedicalSpecialtyTO specialty) {
|
||||
SpecialistDoctorTO sdTO = null;
|
||||
|
||||
SpecialistDoctorJPA sd = entman.find(SpecialistDoctorJPA.class, id);
|
||||
@@ -129,7 +129,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return sdTO;
|
||||
}
|
||||
|
||||
public FamilyDoctorTO updateFamilyDoctorData(String id, String nif, String name, String surname, String password, String email, String cap) {
|
||||
public FamilyDoctorTO updateFamilyDoctorData(Integer id, String nif, String name, String surname, String password, String email, String cap) {
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, id);
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
@@ -153,7 +153,7 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
return fdTO;
|
||||
}
|
||||
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(String FamilyDoctorId, PrimaryHealthCareCenterTO newCenter) {
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(Integer FamilyDoctorId, PrimaryHealthCareCenterTO newCenter) {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
PrimaryHealthCareCenterJPA phcC = entman.find(PrimaryHealthCareCenterJPA.class, newCenter);
|
||||
|
||||
@@ -16,21 +16,21 @@ import TO.SpecialistDoctorTO;
|
||||
@Remote
|
||||
public interface ProfileFacadeRemote {
|
||||
|
||||
public PatientTO changeFamilyDoctor(String id, String ProfessionalNumberId);
|
||||
public PatientTO changeFamilyDoctor(Integer id, Integer ProfessionalNumberId);
|
||||
|
||||
public PatientTO registerPacient(String id, String nif, String name, String surname, String password, String email);
|
||||
public PatientTO registerPatient(Integer id, String nif, String name, String surname, String password, String email);
|
||||
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(String id, String nif, String name, String surname, String password, String email,
|
||||
public SpecialistDoctorTO registerSpecialistDoctor(Integer id, String nif, String name, String surname, String password, String email,
|
||||
MedicalSpecialtyTO specialty);
|
||||
|
||||
public FamilyDoctorTO registerFamilyDoctor1(String id, String nif, String name, String surname, String password, String email, String cap);
|
||||
public FamilyDoctorTO registerFamilyDoctor1(Integer id, String nif, String name, String surname, String password, String email, String cap);
|
||||
|
||||
public PatientTO updatePacientData(String id, String nif, String name, String surname, String password, String email);
|
||||
public PatientTO updatePacientData(Integer id, String nif, String name, String surname, String password, String email);
|
||||
|
||||
public SpecialistDoctorTO updateSpecialistDoctorData(String id, String nif, String name, String surname, String password, String email,
|
||||
public SpecialistDoctorTO updateSpecialistDoctorData(Integer id, String nif, String name, String surname, String password, String email,
|
||||
MedicalSpecialtyTO specialty);
|
||||
|
||||
public FamilyDoctorTO updateFamilyDoctorData(String id, String nif, String name, String surname, String password, String email, String cap);
|
||||
public FamilyDoctorTO updateFamilyDoctorData(Integer id, String nif, String name, String surname, String password, String email, String cap);
|
||||
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(String id, PrimaryHealthCareCenterTO newCenter);
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(Integer id, PrimaryHealthCareCenterTO newCenter);
|
||||
}
|
||||
Reference in New Issue
Block a user