Cambiadas todas las listas deplegables fijas, a listas con búsqueda AJAX

integrada (Estilo typeahead). Permite búsquedas en tiempo real.
* Se muestra información organizada por columnas de datos.
* Identificadores basados en Ids autogenerados.
* Nuevos métodos en EJB común para poder realizar búsquedas de datos con
filtro y paginadas (para los comboBox).
* Varias correcciones de interfaz de usuario.
* Nueva clase de utilidades.
This commit is contained in:
Marcos Garcia Nuñez
2019-12-11 00:37:26 +01:00
parent 1be6cfd72c
commit 3e315f866a
25 changed files with 607 additions and 335 deletions

View File

@@ -19,6 +19,7 @@ import TO.MedicalSpecialtyTO;
import TO.PatientTO;
import TO.PrimaryHealthCareCenterTO;
import TO.SpecialistDoctorTO;
import common.Constants;
import common.UserType;
import managedbean.common.ManagedBeanBase;
import managedbean.common.ValidationUtils;
@@ -44,14 +45,16 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
private String password;
private String email;
private boolean registered;
private String lastUIQueryPH;
private String lastUIQueryMS;
// private HashMap<String, String> userTypes;
private List<UserType> userTypes;
private String userType;
private PrimaryHealthCareCenterTO primaryHealthCareCenter;
private MedicalSpecialtyTO medicalSpecialty;
private Collection<MedicalSpecialtyTO> medicalSpecialitiesList;
private Collection<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
public RegisterUserMBean() {
@@ -64,11 +67,13 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
this.userTypes.add(UserType.FAMILY_DOCTOR);
this.userTypes.add(UserType.SPECIALIST_DOCTOR);
this.registered = false;
this.lastUIQueryPH = "";
this.lastUIQueryMS = "";
this.userType = UserType.PATIENT.name();
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listAllMedicalSpecialities();
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listAllCAPs();
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
public List<UserType> getUserTypes() {
@@ -98,14 +103,32 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
}
}
public Collection<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList;
}
public Collection<PrimaryHealthCareCenterTO> getPhcList() {
public List<PrimaryHealthCareCenterTO> getPhcList() {
return primaryHealthCareCentersList;
}
public List<PrimaryHealthCareCenterTO> completePrimaryHealCareCenter(String query) {
if (query != null && query.equals(this.lastUIQueryPH) == false) {
this.lastUIQueryPH = query;
// Recuperamos las 200 primeras coincidencias
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
return this.primaryHealthCareCentersList;
}
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
if (query != null && query.equals(this.lastUIQueryMS) == false) {
this.lastUIQueryMS = query;
// Recuperamos las 200 primeras coincidencias
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
return this.medicalSpecialitiesList;
}
public boolean isPatient() {
return (UserType.valueOf(this.userType) == UserType.PATIENT);
}