public LocShortVoCollection listLocations(ServiceRefVo service) { if (service == null) throw new CodingRuntimeException("Service was not supplied. Mandatory argument"); DomainFactory factory = getDomainFactory(); String hql = "from LocationService ls " + " where ls.service.id = :id and ls.isActive = :active"; List services = factory.find(hql, new String[]{"id", "active"}, new Object[]{service.getID_Service(), Boolean.TRUE}); LocShortVoCollection locs = new LocShortVoCollection(); for (int i = 0; i < services.size(); i++) { LocationService doLocService = (LocationService) services.get(i); locs.add(LocShortVoAssembler.create(doLocService.getLocation())); } return locs.sort(); }
public LocShortVoCollection listLocations(ServiceRefVo service) { if (service == null) throw new CodingRuntimeException("Service was not supplied. Mandatory argument"); DomainFactory factory = getDomainFactory(); String hql = "from LocationService ls " + " where ls.service.id = :id and ls.isActive = :active"; List services = factory.find(hql, new String[]{"id", "active"}, new Object[]{service.getID_Service(), Boolean.TRUE}); LocShortVoCollection locs = new LocShortVoCollection(); for (int i = 0; i < services.size(); i++) { LocationService doLocService = (LocationService) services.get(i); if (Boolean.TRUE.equals(doLocService.getLocation().isIsActive() && Boolean.FALSE.equals(doLocService.getLocation().isIsVirtual()))) //WDEV-19532 only add active, non-virtual locations locs.add(LocShortVoAssembler.create(doLocService.getLocation())); } return locs.sort(); }
public void moveSessionToLocation(SessionShortVo session, LocShortVo location) throws ims.domain.exceptions.StaleObjectException { if (session == null) throw new CodingRuntimeException("session cannot be null in method moveSessionToDate"); Sch_Session doSession = SessionShortVoAssembler.extractSch_Session(getDomainFactory(), session); Location doLocation = LocShortVoAssembler.extractLocation(getDomainFactory(), location); Boolean sessionRequiresCaseNoteLocation = doSession.isCaseNoteFolderNotRequired() == null || Boolean.FALSE.equals(doSession.isCaseNoteFolderNotRequired()); if (doLocation != null) { doSession.setSchLocation(doLocation); doSession.setLocationMovedDateTime(new java.util.Date()); if (sessionRequiresCaseNoteLocation) doSession.setCaseNoteFolderLocation(Boolean.TRUE.equals(doLocation.isCaseNoteFolderLocation()) ? doLocation : null); } getDomainFactory().save(doSession); }
private LocShortVoCollection getAlreadyUsedTheatreLocations(LocationRefVo parentLocationRef, TheatreGroupRefVo theatreGroupToBeExcludedRef) { if (parentLocationRef==null ) { throw new CodingRuntimeException("Cannot getTheatreLocations for null Hospital "); } DomainFactory factory = getDomainFactory(); String hql = "select theatreloc from TheatreGroup as theatreGroup left join theatreGroup.hospital as hosp left join theatreGroup.theatreLocations as theatreloc where hosp.id = " +parentLocationRef.getID_Location() ; if (theatreGroupToBeExcludedRef!=null) { hql+= " and theatreGroup.id <> " + theatreGroupToBeExcludedRef.getID_TheatreGroup(); } List list = factory.find(hql); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(list); }
public LocShortVoCollection getLocationByParent(LocationRefVo locRef,String value, LocationType type1) { int[] types; if( type1.equals(LocationType.CLINIC )) { types = new int[]{LocationType.CLINIC.getID(), LocationType.OUTPATIENT_DEPT.getID()}; } else if( type1.equals(LocationType.THEATRE )) { types = new int[]{LocationType.THEATRE.getID(), LocationType.PROCEDURE_ROOM.getID()}; } else { types = new int[]{type1.getID()}; } String ids = getChildLocationsIdsForLocation(locRef.getBoId(),types,Boolean.TRUE, null, null, null, null, value,null);//http://jira/browse/WDEV-21774 Build 10.5.1 List<Location> locations = getDomainFactory().find("select l from Location l where l.id in("+ids+")"); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(true); }
public LocShortVo getCurrentHospital(ILocation currentLocation) { if(currentLocation == null) return null; DomainFactory factory = getDomainFactory(); Location currentHospital = getHospital((Location) factory.getDomainObject(Location.class, currentLocation.getID())); if(currentHospital instanceof Location) return LocShortVoAssembler.create((Location) currentHospital); return null; }
public ims.core.vo.LocShortVoCollection listTheatres() { DomainFactory factory = getDomainFactory(); List locations; String hql = " from Location loc "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); condStr.append(andStr + " loc.type = :locType"); markers.add("locType"); values.add(getDomLookup(LocationType.THEATRE)); andStr = " and "; condStr.append(andStr + " loc.isActive = :active"); markers.add("active"); values.add(Boolean.TRUE); andStr = " and "; condStr.append(andStr + "loc.isVirtual =:isVirtual"); markers.add("isVirtual"); values.add(Boolean.FALSE); if (andStr.equals(" and ")) { hql += " where "; } hql += condStr.toString(); locations = factory.find(hql, markers, values); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVo getLocationByLocalCode(String localCode, LocationType codeSpecifier) { if (localCode == null || localCode.equals("")) return null; if (LOGGER.isInfoEnabled()) LOGGER.info("Location reverse Lookup Call. localCode:" + localCode); if (REMOTE_LOC_CACHE.get(localCode) != null) { if (LOGGER.isInfoEnabled()) LOGGER.info("Location reverse Lookup Cache Hit. localCode:" + localCode); return REMOTE_LOC_CACHE.get(localCode); } DomainFactory factory = getDomainFactory(); String hql = null; List locs = null; if (codeSpecifier == null) { hql = " from Location l " + " join l.codeMappings as cm" + " where cm.taxonomyName = :taxType " + " and cm.taxonomyCode = :localCode "; locs = factory.find(hql,new String[]{"taxType", "localCode"}, new Object[]{getDomLookup(TaxonomyType.PAS),localCode}); } else { hql = " from Location l " + " join l.codeMappings as cm" + " where cm.taxonomyName = :taxType " + " and cm.taxonomyCode = :localCode " + " and l.type = :codeSpecifier "; locs = factory.find(hql,new String[]{"taxType", "localCode", "codeSpecifier"}, new Object[]{getDomLookup(TaxonomyType.PAS),localCode,getDomLookup(codeSpecifier)}); } if (locs != null && locs.size() == 1) { LocShortVo loc = LocShortVoAssembler.create((Location) locs.get(0)); REMOTE_LOC_CACHE.put(localCode, loc); return loc; } else if (locs != null && locs.size() > 1) { throw new DomainRuntimeException("Non unique hit on Location by LocalCode " + localCode); } return null; }
public LocShortVoCollection listActiveWardsForHospital(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.WARD,hospital,Boolean.TRUE,null,null,name); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveWardsForHospitalByName(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.WARD,hospital,Boolean.TRUE,null,null,name); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveClinicsForHospitalByName(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.CLINIC,hospital,Boolean.TRUE,null,null,name); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveOutpatDeptsForHospitalByName(LocationRefVo hospital, String nameFilter) { List locations = listLocationsByParentLocation(LocationType.OUTPATIENT_DEPT,hospital,Boolean.TRUE,null,null,nameFilter); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listTheatres(LocationRefVo locRefVo) { DomainFactory factory = getDomainFactory(); List locations; String hql = " from Location loc "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); condStr.append(andStr + " loc.type = :locType"); markers.add("locType"); values.add(getDomLookup(LocationType.THEATRE)); andStr = " and "; condStr.append(andStr + " loc.isActive = :active"); markers.add("active"); values.add(Boolean.TRUE); andStr = " and "; condStr.append(andStr + "loc.isVirtual =:isVirtual"); markers.add("isVirtual"); values.add(Boolean.FALSE); if (locRefVo != null) { condStr.append(andStr + "loc.parentLocation.id =:parentID"); markers.add("parentID"); values.add(locRefVo.getID_Location()); } if (andStr.equals(" and ")) { hql += " where "; } hql += condStr.toString(); locations = factory.find(hql, markers, values); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveWardsForHospital(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.WARD,hospital,Boolean.TRUE,null,null,null,name);//WDEV-20395 return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveWardsForHospitalByName(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.WARD,hospital,Boolean.TRUE,null,null,null,name); //WDEV-20395 return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveClinicsForHospitalByName(LocationRefVo hospital, String name) { List locations = listLocationsByParentLocation(LocationType.CLINIC,hospital,Boolean.TRUE,null,null,null,name);//WDEV-20395 return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection listActiveOutpatDeptsForHospitalByName(LocationRefVo hospital, String nameFilter) { List locations = listLocationsByParentLocation(LocationType.OUTPATIENT_DEPT,hospital,Boolean.TRUE,null,null,null,nameFilter);//WDEV-20395 return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations).sort(); }
public LocShortVoCollection getCaseNoteFolderLocationByParent(LocationRefVo locRef, String value, LocationType type) { List locations = listLocationsByParentLocation(type,locRef,Boolean.TRUE,null,null,Boolean.TRUE,value); return LocShortVoAssembler.createLocShortVoCollectionFromLocation(locations); }