public ServiceShortVo getServiceByTaxonomy(String externalCode, TaxonomyType taxonomy) { if (externalCode == null || taxonomy == null) throw new DomainRuntimeException("Invalid parameters supplied to getDisciplineServiceByTaxonomy"); DomainFactory factory = getDomainFactory(); String hql = " from Service s " + " join s.taxonomyMap as cm" + " where cm.taxonomyName = :taxType " + " and cm.taxonomyCode = :extId "; List svcList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomy),externalCode}); if (svcList != null && svcList.size() > 1) { throw new DomainRuntimeException("Duplicate data found for taxonomy type " + taxonomy + " and External Code = " + externalCode); } else if (svcList != null && svcList.size() == 1) { return ServiceShortVoAssembler.create((Service) svcList.get(0)); } return null; }
public ims.core.vo.ServiceShortVoCollection getServicesInList(ims.core.vo.ServiceShortVoCollection recordColl) { if(recordColl == null || recordColl.size() == 0) return null; StringBuffer hqlId = new StringBuffer(); for(int i = 0;i < recordColl.size();i++) { if(i > 0) hqlId.append(","); hqlId.append(recordColl.get(i).getID_Service()); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from Service as s1_1 where (s1_1.id in ( " + hqlId + " )) "); List listServices = factory.find(hql.toString()); if(listServices != null && listServices.size() > 0) { return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(listServices); } return null; }
public ServiceShortVoCollection listServiceforCategoryByType(ServiceCategory serviceCategory) { DomainFactory factory = getDomainFactory(); String hql = "Select serv from Service as serv where serv.serviceCategory = :serviceCategory and serv.isActive = :isActive"; List services = factory.find(hql,new String[]{"serviceCategory","isActive"},new Object[]{getDomLookup(serviceCategory),Boolean.TRUE}); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(services); }
public ServiceShortVoCollection getServicesForCatsReferral(CatsReferralRefVo catsRefVo) { if (catsRefVo == null || !catsRefVo.getID_CatsReferralIsNotNull()) return null; CatsReferral catsReferral = (CatsReferral) getDomainFactory().getDomainObject(CatsReferral.class, catsRefVo.getID_CatsReferral()); if (catsReferral != null && catsReferral.getContract() != null && catsReferral.getContract().getServiceLocations() != null) { List <?> lstServices = catsReferral.getContract().getServiceLocations(); List <Service> listServices = new ArrayList<Service>(); for (Object object : lstServices) { ContractServiceLocationsConfig contractServiceLocConfig = (ContractServiceLocationsConfig) object; Service service = contractServiceLocConfig.getService(); listServices.add(service); } if(listServices != null && listServices.size() > 0) { return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(listServices).sort(); } return null; } return null; }
public ServiceShortVoCollection listServicesForLoggedHCP(HcpRefVo hcp) { if(hcp == null || hcp.getID_Hcp() == null) return null; //WDEV-20710 ArrayList<String> paramName= new ArrayList<String>(); ArrayList<Object> paramValue = new ArrayList<Object>(); String query = "select s from Hcp as h left join h.serviceFunction as hsf left join hsf.service as s, ReferralService as rs left join rs.referralServices as rss where hsf.isActive = :isActive and s.id = rss.id and h.id = :HcpId order by s.upperName asc"; paramName.add("HcpId"); paramValue.add(hcp.getID_Hcp()); paramName.add("isActive"); paramValue.add(Boolean.TRUE); List serviceList = getDomainFactory().find(query, paramName, paramValue); //WDEV-20710 ends here return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(serviceList); }
public ServiceShortVoCollection listServicesWithAlternateCode(String alternateCode) { DomainFactory factory = getDomainFactory(); String hql = "from Service s where s.alternateServiceCode = :alternateCode"; List lst = factory.find(hql, new String[]{"alternateCode"}, new Object[]{alternateCode}); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(lst); }
public ServiceShortVo getService(InvestigationRefVo invVo) { if (invVo == null) return null; DomainFactory factory = getDomainFactory(); Investigation domInv = (Investigation)factory.getDomainObject(Investigation.class, invVo.getID_Investigation()); return ServiceShortVoAssembler.create(domInv.getProviderService().getLocationService().getService()); }
public ims.core.vo.ServiceShortVoCollection listServices() { DomainFactory factory = getDomainFactory(); List lstServices = factory.find("from Service s where s.isActive = 1"); if(lstServices != null && lstServices.size() > 0) { return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(lstServices); } return null; }
public ServiceShortVoCollection listServices(String serviceName) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from Service s "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (serviceName != null) { String name = serviceName.toUpperCase(); if (name.endsWith("%")) name = name.substring(0, name.length() - 1); hql.append(andStr + " (s.upperName like :serviceName "); markers.add("serviceName"); values.add("%" + name + "%"); hql.append(")"); andStr = " and "; } hql.append(andStr + " s.isActive = :isActive"); markers.add("isActive"); values.add(new Boolean(true)); andStr = " and "; if (markers.size() > 0) query += " where "; query += hql.toString(); int configAmount = ConfigFlag.DOM.CLINICAL_ADMIN_SEARCH_MAX_SIZE.getValue(); List services = factory.find(query, markers, values, configAmount); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(services).sort(); }
public ServiceShortVoCollection listServiceforLocationByType(LocationType locationType) { DomainFactory factory = getDomainFactory(); String hql = "Select distinct locService.service from LocationService locService where locService.location.type = :locationType and locService.service.isActive = :isActive"; List services = factory.find(hql,new String[]{"locationType","isActive"},new Object[]{getDomLookup(locationType),Boolean.TRUE}); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(services); }
public ims.core.vo.ServiceShortVoCollection getActiveServices() { DomainFactory factory = getDomainFactory(); IMSCriteria imsc = new IMSCriteria(Service.class, factory); imsc.equal("isActive", true); List services = imsc.find(); if (!services.isEmpty()) return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(services); return null; }
public Specialty getReferralSpecialty(CatsReferralRefVo referral) { if (referral == null || !referral.getID_CatsReferralIsNotNull()) return null; String query = "select service from CatsReferral as referral left join referral.referralDetails as details left join details.service as service where referral.id = :ID"; ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("ID"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add(referral.getID_CatsReferral()); ServiceShortVo service = ServiceShortVoAssembler.create((Service) getDomainFactory().findFirst(query, paramNames, paramValues)); return service.getSpecialty(); }
public Specialty getReferralSpecialty(Booking_AppointmentRefVo appointment) { if (appointment == null || !appointment.getID_Booking_AppointmentIsNotNull()) return null; String query = "select service from CatsReferral as referral left join referral.referralDetails as details left join details.service as service left join referral.appointments as appt where appt.id = :ID"; ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("ID"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add(appointment.getID_Booking_Appointment()); ServiceShortVo service = ServiceShortVoAssembler.create((Service) getDomainFactory().findFirst(query, paramNames, paramValues)); return service.getSpecialty(); }
public Specialty getReferralSpecialty(Booking_AppointmentRefVo bookingAppointment) { if (bookingAppointment == null || !bookingAppointment.getID_Booking_AppointmentIsNotNull()) return null; String query = "select service from CatsReferral as referral left join referral.referralDetails as details left join details.service as service left join referral.appointments as appt where appt.id = :ID"; ArrayList<String> paramNames = new ArrayList<String>(); paramNames.add("ID"); ArrayList<Object> paramValues = new ArrayList<Object>(); paramValues.add(bookingAppointment.getID_Booking_Appointment()); ServiceShortVo service = ServiceShortVoAssembler.create((Service) getDomainFactory().findFirst(query, paramNames, paramValues)); return service.getSpecialty(); }
public ims.core.vo.ServiceShortVoCollection listServices() { String hql = " from Service service where service.isActive=1 order by service.upperName asc "; //WDEV-20219 upper(service.serviceName) List<?> services = getDomainFactory().find(hql); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(services); }
public ServiceShortVoCollection getReferralServices(String serviceName) { DomainFactory factory = getDomainFactory(); StringBuffer hqlJoins = new StringBuffer("select s from ReferralService rs left join rs.referralServices as s left join s.specialty as ss "); StringBuffer hql = new StringBuffer(" "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(serviceName != null) { hql.append(" s.upperName like :ServiceName "); markers.add("ServiceName"); values.add(serviceName.toUpperCase() + "%"); andStr = " and "; } if (markers.size() > 0) hql.insert(0, " where "); hql.append( " order by s.upperName asc" ); List<?> list = factory.find(hqlJoins.append(hql.toString()).toString(), markers, values); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(list); }
public ims.core.vo.ServiceShortVoCollection listServices(String serviceName) { StringBuilder hqlBuilder = new StringBuilder("select s1_1 from ReferralService as r1_1 left join r1_1.referralServices as s1_1 where s1_1.upperName like :servName and s1_1.isActive = 1 "); List <?> dos = getDomainFactory().find(hqlBuilder.toString(),"servName",serviceName.toUpperCase()+"%"); if (dos == null || dos.size() == 0) return null; return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(dos); }
public ServiceShortVoCollection getReferralServices(String serviceName, Specialty specialty) { DomainFactory factory = getDomainFactory(); StringBuffer hqlJoins = new StringBuffer("select s from ReferralService rs left join rs.referralServices as s left join s.specialty as ss "); StringBuffer hql = new StringBuffer(" "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if(serviceName != null) { hql.append(" s.upperName like :ServiceName "); markers.add("ServiceName"); values.add(serviceName.toUpperCase() + "%"); andStr = " and "; } if (specialty != null) { hql.append(andStr + " ss.id = :SpecId"); markers.add("SpecId"); values.add(specialty.getID()); andStr = " and "; } if (markers.size() > 0) hql.insert(0, " where "); hql.append( " order by s.upperName asc" ); List<?> list = factory.find(hqlJoins.append(hql.toString()).toString(), markers, values); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(list); }
public ServiceShortVoCollection getServicesForCategory(String serviceName, Specialty specialty, ServiceCategory category) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("select serv from Service as serv left join serv.serviceCategory as servCateg left join serv.specialty as spec where serv.isActive = 1 "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if(serviceName != null) { hql.append(" and serv.upperName like :serviceName "); markers.add("serviceName"); values.add(serviceName.toUpperCase() + "%"); } if (specialty != null) { hql.append( " and spec.id = :specId "); markers.add("specId"); values.add(specialty.getID()); } if (category != null) { hql.append( " and servCateg.id = :serviceCategoryID "); markers.add("serviceCategoryID"); values.add(category.getID()); } hql.append( " order by serv.upperName asc" ); return ServiceShortVoAssembler.createServiceShortVoCollectionFromService(factory.find(hql.toString(), markers, values)); }