Corregido error al listas especialistas por especialidad médica.

Corregido error tipográfico en nombre de método/propiedades.
This commit is contained in:
Marcos Garcia Nuñez
2020-01-02 13:48:38 +01:00
parent 2fbd8cb08f
commit b12f3497fc
13 changed files with 53 additions and 56 deletions

View File

@@ -15,11 +15,11 @@
<p:outputLabel for="selMS" value="Especialidad:" />
</div>
<div class="ui-g-6 ui-md-6">
<p:autoComplete id="selMS" dropdown="true" required="true" value="#{sspec.medicalSpeciality}" completeMethod="#{sspec.completeMedicalSpeciality}" var="ms"
<p:autoComplete id="selMS" dropdown="true" required="true" value="#{sspec.medicalSpecialty}" completeMethod="#{sspec.completeMedicalSpecialty}" var="ms"
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica"
placeholder="Seleccione una especialidad médica o teclee para buscar...">
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" />
<p:ajax event="itemSelect" update="dtDoctorList" onstart="PF('dtDoctorList').getPaginator().setPage(0);" />
<o:converter converterId="omnifaces.ListConverter" list="#{sspec.medicalSpecialtiesList}" />
<p:ajax event="itemSelect" update="dtDoctorList" oncomplete="PF('dtDoctorList').getPaginator().setPage(0);" />
<p:column headerText="Nombre">
<h:outputText value="#{ms.name}" />
</p:column>

View File

@@ -10,7 +10,7 @@ import javax.xml.bind.annotation.XmlRootElement;
*
* Además esta clase facilita la implementación futura de una Capa SOA (Se
* define la anotación para la serialización de esta clase: @XmlRootElement(name
* = "medicalspeciality")
* = "medicalspecialty")
*
* @author mark
*

View File

