Package clips.delegate.directory.simple.servicingPlace

Examples of clips.delegate.directory.simple.servicingPlace.DirectoryServicingPlace


        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) {
View Full Code Here


        initComponents();
        this.serRenLocal = serRen;
        panel = new PanelExpenTable(serRenLocal, this);
        addNewPage(panel, null);
        refreshList();
        DirectoryServicingPlace servicingPlace = DirectoryLocator.getDirectory(DirectoryServicingPlace.class);
        new DirectoryComboBoxModel<SerRenLocal, DirectoryServicingPlaceItem>(cbServPlace, servicingPlace, serRenLocal) {

            @Override
            public DirectoryServicingPlaceItem getSelectedDirectoryItem() throws ClipsException {
                return getObject().getServicingPlace();
View Full Code Here

    public void setSerRepeat(int serRepeat) throws ClipsException {
        getDetails().repeat = serRepeat;
    }

    public DirectoryServicingPlaceItem getServicingPlace() throws ClipsException{
        DirectoryServicingPlace place = DirectoryLocator.getDirectory(DirectoryServicingPlace.class);
        return place.getItemFromID(getDetails().servPlaceID);
    }
View Full Code Here

TOP

Related Classes of clips.delegate.directory.simple.servicingPlace.DirectoryServicingPlace

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.