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:" /> <p:outputLabel for="selMS" value="Especialidad:" />
</div> </div>
<div class="ui-g-6 ui-md-6"> <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" 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..."> placeholder="Seleccione una especialidad médica o teclee para buscar...">
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" /> <o:converter converterId="omnifaces.ListConverter" list="#{sspec.medicalSpecialtiesList}" />
<p:ajax event="itemSelect" update="dtDoctorList" onstart="PF('dtDoctorList').getPaginator().setPage(0);" /> <p:ajax event="itemSelect" update="dtDoctorList" oncomplete="PF('dtDoctorList').getPaginator().setPage(0);" />
<p:column headerText="Nombre"> <p:column headerText="Nombre">
<h:outputText value="#{ms.name}" /> <h:outputText value="#{ms.name}" />
</p:column> </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 * 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 * define la anotación para la serialización de esta clase: @XmlRootElement(name
* = "medicalspeciality") * = "medicalspecialty")
* *
* @author mark * @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 * 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 * @author mark
* *

View File

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

View File

@@ -31,11 +31,11 @@ import jpa.VisitJPA;
@Local @Local
public interface CommonFacadeLocal { 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(); public List<PrimaryHealthCareCenterTO> listAllCAPs();

View File

@@ -18,11 +18,11 @@ import TO.SpecialistDoctorTO;
@Remote @Remote
public interface CommonFacadeRemote { 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(); public List<PrimaryHealthCareCenterTO> listAllCAPs();

View File

@@ -225,7 +225,7 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
entman.persist(mt); 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); TypedQuery<Long> query = entman.createQuery("SELECT count(1) from SpecialistDoctorJPA q where q.medicalSpecialty.id=:specId", Long.class);
query.setParameter("specId", specialityId); query.setParameter("specId", specialityId);
@@ -237,7 +237,7 @@ public class MedicalTestFacadeBean implements MedicalTestFacadeRemote {
* *
* @param speciality * @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>(); List<SpecialistDoctorTO> pendingQuestions = new ArrayList<SpecialistDoctorTO>();
TypedQuery<SpecialistDoctorJPA> query = entman.createQuery( TypedQuery<SpecialistDoctorJPA> query = entman.createQuery(

View File

@@ -126,12 +126,12 @@ public interface MedicalTestFacadeRemote {
*/ */
public void removeImage(int idMedicalTest); public void removeImage(int idMedicalTest);
public Long getSpecialistDoctorByMedicalSpecialityCount(int specialityId); public Long getSpecialistDoctorByMedicalSpecialtyCount(int specialityId);
/** /**
* Listar médicos con una especialidad concreta * Listar médicos con una especialidad concreta
* *
* @param speciality * @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.faces.view.ViewScoped;
import javax.inject.Named; import javax.inject.Named;
import org.primefaces.event.SelectEvent;
import org.primefaces.model.LazyDataModel; import org.primefaces.model.LazyDataModel;
import org.primefaces.model.SortOrder; import org.primefaces.model.SortOrder;
@@ -22,8 +23,8 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private List<MedicalSpecialtyTO> medicalSpecialitiesList; private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private MedicalSpecialtyTO medicalSpeciality; private MedicalSpecialtyTO medicalSpecialty;
private String lastUIQueryMS; private String lastUIQueryMS;
private LazyDataModel<SpecialistDoctorTO> lazyDataModelDoctorList; private LazyDataModel<SpecialistDoctorTO> lazyDataModelDoctorList;
@@ -33,8 +34,8 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
@PostConstruct @PostConstruct
public void init() { public void init() {
// Inicialización de variables y propiedades van aquí. // Inicialización de variables y propiedades van aquí.
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH); this.medicalSpecialtiesList = this.getRemoteManagerCommon().listMedicalSpecialtiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
this.medicalSpeciality = null; this.medicalSpecialty = null;
this.lastUIQueryMS = ""; this.lastUIQueryMS = "";
this.lazyDataModelDoctorList = new LazyDataModel<SpecialistDoctorTO>() { this.lazyDataModelDoctorList = new LazyDataModel<SpecialistDoctorTO>() {
@@ -42,14 +43,14 @@ public class SearchSpecialistMBean extends ManagedBeanBase implements Serializab
@Override @Override
public List<SpecialistDoctorTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { 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); this.setRowCount(0);
return null; return null;
} else { } else {
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(medicalSpeciality.getId()); Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(medicalSpecialty.getId());
this.setRowCount(totalRowCount.intValue()); 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; return lazyDataModelDoctorList;
} }
public void showData() { public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
}
public List<MedicalSpecialtyTO> completeMedicalSpeciality(String query) {
if (query != null && query.equals(this.lastUIQueryMS) == false) { if (query != null && query.equals(this.lastUIQueryMS) == false) {
this.lastUIQueryMS = query; this.lastUIQueryMS = query;
// Recuperamos las 200 primeras coincidencias // 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() { public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList; return medicalSpecialtiesList;
} }
public void setMedicalSpecialitiesList(List<MedicalSpecialtyTO> medicalSpecialitiesList) { public void setMedicalSpecialtiesList(List<MedicalSpecialtyTO> value) {
this.medicalSpecialitiesList = medicalSpecialitiesList; this.medicalSpecialtiesList = value;
} }
public MedicalSpecialtyTO getMedicalSpeciality() { public MedicalSpecialtyTO getMedicalSpecialty() {
return medicalSpeciality; return medicalSpecialty;
} }
public void setMedicalSpeciality(MedicalSpecialtyTO medicalSpecialty) { public void setMedicalSpecialty(MedicalSpecialtyTO medicalSpecialty) {
this.medicalSpeciality = medicalSpecialty; this.medicalSpecialty = medicalSpecialty;
} }
} }

View File

@@ -50,7 +50,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
private UserType userType; private UserType userType;
private PrimaryHealthCareCenterTO primaryHealthCareCenter; private PrimaryHealthCareCenterTO primaryHealthCareCenter;
private MedicalSpecialtyTO medicalSpecialty; private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList; private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList; private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
public RegisterUserMBean() { public RegisterUserMBean() {
@@ -74,7 +74,7 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
this.userType = UserType.PATIENT; 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); 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() { public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList; return medicalSpecialtiesList;
} }
public List<PrimaryHealthCareCenterTO> getPhcList() { public List<PrimaryHealthCareCenterTO> getPhcList() {
@@ -141,9 +141,9 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
if (query != null && query.equals(this.lastUIQueryMS) == false) { if (query != null && query.equals(this.lastUIQueryMS) == false) {
this.lastUIQueryMS = query; this.lastUIQueryMS = query;
// Recuperamos las 200 primeras coincidencias // 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 UserType userType;
private PrimaryHealthCareCenterTO primaryHealthCareCenter; private PrimaryHealthCareCenterTO primaryHealthCareCenter;
private MedicalSpecialtyTO medicalSpecialty; private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList; private List<MedicalSpecialtyTO> medicalSpecialtiesList;
private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList; private List<PrimaryHealthCareCenterTO> primaryHealthCareCentersList;
private FamilyDoctorTO familyDoctor; private FamilyDoctorTO familyDoctor;
private List<FamilyDoctorTO> familyDoctorList; private List<FamilyDoctorTO> familyDoctorList;
@@ -92,7 +92,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
this.setPatientData(this.getRemoteManagerCommon().findPatientById(this.id)); this.setPatientData(this.getRemoteManagerCommon().findPatientById(this.id));
break; break;
case SPECIALIST_DOCTOR: 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)); this.setSpecialistDoctorData(this.getRemoteManagerCommon().findSpecialistDoctorById(this.id));
break; break;
case FAMILY_DOCTOR: case FAMILY_DOCTOR:
@@ -159,7 +159,7 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
} }
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() { public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList; return medicalSpecialtiesList;
} }
public List<PrimaryHealthCareCenterTO> getPhcList() { public List<PrimaryHealthCareCenterTO> getPhcList() {
@@ -191,9 +191,9 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
if (query != null && query.equals(this.lastUIQueryMS) == false) { if (query != null && query.equals(this.lastUIQueryMS) == false) {
this.lastUIQueryMS = query; this.lastUIQueryMS = query;
// Recuperamos las XXX primeras coincidencias // 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); this.setRowCount(0);
return null; return null;
} else { } else {
Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialityCount(primaryHealthCareCenter.getId()); Long totalRowCount = getRemoteManagerMedicalTest().getSpecialistDoctorByMedicalSpecialtyCount(primaryHealthCareCenter.getId());
this.setRowCount(totalRowCount.intValue()); this.setRowCount(totalRowCount.intValue());
return getRemoteManagerSystemAdmin().listAllFamilyDoctorsByCAPPaged(primaryHealthCareCenter.getId(), (first / pageSize), pageSize); 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 name;
private String description; private String description;
private MedicalSpecialtyTO medicalSpecialty; private MedicalSpecialtyTO medicalSpecialty;
private List<MedicalSpecialtyTO> medicalSpecialitiesList; private List<MedicalSpecialtyTO> medicalSpecialtiesList;
public ManageSpecialitiesMBean() { public ManageSpecialitiesMBean() {
} }
@@ -50,7 +50,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
} }
private void refreshFormData() { private void refreshFormData() {
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listAllMedicalSpecialities(); this.medicalSpecialtiesList = this.getRemoteManagerCommon().listAllMedicalSpecialties();
} }
public Integer getId() { public Integer getId() {
@@ -92,7 +92,7 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
} }
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() { public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
return medicalSpecialitiesList; return medicalSpecialtiesList;
} }
public MedicalSpecialtyTO getMedicalSpecialty() { public MedicalSpecialtyTO getMedicalSpecialty() {