@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement;
/**
* Transfer object (TO) MedicalSpecialtyTO Para el intercambio de datos entre la capa de interfaz y la capa de negocio
*
* Además esta clase facilita la implementación futura de una Capa SOA (Se define la anotación para la serialización de esta clase: @XmlRootElement(name = "medicalspeciality")
* Además esta clase facilita la implementación futura de una Capa SOA (Se define la anotación para la serialización de esta clase: @XmlRootElement(name = "medicalspecialty")
*
* @author mark
*

View File

@@ -45,8 +45,8 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
*
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
*/
public List<MedicalSpecialtyTO> listAllMedicalSpecialities() {
return this.listMedicalSpecialitiesPaged(0, 0);
public List<MedicalSpecialtyTO> listAllMedicalSpecialties() {
return this.listMedicalSpecialtiesPaged(0, 0);
}
/**
@@ -60,8 +60,8 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
*
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
*/
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize) {
return listMedicalSpecialitiesFiltered(null, pageNumber, pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize) {
return listMedicalSpecialtiesFiltered(null, pageNumber, pageSize);
}
/**
@@ -77,7 +77,7 @@ public class CommonFacadeBean implements CommonFacadeRemote, CommonFacadeLocal {
*
* @return Devuelve una Lista de MedicalSpecialtyTO (Transfer Objects).
*/
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize) {
public List<MedicalSpecialtyTO> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize) {
String strQuery = "SELECT ms from MedicalSpecialtyJPA ms %s order by ms.name, ms.description";
String strFilter = "";
if (searchTerm == null)

View File

@@ -31,11 +31,11 @@ import jpa.VisitJPA;
@Local
public interface CommonFacadeLocal {
public List<MedicalSpecialtyTO> listAllMedicalSpecialities();
public List<MedicalSpecialtyTO> listAllMedicalSpecialties();
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize);
public List<PrimaryHealthCareCenterTO> listAllCAPs();

View File

@@ -18,11 +18,11 @@ import TO.SpecialistDoctorTO;
@Remote
public interface CommonFacadeRemote {
public List<MedicalSpecialtyTO> listAllMedicalSpecialities();
public List<MedicalSpecialtyTO> listAllMedicalSpecialties();
public List<MedicalSpecialtyTO> listMedicalSpecialitiesPaged(int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialtiesPaged(int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialitiesFiltered(String searchTerm, int pageNumber, int pageSize);
public List<MedicalSpecialtyTO> listMedicalSpecialtiesFiltered(String searchTerm, int pageNumber, int pageSize);
public List<PrimaryHealthCareCenterTO> listAllCAPs();

View File

@@ -225,7 +225,7 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
entman.persist(mt);
}
public Long getSpecialistDoctorByMedicalSpecialityCount(int specialityId) {
public Long getSpecialistDoctorByMedicalSpecialtyCount(int specialityId) {
TypedQuery<Long> query = entman.createQuery("SELECT count(1) from SpecialistDoctorJPA q where q.medicalSpecialty.id=:specId", Long.class);
query.setParameter("specId", specialityId);
@@ -237,7 +237,7 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
*
* @param speciality
*/
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpeciality(int specialityId, int pageNumber, int pageSize) {
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpecialty(int specialityId, int pageNumber, int pageSize) {
List<SpecialistDoctorTO> pendingQuestions = new ArrayList<SpecialistDoctorTO>();
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery(

View File

@@ -126,12 +126,12 @@ public interface MedicalTestFacadeRemote {
*/
public void removeImage(int idMedicalTest);
public Long getSpecialistDoctorByMedicalSpecialityCount(int specialityId);
public Long getSpecialistDoctorByMedicalSpecialtyCount(int specialityId);
/**
* Listar médicos con una especialidad concreta
*
* @param speciality
*/
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpeciality(int specialityId, int pageNumber, int pageSize);
public List<SpecialistDoctorTO> findSpecialistDoctorByMedicalSpecialty(int specialityId, int pageNumber, int pageSize);
}

View File

@@ -8,6 +8,7 @@ import javax.annotation.PostConstruct;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SortOrder;
@@ -22,8 +23,8 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
private static final long serialVersionUID = 1L;
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
private MedicalSpecialtyTO medicalSpeciality;
private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private MedicalSpecialtyTO medicalSpecialty;
private String lastUIQueryMS;
private LazyDataModel<SpecialistDoctorTO> lazyDataModelDoctorList;
@@ -33,8 +34,8 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
@PostConstruct
public void init() {
// Inicialización de variables y propiedades van aquí.
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpeciality = null;
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpecialty = null;
this.lastUIQueryMS = "";
this.lazyDataModelDoctorList = new LazyDataModel<SpecialistDoctorTO>() {
@@ -42,14 +43,14 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
@Override
public List<SpecialistDoctorTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
if (medicalSpeciality == null) {
if (medicalSpecialty == null) {
this.setRowCount(0);
return null;
} else {
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(medicalSpeciality.getId());
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(medicalSpecialty.getId());
this.setRowCount(totalRowCount.intValue());
return getRemoteManagerMedicalTest().findSpecialistDoctorByMedicalSpeciality(medicalSpeciality.getId(), (first / pageSize), pageSize);
return getRemoteManagerMedicalTest().findSpecialistDoctorByMedicalSpecialty(medicalSpecialty.getId(), (first / pageSize), pageSize);
}
}
};
@@ -59,33 +60,29 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
return lazyDataModelDoctorList;
}
public void showData() {
}
public List<MedicalSpecialtyTO> completeMedicalSpeciality(String query) {
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);
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
return this.medicalSpecialitiesList;
return this.medicalSpecialtiesList;
}
public List<MedicalSpecialtyTO> getMedicalSpecialitiesList() {
return medicalSpecialitiesList;
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialtiesList;
}
public void setMedicalSpecialitiesList(List<MedicalSpecialtyTO> medicalSpecialitiesList) {
this.medicalSpecialitiesList = medicalSpecialitiesList;
public void setMedicalSpecialtiesList(List<MedicalSpecialtyTO> value) {
this.medicalSpecialtiesList = value;
}
public MedicalSpecialtyTO getMedicalSpeciality() {
return medicalSpeciality;
public MedicalSpecialtyTO getMedicalSpecialty() {
return medicalSpecialty;
}
public void setMedicalSpeciality(MedicalSpecialtyTO medicalSpecialty) {
this.medicalSpeciality = medicalSpecialty;
public void setMedicalSpecialty(MedicalSpecialtyTO medicalSpecialty) {
this.medicalSpecialty = medicalSpecialty;
}
}

View File

@@ -50,7 +50,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
private UserType userType;
private PrimaryHealthCareCenterTO primaryHealthCareCenter;
private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
public RegisterUserMBean() {
@@ -74,7 +74,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
this.userType = UserType.PATIENT;
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.primaryHealthCareCentersList = this.getRemoteManagerCommon().listCAPsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
@@ -109,7 +109,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
}
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList;
return medicalSpecialtiesList;
}
public List<PrimaryHealthCareCenterTO> getPhcList() {
@@ -141,9 +141,9 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
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);
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
return this.medicalSpecialitiesList;
return this.medicalSpecialtiesList;
}
/**

View File

@@ -52,7 +52,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
private UserType userType;
private PrimaryHealthCareCenterTO primaryHealthCareCenter;
private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
private FamilyDoctorTO familyDoctor;
private List<FamilyDoctorTO> familyDoctorList;
@@ -92,7 +92,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
this.setPatientData(this.getRemoteManagerCommon().findPatientById(this.id));
break;
case SPECIALIST_DOCTOR:
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.setSpecialistDoctorData(this.getRemoteManagerCommon().findSpecialistDoctorById(this.id));
break;
case FAMILY_DOCTOR:
@@ -159,7 +159,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
}
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList;
return medicalSpecialtiesList;
}
public List<PrimaryHealthCareCenterTO> getPhcList() {
@@ -191,9 +191,9 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
if (query != null && query.equals(this.lastUIQueryMS) == false) {
this.lastUIQueryMS = query;
// Recuperamos las XXX primeras coincidencias
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
}
return this.medicalSpecialitiesList;
return this.medicalSpecialtiesList;
}
/**

View File

@@ -45,7 +45,7 @@ public class ListDoctorsByCenterMBean extends ManagedBeanBase implements Seriali
this.setRowCount(0);
return null;
} else {
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(primaryHealthCareCenter.getId());
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(primaryHealthCareCenter.getId());
this.setRowCount(totalRowCount.intValue());
return getRemoteManagerSystemAdmin().listAllFamilyDoctorsByCAPPaged(primaryHealthCareCenter.getId(), (first / pageSize), pageSize);

View File

@@ -23,7 +23,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
private String name;
private String description;
private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
private List<MedicalSpecialtyTO> medicalSpecialtiesList;
public ManageSpecialitiesMBean() {
}
@@ -50,7 +50,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
}
private void refreshFormData() {
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listAllMedicalSpecialities();
this.medicalSpecialtiesList = this.getRemoteManagerCommon().listAllMedicalSpecialties();
}
public Integer getId() {
@@ -92,7 +92,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
}
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList;
return medicalSpecialtiesList;
}
public MedicalSpecialtyTO getMedicalSpecialty() {