@SuppressWarnings({"rawtypes"}) public LocationLiteVoCollection listLocation(String name) { if(name == null) throw new CodingRuntimeException("Can't search for a null string !"); String tmp = name; if(!tmp.endsWith("%")) tmp += "%"; if(!tmp.startsWith("%")) tmp = "%" + tmp; DomainFactory factory = getDomainFactory(); List lst = factory.find("from Location loc where loc.isActive = 1 and loc.name like :NAME and loc.type.id <> -853 order by loc.name", new String[] {"NAME"}, new Object[] {tmp}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(lst); }
public LocationLiteVoCollection loadLocations() { DomainFactory factory=getDomainFactory(); IMSCriteria imsc=new IMSCriteria(Location.class,factory); imsc.equal(Location.FieldNames.IsActive, true); imsc.equal(Location.FieldNames.IsVirtual, false); imsc.addOrder(Location.FieldNames.Name, ORDERMODE.ASC); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.SURGERY.getID()); List locations=imsc.find(); if (locations!=null&&locations.size()>0) return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations); return null; }
public LocationLiteVoCollection listWardsForCurrentHospital(LocationRefVo currentWard) { if(currentWard == null || !currentWard.getID_LocationIsNotNull()) throw new CodingRuntimeException("Can not list Wards for a null Location Id"); Location hospital = getHospitalByWard(currentWard); if(hospital == null) return null; LocationRefVo hospitalRef = LocationLiteVoAssembler.create(hospital); OrganisationAndLocation organisatonImpl = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class); return organisatonImpl.listActiveWardsForHospitalLite(hospitalRef); }
public LocationLiteVo getAdmissionWard(PASEventRefVo pasEventRef) { if(pasEventRef == null || pasEventRef.getID_PASEvent()==null) throw new CodingRuntimeException("Cannot get PasEvent value on null pasEventRef."); StringBuffer hql = new StringBuffer("select admDet.pasEvent.location from AdmissionDetail as admDet left join admDet.pasEvent as pasEvent where pasEvent.id= :pasEventID "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"pasEventID"}, new Object[] {pasEventRef.getID_PASEvent()}); if (list!=null && list.size()>0) { return LocationLiteVoAssembler.create((Location) list.get(0)); } return null; }
/** * list active locations by name excluding the following types ( 'Pathology Laboratory','Radiology' & 'Surgery') */ public LocationLiteVoCollection listLocationLiteByName(String name) { DomainFactory factory = getDomainFactory(); String hql = "from Location loc where loc.isActive = :active and loc.type.id not in (:path,:rad,:surgery) "; if(name != null) { name = name.replaceAll("%",""); hql += " and loc.upperName like '" + name.toUpperCase() + "%'"; } hql += " order by loc.upperName asc"; List<?> locs = factory.find(hql, new String[]{"active","path","rad","surgery"}, new Object[]{Boolean.TRUE,LocationType.PATHOLOGYLABORATORY.getID(),LocationType.CLINICALIMAGINGDEPARTMENT.getID(),LocationType.SURGERY.getID()}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locs); }
public LocationLiteVoCollection listHospitals(String name) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer hql = new StringBuffer(); hql.append(" select loc from Location as loc "); hql.append(" where loc.upperName like :LocName and loc.isActive = 1 and loc.isVirtual = 0 and loc.type <> :surgery "); hql.append(" order by loc.upperName asc"); markers.add("LocName"); values.add(name.toUpperCase()+"%"); markers.add("surgery"); values.add(getDomLookup(LocationType.SURGERY)); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(factory.find(hql.toString(), markers, values)); }
public LocationLiteVoCollection listActiveLocationsByName(String name) { List locations; if (name == null) { // wdev-2730 StringBuffer hql = new StringBuffer(); hql.append(" from LocSite as ls"); hql.append(" where"); hql.append(" and ls.isActive =:active"); hql.append(" and ls.isRIE is null"); hql.append(" and ls.isVirtual =:virtual"); locations = getDomainFactory().find(hql.toString(), new String[]{"active", "virtual"}, new Object[]{Boolean.TRUE, Boolean.FALSE}); } else { locations = listLocations(null, Boolean.TRUE, null, null, name); } return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations).sort(); }
public ims.core.vo.LocationLiteVoCollection getLocations() { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append(" select l1_1 from Location as l1_1 left join l1_1.type as l2_1 where (l2_1.id = :idloctype and l1_1.isActive = 1) order by upper(l1_1.name) asc "); List<?> list = factory.find(hql.toString(), new String[] { "idloctype" }, new Object[] { LocationType.ANE.getID() }); if ( list != null && list.size() > 0) { LocationLiteVoCollection tempColl = LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(list); return tempColl; } return null; }
public ims.core.vo.LocationLiteVoCollection listLocationsByLocation(ims.core.resource.place.vo.LocationRefVo location) { Location doLocation = (Location) getDomainFactory().getDomainObject(location); LocationLiteVoCollection result = LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(doLocation.getLocations()); if(result == null) return null; LocationLiteVoCollection activeLocations = new LocationLiteVoCollection(); for(int x = 0; x < result.size(); x++) { LocationLiteVo selLocation = result.get(x); if(selLocation != null && selLocation.getIsActive() != null && selLocation.getIsActive().booleanValue() && selLocation.getIsVirtualIsNotNull() && ! selLocation.getIsVirtual().booleanValue())//wdev-2730 activeLocations.add(selLocation); } return activeLocations.sort(); }
public LocationLiteVo getOutpatientDepartmentByClinic(ClinicRefVo clinic) { if(clinic == null || !clinic.getID_ClinicIsNotNull()) throw new CodingRuntimeException("Can not get Outpatient Department on null Clinic Id."); DomainFactory factory = getDomainFactory(); String query = "select c.outpatientDept from Clinic as c where c.id = :ClinicId"; List<?> department = factory.find(query, new String[] {"ClinicId"}, new Object[] {clinic.getID_Clinic()}); if(department != null && department.size() == 1) { return LocationLiteVoAssembler.create((Location) department.get(0)); } return null; }
public LocationLiteVo getErDept(LocationRefVo voLocRef) { if(voLocRef == null || voLocRef.getID_Location() == null) return null; DomainFactory factory = getDomainFactory(); String query = "select loc from Location as loc where loc.parentLocation.id = :Hospital and loc.type.id = :ANEType"; List<?> erList = factory.find(query, new String[] {"Hospital", "ANEType"}, new Object[] {voLocRef.getID_Location(), LocationType.ANE.getID()}); if(erList != null && erList.size() > 0) { return LocationLiteVoAssembler.create((Location) erList.get(0)); } return null; }
public LocationLiteVoCollection listProvidersByCategory(Category lookupCategory) { if (lookupCategory == null) return null; DomainFactory factory = getDomainFactory(); java.util.List locations = null; LookupInstance type = null; if (lookupCategory.equals(Category.PATHOLOGY)) type = getDomLookup(LocationType.PATHOLOGYLABORATORY); else if (lookupCategory.equals(Category.CLINICALIMAGING)) type = getDomLookup(LocationType.CLINICALIMAGINGDEPARTMENT); else if (lookupCategory.equals(Category.CLINICAL)) type = getDomLookup(LocationType.CLINICAL); if (type == null) throw new DomainRuntimeException("type id not found (listProvidersByCategory method)"); locations = factory.find("from Location loc where loc.type = :type", new String[]{"type"}, new Object[]{type}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations).sort(); }
private LocationLiteVoCollection listLocations(String name, LocationType locType) { ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = "from Location loc where (loc.type.id = :typeId"; names.add("typeId"); values.add(new Integer(locType.getId())); if (name != null) { hql += " and loc.upperName like :name "; names.add("name"); values.add(name.toUpperCase() + "%"); } hql += (" and loc.isVirtual =:virtual) order by loc.upperName asc"); names.add("virtual"); values.add(Boolean.FALSE); List<?> l = this.getDomainFactory().find(hql, names, values); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(l); }
private LocationLiteVoCollection listLocations(String name, LocationType locType) { ArrayList<String> names = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String hql = "from Location loc where (loc.type.id = :typeId"; names.add("typeId"); values.add(new Integer(locType.getId())); if (name != null) { hql += " and loc.upperName like :name "; names.add("name"); values.add(name.toUpperCase() + "%"); } hql += (" and loc.isVirtual = :virtual and loc.isActive = 1) order by loc.upperName asc"); names.add("virtual"); values.add(Boolean.FALSE); List<?> l = this.getDomainFactory().find(hql, names, values); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(l); }
public LocationLiteVoCollection listOPDSite() { DomainFactory factory=getDomainFactory(); IMSCriteria imsc=new IMSCriteria(Location.class,factory); imsc.equal(Location.FieldNames.IsActive, true); imsc.equal(Location.FieldNames.IsVirtual, false); imsc.addOrder(Location.FieldNames.Name, ORDERMODE.ASC); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.SURGERY.getID()); List<?> locations=imsc.find(); if (locations!=null&&locations.size()>0) return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations); return null; }
public LocationLiteVoCollection listLocations(String locationName) throws DomainInterfaceException { if (locationName == null || locationName.length() < 3) throw new DomainInterfaceException("Please enter at least 3 characters to search upon."); String query = " from Location as loc where loc.upperName like :NAME AND loc.isVirtual = 0 AND loc.isActive = 1 AND loc.type.id <> :ID_SURGERY ORDER BY loc.upperName asc"; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("NAME"); paramValues.add("%"+locationName.toUpperCase()+"%");//WDEV-12041 paramNames.add("ID_SURGERY"); paramValues.add(LocationType.SURGERY.getID()); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(getDomainFactory().find(query, paramNames, paramValues)); }
public LocationLiteVoCollection getActiveHospitals(MemberOfStaffRefVo mos) { if (mos == null || !mos.getID_MemberOfStaffIsNotNull()) return null; StringBuilder query = new StringBuilder(); query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location "); query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("LocType"); paramValues.add(getDomLookup(LocationType.HOSP)); paramNames.add("isActive"); paramValues.add(Boolean.TRUE); paramNames.add("isVirtual"); paramValues.add(Boolean.FALSE); paramNames.add("mosID"); paramValues.add(mos.getID_MemberOfStaff()); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues)); }
public LocationLiteVoCollection listActiveWardsAtTheSameLevelWithWard(LocationLiteVo wardRef) { if(wardRef == null) throw new CodingRuntimeException("Can not get LocationLiteVo value on null wardRef."); StringBuffer hql = new StringBuffer(); hql.append("select loc from Location as loc left join loc.parentLocation as parentLoc left join loc.type as type "); hql.append("where (loc.type.id = -85 and loc.isActive = :isActive and loc.isVirtual= :isVirtual and parentLoc.id in (select loc.parentLocation.id from Location as loc where (loc.id = :wardID)))"); hql.append(" order by loc.name"); //WDEV-14995 DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"wardID","isActive","isVirtual"}, new Object[] {wardRef.getID_Location(),true,false}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(list); }
/** * Domain function used to search for wards */ public ims.core.vo.LocationLiteVoCollection listWards(String wardName) { if (wardName == null) throw new DomainRuntimeException("Can not search ward after null name."); String query = " FROM Location AS loc WHERE loc.upperName LIKE :NAME AND loc.isActive = 1 AND loc.isVirtual = 0 AND loc.type.id = " + LocationType.WARD.getID() + " order by loc.name asc"; ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("NAME"); paramValues.add("%" + wardName.toUpperCase() + "%"); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(getDomainFactory().find(query, paramNames, paramValues)); }
public ims.core.vo.LocationLiteVoCollection listSector(ims.core.vo.LocSiteLiteVo filterCCA) { if (filterCCA == null) return null; DomainFactory factory = getDomainFactory(); // WDEV-12633 - Updated query to list back only Sector locations String query = "select loc from LocSite as ls left join ls.locations as loc where (ls.name = :CCANAME and loc.type.id = :VALUE)"; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); markers.add("CCANAME"); values.add(filterCCA.getName()); markers.add("VALUE"); values.add(new Integer(LocationType.SECTOR.getID())); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(factory.find(query, markers, values)); }
public LocationLiteVoCollection loadLocations() { DomainFactory factory=getDomainFactory(); IMSCriteria imsc=new IMSCriteria(Location.class,factory); imsc.equal(Location.FieldNames.IsActive, true); imsc.equal(Location.FieldNames.IsVirtual, false); imsc.addOrder(Location.FieldNames.Name, ORDERMODE.ASC); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.SURGERY.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.ANE.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.BAY.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.CASE_NOTE_FOLDER_LOCATION.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.CCA.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.CLINICAL.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.CLINICALIMAGINGDEPARTMENT.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.DEPT.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.MEDICAL_RECORDS.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.PATHOLOGYLABORATORY.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.PHN_DISTRICT.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.SECTOR.getID()); imsc.notEqual(Location.FieldNames.Type + ".id", LocationType.UNKNOWN_TYPE.getID()); List locations=imsc.find(); if (locations!=null&&locations.size()>0) return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations); return null; }
public ims.core.vo.LocationLiteVoCollection getLocations() { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append(" select l1_1 from Location as l1_1 left join l1_1.type as l2_1 where l2_1.id = :idloctype and l1_1.isActive = 1 and l1_1.isVirtual = 0 order by l1_1.upperName asc "); //WDEV-19532 WDEV-20219 List<?> list = factory.find(hql.toString(), new String[] { "idloctype" }, new Object[] { LocationType.ANE.getID() }); if ( list != null && list.size() > 0) { LocationLiteVoCollection tempColl = LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(list); return tempColl; } return null; }
public LocationLiteVoCollection getActiveHospitals(MemberOfStaffRefVo mos) { if (mos == null || !mos.getID_MemberOfStaffIsNotNull()) return null; StringBuilder query = new StringBuilder(); query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location "); query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); paramNames.add("LocType"); paramValues.add(getDomLookup(LocationType.HOSP)); paramNames.add("isActive"); paramValues.add(Boolean.TRUE); paramNames.add("isVirtual"); paramValues.add(Boolean.FALSE); paramNames.add("mosID"); paramValues.add(mos.getID_MemberOfStaff()); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues)).sort(); }
public LocationLiteVoCollection listPHNDistricts(LocationLiteVo sector) { if (sector == null) return null; DomainFactory factory = getDomainFactory(); // WDEV-12550 - Added query condition to list back only active districts String query = "select loc from Location as lsec left join lsec.locations as loc where (lsec.name = :SECNAME and loc.type.id = :VALUE and loc.isActive = 1) order by loc.name asc"; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); markers.add("SECNAME"); values.add(sector.getName()); markers.add("VALUE"); values.add(new Integer(LocationType.PHN_DISTRICT.getID())); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(factory.find(query, markers, values)); }
public ILocation validateLocation(ILocation location) { if(location == null) return null; LocationLiteVo result = LocationLiteVoAssembler.create((Location)getDomainFactory().getDomainObject(Location.class, location.getID())); if(result != null && (result.getIsActive() == null || !result.getIsActive().booleanValue())) return null; return result; }
public ims.core.vo.LocationLiteVoCollection listHospitals() { DomainFactory factory = getDomainFactory(); String hql = " from Location loc where loc.type = :locType and loc.isActive = :isActive order by upper(loc.name) asc"; //WDEV-11959 List l = factory.find(hql, new String[]{"locType","isActive"}, new Object[]{getDomLookup(LocationType.HOSP), Boolean.TRUE}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(l); }
public LocationLiteVoCollection listWards() { StringBuffer hql = new StringBuffer(); hql.append("select loc from Location as loc left join loc.parentLocation as parentLoc "); hql.append("where (loc.isActive = :isActive and loc.isVirtual= :isVirtual and loc.type = :locType ) order by loc.name asc"); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"isActive","isVirtual","locType"}, new Object[] {true,false,getDomLookup(LocationType.WARD)}); return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(list); }
public LocationLiteVo getParentLocation(LocationRefVo childLoc) { if(childLoc == null || childLoc.getID_Location() == null ) throw new CodingRuntimeException("childLoc is null or id not provided in method getParentLocation"); Location doLocation = (Location) getDomainFactory().getDomainObject(childLoc); return LocationLiteVoAssembler.create(doLocation.getParentLocation()); }
public LocationLiteVo getCurrentHospital(ILocation currentLocation) // WDEV-18012 { if(currentLocation == null) return null; DomainFactory factory = getDomainFactory(); Location currentHospital = getHospital((Location) factory.getDomainObject(Location.class, currentLocation.getID())); if(currentHospital instanceof Location) return LocationLiteVoAssembler.create((Location) currentHospital); return null; }