private void search(boolean searchButtonPressed) { form.grdWaitingList().getRows().clear(); clearInstanceControls(); ElectiveListConfigurationVoCollection collWaitingListConfig = domain.search(populateSearchCriteriaDataFromScreen()); if (collWaitingListConfig==null || collWaitingListConfig.size()==0) { if (searchButtonPressed) { engine.showMessage("No records that match your search criteria found.", "No results", MessageButtons.OK,MessageIcon.INFORMATION); } return; } populateGrid(collWaitingListConfig); form.grdWaitingList().setValue(form.getLocalContext().getSelectedRecord()); populateInstanceControlsFromData(form.getLocalContext().getSelectedRecord()); }
public ElectiveListConfigurationVoCollection getWaitingListConfigForPatient(PatientRefVo patientRef) { if (patientRef==null || patientRef.getID_Patient()==null) { throw new CodingRuntimeException("PatientRefVo should not be null"); } ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer hql = new StringBuffer("select wlc from PatientElectiveList as pel left join pel.electiveList as wlc where pel.patient.id = :PatID "); markers.add("PatID"); values.add(patientRef.getID_Patient()); List <?> list = getDomainFactory().find(hql.toString(),markers,values); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
private void populateGrid(ElectiveListConfigurationVoCollection collWaitingListConfig) { form.grdWaitingList().getRows().clear(); for (int i=0;i<collWaitingListConfig.size();i++) { ElectiveListConfigurationVo value = collWaitingListConfig.get(i); grdWaitingListRow row = form.grdWaitingList().getRows().newRow(); row.setValue(value); row.setColWaitingListName(value.getWaitingListName()); row.setTooltipForColWaitingListName(value.getWaitingListName()); row.setColStartDate(value.getStartDate()!=null ? value.getStartDate().toString() : null); row.setTooltipForColStartDate(value.getStartDate()!=null ? value.getStartDate().toString() : null); row.setColEndDate(value.getEndDate()!=null ? value.getEndDate().toString() : null); row.setTooltipForColEndDate(value.getEndDate()!=null ? value.getEndDate().toString() : null); row.setColService(value.getService().getServiceName()); row.setTooltipForColService(populateTooltipForColService(value.getService()));//WDEV-18561 String valueCons = getConsultantsToDisplay(value.getHCPs()); row.setColConsultants(valueCons); row.setTooltipForColConsultants(valueCons); String valueHosp=getHospitalsToDisplay(value.getListLocations()); row.setColHospitals(valueHosp); row.setTooltipForColHospitals(valueHosp); row.setColActive(value.getIsActive()); } }
private void populateElectiveListCombo(boolean isDiagnosticReason) { form.cmbElectiveList().clear(); if (!isDiagnosticReason) { ElectiveListConfigurationVoCollection electiveListConfigForService = new ElectiveListConfigurationVoCollection(); ElectiveListConfigurationVoCollection electiveListConfigForHCP = new ElectiveListConfigurationVoCollection(); ElectiveListConfigurationVoCollection electiveListConfigForAllServices = new ElectiveListConfigurationVoCollection(); electiveListConfigForService = domain.getElectiveListConfigForService(form.getLocalContext().getReferral().getReferralDetails().getService().getID_Service()); if (form.ccRespHCP().getValue() != null) { electiveListConfigForHCP = domain.getElectiveListConfigForHCP(form.ccRespHCP().getValue().getIMosId(), form.getLocalContext().getReferral().getReferralDetails().getService().getID_Service()); } if (Boolean.TRUE.equals(form.chkExtendedSearch().getValue()) && form.getLocalContext().getReferral().getReferralDetails().getService().getSpecialty() != null) { electiveListConfigForAllServices = domain.getElectiveListsBySpecialty(form.getLocalContext().getReferral().getReferralDetails().getService().getSpecialty().getID()); addRowsToElectiveListCombo(electiveListConfigForAllServices, false); } else // join the electiveListConfigForHCP and electiveListConfigForService { for (int i = 0; i < electiveListConfigForService.size(); i++) { electiveListConfigForHCP.add(electiveListConfigForService.get(i)); } addRowsToElectiveListCombo(electiveListConfigForHCP, false); } } else { ElectiveListConfigurationVoCollection electiveListConfig = domain.getElectiveList(); addRowsToElectiveListCombo(electiveListConfig, true); } }
private void addRowsToElectiveListCombo(ElectiveListConfigurationVoCollection electiveListConfig, boolean isDiagnosticReason) { ElectiveListConfigurationVoCollection tempListConfig = new ElectiveListConfigurationVoCollection(); int nrOfListsHcpIsDefault = 0; ElectiveListConfigurationVo defaultHcpList = null; for (int i = 0; i < electiveListConfig.size(); i++) { // check if HCP if default for this ElectiveListConfiguration add instances if (!isDiagnosticReason && form.ccRespHCP().getValue() != null && isDefaultHcpOnListConfig(electiveListConfig.get(i))) { form.cmbElectiveList().newRow(electiveListConfig.get(i), electiveListConfig.get(i).getWaitingListName()+(electiveListConfig.get(i).getServiceIsNotNull() ? " ("+electiveListConfig.get(i).getService().getServiceName()+")":"" ), Color.Red); if (nrOfListsHcpIsDefault == 0) //set the defaultHcpList to the first default elective List found for the HCP { defaultHcpList = electiveListConfig.get(i); } nrOfListsHcpIsDefault++; } else // add to a temporary list tempListConfig.add(electiveListConfig.get(i)); } ServiceLiteVo referralService = (form.getLocalContext().getReferral()!=null && form.getLocalContext().getReferral().getReferralDetails()!=null ? form.getLocalContext().getReferral().getReferralDetails().getService(): null); //WDEV-18388 // add the remaining ElectiveListConfiguration items to the combo for (int i = 0; i < tempListConfig.size(); i++) { form.cmbElectiveList().newRow(tempListConfig.get(i), tempListConfig.get(i).getWaitingListName()+ (tempListConfig.get(i).getServiceIsNotNull() && referralService!=null && referralService.getID_Service().intValue() != tempListConfig.get(i).getService().getID_Service().intValue() ? " (Service: "+ tempListConfig.get(i).getService().getServiceName()+")" : "")); } if (electiveListConfig.size() == 1) form.cmbElectiveList().setValue(electiveListConfig.get(0)); else if (nrOfListsHcpIsDefault == 1) // if the HCP has only one default Elective List, default it. form.cmbElectiveList().setValue(defaultHcpList); }
public ElectiveListConfigurationVoCollection getElectiveListConfigForHCP(Integer hcpId, Integer serviceId) { if(hcpId == null) throw new CodingRuntimeException("Cannot get ElectiveListConfig on null HCP id."); List list = getDomainFactory().find("select config from ElectiveListConfiguration as config left join config.service as serv left join config.hCPs as hcps left join hcps.hCP as hcp where (hcp.id = :hcpID) and (serv.id = :serviceID) and (config.isActive = 1)", new String[] {"hcpID", "serviceID"}, new Object[] {hcpId, serviceId}); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection getElectiveListConfigForService(Integer serviceId) { if(serviceId == null) throw new CodingRuntimeException("Cannot get ElectiveListConfig on null Service id."); List list = getDomainFactory().find("select config from ElectiveListConfiguration as config left join config.service as serv where (config.isActive = 1) and (serv.id = :servID)", new String[] {"servID"}, new Object[] {serviceId}); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection getElectiveListsBySpecialty(Integer specialtyId) { if(specialtyId == null) throw new CodingRuntimeException("Cannot get ElectiveListConfig on null Specialty id."); List list = getDomainFactory().find("select config from ElectiveListConfiguration as config left join config.service as serv left join serv.specialty as spec where (config.isActive = 1) and (spec.id = :servID)", new String[] {"servID"}, new Object[] {specialtyId}); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection listWaitingConfiguration(ServiceRefVo serviceRef) { DomainFactory factory = getDomainFactory(); StringBuffer hqlConditions = new StringBuffer(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = ""; StringBuffer hql = new StringBuffer("select wLC from ElectiveListConfiguration as wLC "); if (serviceRef!=null) { hqlConditions.append(andStr); hqlConditions.append(" wLC.service.id=:Service"); markers.add("Service"); values.add(serviceRef.getID_Service()); andStr = " and "; } if (hqlConditions.length() > 0) { hqlConditions.insert(0, " where ("); hqlConditions.append(" ) "); } List<?> list = factory.find(hql.toString() + hqlConditions.toString() + " order by UPPER(wLC.waitingListName) asc ",markers, values); if (list == null || list.size() == 0) return null; return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection getElectiveListConfigurationOnFormOpen(ServiceRefVo serviceRef, LocationRefVo locationRef, String listIdHcp) { DomainFactory factory = getDomainFactory(); StringBuffer hqlConditions = new StringBuffer(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = ""; StringBuffer hql = new StringBuffer("select eLC from ElectiveListConfiguration as eLC left join eLC.hCPs as hcps left join hcps.hCP as hcp left join eLC.listLocations as locations left join locations.listLocation as location "); if (serviceRef!=null) { hqlConditions.append(andStr); hqlConditions.append(" eLC.service.id=:Service"); markers.add("Service"); values.add(serviceRef.getID_Service()); andStr = " and "; } if (locationRef!=null) { hqlConditions.append(andStr); hqlConditions.append("( location.id=:LocID or locations is null )"); markers.add("LocID"); values.add(locationRef.getID_Location()); andStr = " and "; } if (listIdHcp!=null && listIdHcp.length()>0) { hqlConditions.append(andStr); hqlConditions.append(" hcp.id in "+ listIdHcp +" and hcps.defaultForHCP=1"); andStr = " and "; } if (hqlConditions.length() > 0) { hqlConditions.insert(0, " where ("); hqlConditions.append(" ) "); } List<?> list = factory.find(hql.toString() + hqlConditions.toString() + " order by UPPER(eLC.waitingListName) asc ",markers, values); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection getElectiveList() { List list = getDomainFactory().find("select config from ElectiveListConfiguration as config where (config.isActive = 1) order by config.waitingListName asc "); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }
public ElectiveListConfigurationVoCollection getElectiveListConfigurationOnFormOpen(ServiceRefVo serviceRef, LocationRefVo locationRef, String listIdHcp) { DomainFactory factory = getDomainFactory(); StringBuffer hqlConditions = new StringBuffer(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = ""; StringBuffer hql = new StringBuffer("select eLC from ElectiveListConfiguration as eLC left join eLC.hCPs as hcps left join hcps.hCP as hcp left join eLC.listLocations as locations left join locations.listLocation as location "); if (serviceRef != null) { hqlConditions.append(andStr); hqlConditions.append(" eLC.service.id=:Service"); markers.add("Service"); values.add(serviceRef.getID_Service()); andStr = " and "; } if (locationRef != null) { hqlConditions.append(andStr); hqlConditions.append("( location.id=:LocID or locations is null )"); markers.add("LocID"); values.add(locationRef.getID_Location()); andStr = " and "; } if (listIdHcp != null && listIdHcp.length() > 0) { hqlConditions.append(andStr); hqlConditions.append(" hcp.id in " + listIdHcp + " and hcps.defaultForHCP=1"); andStr = " and "; } if (hqlConditions.length() > 0) { hqlConditions.insert(0, " where ("); hqlConditions.append(" ) "); } List<?> list = factory.find(hql.toString() + hqlConditions.toString() + " order by UPPER(eLC.waitingListName) asc ", markers, values); return ElectiveListConfigurationVoAssembler.createElectiveListConfigurationVoCollectionFromElectiveListConfiguration(list); }