Las comprobaciones del nombre de CAPs y especialidades médicas
existentes se realizan en minusculas. Se comprueba que no existan espeicalistas asigandos a la especialidad médica antes de poder eliminarla.
This commit is contained in:
@@ -134,7 +134,7 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MedicalSpecialtyTO findSpecialtyByName(String searchedName) {
|
public MedicalSpecialtyTO findSpecialtyByName(String searchedName) {
|
||||||
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery("from MedicalSpecialtyJPA ms where ms.name=:name", MedicalSpecialtyJPA.class);
|
TypedQuery<MedicalSpecialtyJPA> query = entman.createQuery("from MedicalSpecialtyJPA ms where LOWER(ms.name)=LOWER(:name)", MedicalSpecialtyJPA.class);
|
||||||
query.setMaxResults(1);
|
query.setMaxResults(1);
|
||||||
query.setParameter("name", searchedName);
|
query.setParameter("name", searchedName);
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PrimaryHealthCareCenterTO findHealthCareCenterByName(String searchedName) {
|
public PrimaryHealthCareCenterTO findHealthCareCenterByName(String searchedName) {
|
||||||
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery("from PrimaryHealthCareCenterJPA cap where cap.name=:name", PrimaryHealthCareCenterJPA.class);
|
TypedQuery<PrimaryHealthCareCenterJPA> query = entman.createQuery("from PrimaryHealthCareCenterJPA cap where LOWER(cap.name)=LOWER(:name)", PrimaryHealthCareCenterJPA.class);
|
||||||
query.setMaxResults(1);
|
query.setMaxResults(1);
|
||||||
query.setParameter("name", searchedName);
|
query.setParameter("name", searchedName);
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
|||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
try {
|
try {
|
||||||
this.getRemoteManagerSystemAdmin().updateSpecialty(this.medicalSpecialty.getId(), this.medicalSpecialty.getName(),this.medicalSpecialty.getDescription());
|
this.getRemoteManagerSystemAdmin().updateSpecialty(this.medicalSpecialty.getId(), this.medicalSpecialty.getName(), this.medicalSpecialty.getDescription());
|
||||||
this.showSpecialtyData(null);
|
this.showSpecialtyData(null);
|
||||||
this.refreshFormData();
|
this.refreshFormData();
|
||||||
|
|
||||||
@@ -139,6 +139,11 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
|||||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Descripción no rellena", "Por favor, escriba una descripción.");
|
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Descripción no rellena", "Por favor, escriba una descripción.");
|
||||||
error++;
|
error++;
|
||||||
}
|
}
|
||||||
|
if (this.getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(this.medicalSpecialty.getId()) > 0) {
|
||||||
|
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "No se puede eliminar esta especialidad",
|
||||||
|
"Existen especialistas que tienen asignada esta especialidad médica, por lo cual no puede ser eliminada. Asigne los especialista a otra especialidad para proceder a eliminar la especialidad a continuación.");
|
||||||
|
error++;
|
||||||
|
}
|
||||||
|
|
||||||
if (error == 0) {
|
if (error == 0) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user