Package framework.generic

Examples of framework.generic.ClipsServerException


            }
            if (mkbID == null) {
                mkbID= mapMKB.get(code + "*");
            }
            if (mkbID == null) {
                throw new ClipsServerException ("Нет элемента МКБ10 с данным кодом " + code);
            }
            Set<String> vidalTitles = entry.getValue();
            for (Iterator<String> it1 = vidalTitles.iterator(); it1.hasNext();) {
                String title = it1.next().toUpperCase().trim();
                Integer vidalID = mapVidal.get(title);
View Full Code Here


     
      parameters.put(JRParameter.REPORT_DATA_SOURCE, mainDataSourse);
      return buildReport(parameters);
    }
    catch (RuntimeException ex){
      throw new ClipsServerException("Ошибка при получении отчета", ex);
    }
  }
View Full Code Here

 
  ArrayList<MkbItem> buildTree(List<MkbItem> newTree) throws ClipsServerException{
    TreeMap<Object, MkbItem>      map = new TreeMap<Object, MkbItem>();
    for (MkbItem item : newTree) {
      if (map.containsKey(item.getId())) {
        throw new ClipsServerException("Новая коллекция содержит два элемента с одинаковым идентификатором");
      }
      map.put(item.getId(), item);
    }
   
    ArrayList<MkbItem>        target = new ArrayList<MkbItem>();
    for (MkbItem mkbItem : newTree) {
      if (mkbItem.getParentId() == null) {
        target.add(mkbItem);
      }
      else {
        MkbItem      newParent = map.get(mkbItem.getParentId());
        if (newParent == null) {
          throw new ClipsServerException("Новая коллекция не содержит элемента с идентификатором "
                + mkbItem.getParentId() + " являющегося предком элемента  " + mkbItem.toString());
        }
        mkbItem.setParent(newParent);
      }
    }
View Full Code Here

  LinkedList<Mkb10> remap(List<Mkb10> entityList, List<MkbItem> newTree) throws ClipsServerException{
    TreeMap<String, MkbItem>      nameMap = new TreeMap<String, MkbItem>();
    for (MkbItem mkbItem : newTree) {
      mkbItem.setMKB10Item(null);
      if (nameMap.containsKey(mkbItem.getMkbCode())) {
        throw new ClipsServerException("Попытка загрузить два элемента с одним кодом MKB! (" + mkbItem.getMkbCode() + ")");
      }
      nameMap.put(mkbItem.getMkbCode(), mkbItem);
    }
    HashMap<String, Mkb10>      droped = new HashMap<String, Mkb10>();
    for (Mkb10 entity: entityList){
      MkbItem      item = nameMap.get(entity.getCode());
      if (item == null) {
        if (droped.put(entity.getCode(), entity) != null){
          throw new ClipsServerException("В базе присутствуют два элемента с одинаковым кодом (" + entity.getCode() + ")");
        }
      }
      else {
        if (item.getMKB10Item() != null){
          throw new ClipsServerException("В базе присутствуют два элемента с одинаковым кодом (" + entity.getCode() + ")");
        }
        item.setMKB10Item(entity);
      }
    }
    return new LinkedList<Mkb10>(droped.values());
View Full Code Here

    checkCommandAccessibility(COMMAND_WRITE);
    HashMap<String, MkbItem>      nameMap = new HashMap<String, MkbItem>();
    for (MkbItem mkbItem : newlist) {
      mkbItem.setMKB10Item(null);
      if (nameMap.containsKey(mkbItem.getMkbCode())) {
        throw new ClipsServerException("Попытка загрузить два элемента с одним кодом MKB! (" + mkbItem.getMkbCode() + ")");
      }
      nameMap.put(mkbItem.getMkbCode(), mkbItem);
    }
    @SuppressWarnings("unchecked")
        /**Все мкб итемы*/
    List<Mkb10> items = findEntityList(Mkb10.class, new Field[0]);
        /**Мап код - сущность*/
        HashMap<String, Mkb10> hashItems = new HashMap<String, Mkb10>();
    ArrayList<Mkb10> change = new ArrayList<Mkb10>(items.size());
        //идем по всем существующим итемам, заполняем мап, выявляем новые и выявляем измененные
    for (Mkb10 mkb10 : items) {
            //Добавляем в хэш, заодно проверка вдруг есть двойные
            if (hashItems.containsKey(mkb10.getCode())) {
                throw new ClipsServerException("В базе существуют два элемента с одним кодом MKB! (" + mkb10.getCode() + ")");
            }
            hashItems.put(mkb10.getCode(),mkb10);
      MkbItem            item = nameMap.remove(mkb10.getCode());
            if (item == null) {
                String s = mkb10.getCode();
View Full Code Here

        } else if (entityWhat instanceof ProrumbleType) {
            replaceProrumbleType(entityWhat, entityWith);
        } else if (entityWhat instanceof DocumentGivenPlace) {
            replaceDocumentGivenPlace(entityWhat, entityWith);
        } else {
            throw new ClipsServerException("Замена в данном справочнике не предусмотрена");
        }
    }
View Full Code Here

                                int intID = Integer.parseInt(id);
                                if (iwtID == intID) {
                                    throw new EDataIntegrity("Этот тип уже используется в анализе (" + checkupType.getTitle() + ")");
                                }
                            } catch (NumberFormatException ex) {
                                throw new ClipsServerException("Некорректная xml (CheckupType " + checkupType.getTitle() + ")", ex);
                            }
                        }
                    }
                }


            } catch (JDOMException ex) {
                throw new ClipsServerException("Некорректная xml (CheckupType " + checkupType.getTitle() + ")", ex);
            }
        }
    }
View Full Code Here

                " WHERE pi.disease =:st AND pi.profcheckup = pch";
        Query q = manager.createQuery(sql);
        q.setParameter("st", entity);
        int count = q.getResultList().size();
        if (count > 1) {
            throw new ClipsServerException("Более одного профосмотра (" + count + ") ссылаются на одно заболевание");
        }
        if (count < 1){
            return null;
        }
        return ((Profcheckup)q.getResultList().get(0)).getDatefrom();
View Full Code Here

        //packetTemplate.setDirty(details.dirty);
        packetTemplate.setTrash(d.hidden);
        if (lpu.getId() == d.lpuID){
            packetTemplate.setLpu(lpu);
        }else{
            throw new ClipsServerException("Пакет можно сохранить только для текущего ЛПУ");
        }
    }
View Full Code Here

            initBeanRights();
        } catch (Exception ex) {
            if (ex instanceof ClipsServerException)  {
                throw (ClipsServerException) ex;
            } else {
                throw new ClipsServerException("Не могу инициализировать права на команды бина", ex);
            }
        }
        return rights;
    }
View Full Code Here

TOP

Related Classes of framework.generic.ClipsServerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.