public LocSiteUpprNameVo saveSurgeryRecord(LocSiteUpprNameVo surgery) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException { if (!surgery.isValidated()) { throw new DomainRuntimeException("LocSiteUpprNameVo Vo has not been validated."); } DomainFactory factory = getDomainFactory(); LocSite locSiteBo = LocSiteUpprNameVoAssembler.extractLocSite(factory, surgery); factory.save(locSiteBo); return LocSiteUpprNameVoAssembler.create(locSiteBo); }
public LocSiteUpprNameVo getSurgeryCode(String code) throws DomainInterfaceException { // TODO Auto-generated method stub if(code == null || code.trim().length() == 0) return null; ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); StringBuffer taxonomyHql = new StringBuffer(" select distinct locSite from LocSite locSite join locSite.codeMappings as mappings" + " where mappings.taxonomyName = :taxonomyType and mappings.taxonomyCode = :taxonomyCode"); names.add("taxonomyType"); names.add("taxonomyCode"); values.add(getDomLookup(TaxonomyType.PAS)); values.add(code); LocSiteUpprNameVoCollection coll = LocSiteUpprNameVoAssembler.createLocSiteUpprNameVoCollectionFromLocSite(getDomainFactory().find(taxonomyHql.toString(), names, values)); if (coll != null && coll.size()>0) return coll.get(0); return null; }