Package beans.directory.mkb10

Examples of beans.directory.mkb10.MKBParser$Token


        }
    }

    static void validateList(Selector<DirectoryMKB10Item> items, MKBCode parent) throws ParseException, ClipsException{
        int      size = items.size();
        MKBCode      last = null;
        for (int i = 0; i < size; i++){
            DirectoryMKB10Item  item = items.get(i);
            if (item.getID() == 0){
                continue;
            }
            MKBCode    mKBCode = item.getDecodedCode();
            if (parent != null
                    && (parent.advanceCompare(mKBCode) != MKBCode.CompareResould.contains
                    || mKBCode.advanceCompare(parent) != MKBCode.CompareResould.inside)){
                throw new ClipsException("Код " + parent + " не содержит в себе код " + mKBCode);
            }
            if (last != null
                    && (last.advanceCompare(mKBCode) != MKBCode.CompareResould.less
                    || mKBCode.advanceCompare(last) != MKBCode.CompareResould.more)){
                throw new ClipsException("Код " + mKBCode + " пересекается с кодом " + last + ", или неправильно расположен");
            }
        }
    }
View Full Code Here


            }
    }
  }

  public DirectoryMKB10Item getItemByCode(String code) throws ClipsException, ParseException {
    MKBCode        parsed;
    try{
      parsed = MKBParser.decodeWellFormed(code);
    }
    catch (ParseException ex){
      System.out.println("Incorect code \"" + code + "\", try to use advanced parse method");
View Full Code Here

      DirectoryMKB10Item    item = selector.get(i);
      if (item.getID() == 0){
        continue;
      }
      MKBCode          itemCode = item.getDecodedCode();
      CompareResould      res = itemCode.advanceCompare(code);
            switch (res){
                case contains:
                    return dirScanRecursive(item, item.getItems(), code);
            }
        }
View Full Code Here

      DirectoryMKB10Item    item = selector.get(i);
      if (item.getID() == 0){
        continue;
      }
      MKBCode          itemCode = item.getDecodedCode();
      CompareResould      res = code.advanceCompare(itemCode);
      switch (res){
        case less:
          break;
        case more:
          break;
View Full Code Here

    }
    if (curLine.getAlternativeMkbCode() == null || curLine.getAlternativeMkbCode().trim().isEmpty()){
      curLine.setItems(new int[0]);
      return;
    }
    MKBParser      parser = new MKBParser(MKBParser.ParseLevel.soft);
    try {
      ArrayList<MKBCode>        codes = parser.parse(curLine.getAlternativeMkbCode());
      DirectoryMKB10          mkbDir = DirectoryLocator.getDirectory(DirectoryMKB10.class);
      MKbSelector            selector = new MKbSelector(mkbDir, MKbSelector.SelectType.single);
      ArrayList<DirectoryMKB10Item>  mkbItems = selector.getSelectedItem(codes);
      int[]              ids = new int[mkbItems.size()];
      for (int i = 0; i < ids.length; i++) {
View Full Code Here

      parsed = MKBParser.decodeWellFormed(code);
    }
    catch (ParseException ex){
      System.out.println("Incorect code \"" + code + "\", try to use advanced parse method");
      if (parser == null){
        parser = new MKBParser(MKBParser.ParseLevel.hard);
      }
      ArrayList<MKBCode>      codes = parser.parse(code);
      if (codes.size() != 1){
        throw new ParseException("Строка \"" + code + "\" содержит более одного кода мкб", 0);
      }
View Full Code Here

        if (!mkbCode.matches("[A-Z_0-9_\\._\\-\\*]+")) {
            throwFormatError("mkbCode!  " + " ---> " + line);
        }
        String mkbStr = line.substring(mkbPos + 1, line.length()).trim();
        //System.out.println(mkbCode + (char)9 + mkbStr);
        return new MkbItem(mkbStr, mkbCode, null, null);
  }
View Full Code Here

    catch (NumberFormatException ex){
      throw new ClipsException("Некорректный фомат файла! Id не число! \"" + line + "\"", ex);
    }
    String        text = line.substring(mkbIdx + 1, pIDidx).trim();
    text = text.substring(0, 1) + text.substring(1).toLowerCase();
    return new MkbItem(text, mkbID, id, parent);
  }
View Full Code Here

                throwNeedAdminSecurityException("Недостаточно прав для записи диагноза другой датой");
            }
            entity.setDate(d.date);
            entity.setServiceRender(findEntity(ServiceRender.class, d.serviceRenderID));
        }
        Mkb10 mkb10 = findEntity(Mkb10.class, d.mkbID);
        if (mustHaveStage(mkb10) && d.stage == 0) {
            throw new ClipsServerException("При постановке диагноза " + mkb10.getTitle()
                    + "\nнеобходимо указывать стадию заболевания");
        }


        entity.setMkb10(mkb10);
View Full Code Here

        if (mkb10.getId() == Mkb10.MKB10_ALCOHOL_DEPENDENCE) {
            return true;
        }
        //Злокачественные новообразования
        boolean isMN = false;
        Mkb10 m = mkb10;
        do {
            if (m.getId() == Mkb10.MKB10_MALIGNANT_NEOPLASM) {
                isMN = true;
            }
            m = m.getRef();
        } while (m != null);
        return isMN;
    }
View Full Code Here

TOP

Related Classes of beans.directory.mkb10.MKBParser$Token

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.