public LocSiteShortVo getLocSiteByPostCode(String postCode) { if (postCode == null) return null; DomainFactory factory = getDomainFactory(); String hql = " from LocSite l where l.address.postCode = :postCode "; List locList = factory.find(hql,new String[]{"postCode"}, new Object[]{postCode}); if (locList != null && locList.size() == 1) { return LocSiteShortVoAssembler.create((LocSite) locList.get(0)); } else if (locList != null && locList.size() > 1) { throw new DomainRuntimeException("Non unique hit on LocationSite by Post Code " + postCode); } return null; }
public LocSiteShortVo getTypeOfLocSite(LocationRefVo locRef) { if( locRef == null ) throw new CodingRuntimeException("Location not provided"); DomainFactory factory = getDomainFactory(); LocSite doLocation =(LocSite) factory.getDomainObject(LocSite.class, locRef.getID_Location()); return LocSiteShortVoAssembler.create(doLocation); }
public LocSiteShortVo getTypeOfLocSite(LocationRefVo locRef) { if (locRef == null) throw new CodingRuntimeException("Location not provided"); DomainFactory factory = getDomainFactory(); LocSite doLocation = (LocSite) factory.getDomainObject(LocSite.class, locRef.getID_Location()); return LocSiteShortVoAssembler.create(doLocation); }
private LocSiteShortVo getHospital(Location doLocation) { if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP))) return LocSiteShortVoAssembler.create((LocSite) doLocation); while(doLocation.getParentLocation() != null) { doLocation = doLocation.getParentLocation(); if(doLocation instanceof LocSite && doLocation.getType().equals(getDomLookup(LocationType.HOSP))) return LocSiteShortVoAssembler.create((LocSite) doLocation); } return null; }
public LocSiteShortVo getLocSiteShortByTaxonomyType(String extId, TaxonomyType taxType) { return LocSiteShortVoAssembler.create(getDomLocSiteByTaxonomyType(extId, taxType)); }
/** * lists order entry templates */ public ims.ocrr.vo.OrderEntryTemplateShortVoCollection listOrderEntryTemplates(ims.ocrr.vo.OrderEntryTemplateListSearchCriteriaVo searchCriteria) { DomainFactory factory = getDomainFactory(); String hql = " from OrderEntryTemplate oet "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if(searchCriteria != null) { if(searchCriteria.getNameIsNotNull()) { condStr.append(andStr + " upper(oet.formName) like :name"); markers.add("name"); values.add("%" + searchCriteria.getName().toUpperCase() + "%"); andStr = " and "; } if(searchCriteria.getStatusIsNotNull()) { condStr.append(andStr + " oet.activeStatus = :status"); markers.add("status"); values.add(getDomLookup(searchCriteria.getStatus())); andStr = " and "; } if(searchCriteria.getLocationIsNotNull()) { hql = "select oet from OrderEntryTemplate oet join oet.templatesLocations loc "; condStr.append(andStr + " (loc.location in (:location) and loc.isActive = :active) "); markers.add("location"); markers.add("active"); values.add(LocSiteShortVoAssembler.extractLocSite(factory, searchCriteria.getLocation())); values.add(Boolean.TRUE); andStr = " and "; } } if(condStr.length() > 0) { hql += " where "; hql += condStr.toString(); } return OrderEntryTemplateShortVoAssembler.createOrderEntryTemplateShortVoCollectionFromOrderEntryTemplate(factory.find(hql.toString(), markers, values)); }
public ims.core.vo.LocSiteShortVoCollection getLocations() { DomainFactory factory = getDomainFactory(); return LocSiteShortVoAssembler.createLocSiteShortVoCollectionFromLocSite(factory.find("from LocSite loc where loc.type != :surgery", new String[]{"surgery"}, new Object[]{getDomLookup(LocationType.SURGERY)})); }