Package clips.delegate.directory.complex

Examples of clips.delegate.directory.complex.DirectoryMKB10


        add(jPanel1, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

  private void btEditMkbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btEditMkbActionPerformed
    try {
      DirectoryMKB10        dir = DirectoryLocator.getDirectory(DirectoryMKB10.class);
      DirectoryRecursiveSelectDialog<DirectoryMKB10Item> dlg =
            new DirectoryRecursiveSelectDialog<DirectoryMKB10Item>(
            parentW, mes.getMkb10(), dir);
      dlg.setVisible(true);
      if (dlg.getResould() == DirectoryRecursiveSelectDialog.DLG_OK) {
View Full Code Here


      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++) {
        ids[i] = mkbItems.get(i).getID();
View Full Code Here

        DirectoryVisitingPurpose dirPurpose = DirectoryLocator.getDirectory(DirectoryVisitingPurpose.class);
        DirectoryDiseaseResult dirResult = DirectoryLocator.getDirectory(DirectoryDiseaseResult.class);
        DirectoryService dirService = DirectoryLocator.getDirectory(DirectoryService.class);
        HashMap<String, DirectoryServiceItem> serviceMap = new HashMap<String, DirectoryServiceItem>();
        DirectoryServicingPlace dirPlace = DirectoryLocator.getDirectory(DirectoryServicingPlace.class);
        DirectoryMKB10 dirMkb = DirectoryLocator.getDirectory(DirectoryMKB10.class);
        DirectoryDiagnosisEncounter dirEncounter = DirectoryLocator.getDirectory(DirectoryDiagnosisEncounter.class);
        DirectoryTraumaType dirTraumaType = DirectoryLocator.getDirectory(DirectoryTraumaType.class);


        SelectorEditableExceptional<DirectoryServiceItem> servItems = dirService.getItems();
        for (int i = 0; i < servItems.size(); i++) {
            DirectoryServiceItem item = servItems.get(i);
            if (item.getID() != 0 && !item.getCode().trim().isEmpty()
                    && item.getGroup().getID() == ServiceGroup.SERVICE_GROUP_VISIT) {
                serviceMap.put(item.getCode().trim(), item);
            }
        }


        System.out.println("Запись в базу");
        out.println("Запись в базу");
        updaterStattalonBean.get().setFollowMap(followMap);
        GregorianCalendar gc1 = new GregorianCalendar();
        Queue queue = new Queue();
        //убрать после отладки
        //Writer w = new Writer(queue, "Единственный поток", 0);
        try {
            //разкоментить
            createThreads(queue);
            Set<Entry<Integer, SstData>> sstSet = sstMap.entrySet();
            float size = sstSet.size();
            int counter = 0;
      int countChunk = 0;
            for (Iterator<Entry<Integer, SstData>> it = sstSet.iterator(); it.hasNext();) {
                //через каждые 5000 статталонов напоминаем серваку, что юзер здесь, ато 1 раз отвалился
                if (counter % 100 == 0) {
                    System.out.println("Запись посещений - " + (counter + 1)/size*100 + "%");
                    GregorianCalendar gc2 = new GregorianCalendar();
                    long mc = gc2.getTimeInMillis() - gc1.getTimeInMillis();
                    System.out.println("Work time: " + mc + " ms");
                }
                if ((counter%5000) == 0) {
                    try {
                        UserInfo.get().disturbServer();
                    } catch (Throwable ex) {
                        //пофиг
                    }
                }
                Entry<Integer, SstData> entry = it.next();
                it.remove();
                int nSyst = entry.getKey();
                SstData sstData = entry.getValue();
                ArrayList<EmcIdAndDateBorn> emcList = clientMap.get(sstData.lnumber);
                if (emcList == null) {
                    System.out.println("Не найден пациент № " + sstData.lnumber + " stat_ds.dbf " " (N_SYST = " + sstData.nSyst + ")");
                    out.println("Не найден пациент № " + sstData.lnumber + " stat_ds.dbf " " (N_SYST = " + sstData.nSyst + ")");
                    counter++;
                    continue;
                }
                int emcID = sstData.getTrueEmc(emcList);
                if (emcID == 0) {
                    System.out.println("Не найден пациент № " + sstData.lnumber + " дата рождения " + Converter.dateToString(sstData.bithdate)
                            + " stat_ds.dbf " " (N_SYST = " + sstData.nSyst + ")");
                    out.println("Не найден пациент № " + sstData.lnumber + " дата рождения " + Converter.dateToString(sstData.bithdate)
                            + " stat_ds.dbf " " (N_SYST = " + sstData.nSyst + ")");
                    counter++;
                    continue;
                }

                if (sstData.dniList.size() < 1) {
                    System.out.println("Ошибка : В статталоне NSYST = " + nSyst + " нет посещений из STAT_DNI.DBF ");
                    out.println("Ошибка : В статталоне NSYST = " + nSyst + " нет посещений из STAT_DNI.DBF ");
                    continue;
                }


                /*if (sstData.nSyst != 523391
                        //&& sstData.nSyst != 493583
                        //&& sstData.nSyst != 61058
                        ) {
                    counter++;
                    continue;
                }*/


                if (sstData.getFinalDsCount() < 1) {
                    System.out.println("Ошибка : В статталоне NSYST = " + nSyst + " отсутствует заключительный диагноз ");
                    out.println("Ошибка : В статталоне NSYST = " + nSyst + " отсутствует заключительный диагноз ");
                    continue;
                }
                sstData.fixDiagnosys();

                if (sstData.getFinalDsCount() > 1) {
                    System.out.println("Ошибка : В статталоне NSYST = " + nSyst + " более одного заключительного диагноза ");
                    out.println("Ошибка : В статталоне NSYST = " + nSyst + " более одного заключительного диагноза ");
                    continue;
                }

                for (int i = 0; i < sstData.dniList.size(); i++) {
                    DniData dni = sstData.dniList.get(i);

                    //Заполнение чанка для быстрого ввода
                    QuickInputChunk c = new QuickInputChunk();
                    c.isUpdate = true;
                    try {
                        //Заболевание
                        c.nSyst = sstData.nSyst;
                        c.emcID = emcID;
                        c.diseaseID = 0;
                        c.purposeID = dirPurpose.getItemFromExtKey(sstData.purpose).getID();
                        c.resultID = dirResult.getItemFromExtKey(sstData.result).getID();
                        c.dataSt = sstData.dataSt;
                        c.dateEnd = sstData.data;
                        //Посещение
                        c.date = dni.date;
                        CollaboratorFunctionsChunk cfc = findCollFuncByExtKey(String.valueOf(dni.idWrach), sstData.vmu);
                        c.collID = cfc.getDetails().collaboratorID;
                        String serviceCode = dni.mes.substring(3);
                        c.serviceID = serviceMap.get(serviceCode).getID();
                        c.collFuncID = cfc.getId();
                        c.placeID = dirPlace.getItemFromExtKey(sstData.place).getID();
                        c.uet = (int) (Double.parseDouble(dni.uet) * 100);
                        c.received = sstData.received;

                        //Диагноз
                        for (DsData dsData : dni.dsDataList) {
                            DiagnosChunk dc = new DiagnosChunk();
                            if (dsData.tip.equals("0")) {
                                dc.diagTypeID = DiagnosisType.DIAGNOSIS_TYPE_PRELIMINARY;
                            } else if (dsData.tip.equals("З")) {
                                dc.diagTypeID = DiagnosisType.DIAGNOSIS_TYPE_FINAL;
                            } else {
                                dc.diagTypeID = 0; //Сопутствующий
                            }
                            DirectoryMKB10Item mkbItem = dirMkb.getItemByCode(dsData.mkb);
                            if (mkbItem == null) {
                                System.out.println("Ошибка : Неверный код мкб : " + dsData.mkb +" stat_ds.dbf " " (N_SYST = " + dsData.nSyst + ")");
                                out.println("Ошибка : Неверный код мкб : " + dsData.mkb +" stat_ds.dbf " " (N_SYST = " + dsData.nSyst + ")");
                                continue;
                            }
View Full Code Here

        getDetails().referenced = diagnosis.getID();       
        fireContentStateEvent();
    }
   
    public DirectoryMKB10Item getMkb() throws ClipsException {       
        DirectoryMKB10 dmkb = (DirectoryMKB10) DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
        return dmkb.getItemFromID(getDetails().mkbID);
    }
View Full Code Here

        getDetails().mkbID = item.getID();
        fireContentStateEvent();
    }

    public DirectoryMKB10Item getComplication() throws ClipsException {
        DirectoryMKB10 dmkb = DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
        return dmkb.getItemFromID(getDetails().complicationID);
    }
View Full Code Here

      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File csv = dlg.getSelectedFile();
        MahonParser parser = new MahonParser(csv);
        ArrayList<MkbItem>    list = parser.read();
        DirectoryMKB10      dir = (DirectoryMKB10) DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
        dir.synchronize(list);
        DirectoryLocator.getDirectory(DirectoryMKB10.class, true);
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
View Full Code Here

      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File txt = dlg.getSelectedFile();
        TxtParser parser = new TxtParser(txt);
        ArrayList<MkbItem>    list = parser.read();
        DirectoryMKB10      dir = (DirectoryMKB10) DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
                dir.updateTitle(list);
                MessageBox.showInfo("Обновление прошло удачно");
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
View Full Code Here

    }
  }//GEN-LAST:event_updateMKB10ActionPerformed

  private void btValidateMKB10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btValidateMKB10ActionPerformed
    try {
      DirectoryMKB10 dir = DirectoryLocator.getDirectory(DirectoryMKB10.class);
      dir.validate();
    }
    catch (ParseException ex) {
      MessageBox.showExceptionOnly(ex);
    }
    catch (ClipsException ex) {
View Full Code Here

 
  public static void resoveName(DiseaseLine line) throws ClipsException{
    String        name = line.getLineTitle();
    if (name == null || name.length() == 0 || line.isAutoGenerated()){
      boolean      firstPass = true;
      DirectoryMKB10  dir = DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
      for (int mkb10id : line.getItems()) {
        DirectoryMKB10Item    item = dir.getItemFromID(mkb10id);
        String          nameItem = (item == null)? null: item.getTitle();
        if (firstPass){
          name = nameItem;
          firstPass = name == null;
        }
View Full Code Here

     */
    public DirectoryDialogMKB10(boolean multipleSelected, Object selected) throws ClipsException {
        super(multipleSelected, selected, "МКБ 10", null);
        initComponents();
       
        DirectoryMKB10 mkb10 = DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
        setData(mkb10.toArray(true, false), tree, selectBtn, cancelBtn);
       
        searchBy.addItem(bytitle);
        searchBy.addItem(bycode);
        searchBy.addItem(bymask);
               
        DirectoryItemRO array[] = mkb10.toArray(false, true);
        for(int i=0; i<array.length; i++) {
            searchBy.addItem(array[i]);
        }       
       
        searchBy.setSelectedItem(bytitle);
View Full Code Here

TOP

Related Classes of clips.delegate.directory.complex.DirectoryMKB10

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.