Package clips.delegate.client

Examples of clips.delegate.client.CollaboratorFunctionsChunk


            throw new ClipsException();
        }
        CollaboratorLocal collab = new CollaboratorLocal(certificateLocal.getCollaborator().getID(), null);//NULL AL
        Selector<CollaboratorFunctionsChunk> funcList = collab.getFunctions();
        for (int i = 0; i < funcList.size(); i++) {
            CollaboratorFunctionsChunk function = funcList.get(i);
            if (defaultid == 0) {
                defaultid = function.getId();
            }
            DirectorySpecialityItem item = function.getSpeciality();
            if (item != null) {
                PairIntStr pair = new PairIntStr(item.getID(), item.getTitle());
                allItems.add(pair);
            }
        }
View Full Code Here


        btOK.setEnabled(!b);
    }

    public CollaboratorFunctionsChunk getFunctions(){
        if(! inDataList()){
            return new CollaboratorFunctionsChunk(collaborator, chunkDetails);
        }else{
            return null;
        }
    }
View Full Code Here

                counter++;
                continue;
            }

            DiagnosisDetails diag = null;
            CollaboratorFunctionsChunk cfc = null;
            for (int i = 0; i < sstData.dniList.size(); i++) {
                DniData dni = sstData.dniList.get(i);
                System.out.println("Поиск больничного по посещению (" + counter/size*100 + "%)");

                String serviceCode = dni.mes.substring(3);
                int serviceID = serviceMap.get(serviceCode).getID();
                cfc = findCollFuncByExtKey(String.valueOf(dni.idWrach), sstData.vmu);

                try {
                    diag = updaterStattalonBean.get().getDiagnosisDetails(serviceID, emcID, cfc.getId(), dni.date);
                    if (diag != null) {
                        break;
                    }
                } catch (Exception ex) {
                    updaterStattalonBean.clear();
                    System.out.println(MessageBox.parseException(ex));
                    out.println(MessageBox.parseException(ex));
                }
            }
            if (diag != null) {
                SicklistDetails s = null;
                try {
                    //Проверить есть ли на данный диагноз и посещение больничный
                    s = updaterStattalonBean.get().getSicklist(diag.id);
                } catch (Exception ex) {
                    updaterStattalonBean.clear();
                    System.out.println(MessageBox.parseException(ex));
                    out.println(MessageBox.parseException(ex));
                    counter ++;
                    continue;
                }
                if (s == null) {
                    //Только если есть диагноз и больничный для него отсутствует в базе то создаем больничный
                    s = new SicklistDetails();
                }
                // s.organizationID = UserInfo.get().getCollaborator().getLpu().getID();
                EmcLocal emc = new EmcLocal(emcID, am);
                List<JobLocal> jobList = emc.getClient().getJobList();
                if (jobList.size() > 0) {
                    s.entID = jobList.get(0).getEnterprise().getID();
                }
                s.diagOpenID = diag.getId();
                s.disabID = sstData.blPrich != 0 ? sstData.blPrich : 1;
                if (!sstData.blSex.isEmpty() || !sstData.blAge.isEmpty()) {
                    //Указаны поля по уходу
                    s.disabID = DisabilityType.DISABILITY_TYPE_DISEATED_SUPPORT;
                }
                s.openerID = cfc.getCollaborator().getID();
                s.dateOpen = sstData.blBeg;
                SickLongDetails sld = new SickLongDetails();
                sld.collID = cfc.getCollaborator().getID();
                sld.date = sstData.blEnd;
                sld.serrenID = diag.serviceRenderID;
                s.sickLongList = new ArrayList<SickLongDetails>();
                s.sickLongList.add(sld);
                /*try {
                    sickListBean.get().initByID(s.id, UserInfo.get().getSessionId());
                    sickListBean.get().updateImpl(s);
                } catch (Exception ex) {
                    sickListBean.clear();
                    System.out.println(MessageBox.parseException(ex));
                    continue;
                }*/
                //Создан успешно теперь выставляем серийник.
                s.serial = "АА 0000000";
                s.registratorID = UserInfo.get().getCollaborator().getID();
                /*try {
                    sickListBean.get().initByID(s.id, UserInfo.get().getSessionId());
                    sickListBean.get().updateImpl(s);
                } catch (Exception ex) {
                    sickListBean.clear();
                    System.out.println(MessageBox.parseException(ex));
                    continue;
                }*/
                //Серийник выставлен успешно теперь закрываем.
                s.dateToWork = DateTimeUtils.getNextDay(sstData.blEnd);
                s.diagCloseID = diag.getId();
                s.serrenCloseID = diag.serviceRenderID;
                s.closerID = cfc.getCollaborator().getID();
                try {
                    sickListBean.get().initByID(s.id, UserInfo.get().getSessionId());
                    sickListBean.get().update(s);
                } catch (Exception ex) {
                    sickListBean.clear();
View Full Code Here

                        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;

                        //Диагноз
View Full Code Here

                dirCollab = DirectoryLocator.getDirectory(DirectoryCollaborator.class, true);
                System.out.println("Загружен " + i + " " + collab);
            } else {
                System.out.println("Найден " + i + " " + collab + " ID = " + collab.getID());
            }
            CollaboratorFunctionsChunk collFunc = findFunc(collab, cd.specID, cd.receptionTypeID, cd.dvrID, cd.vmuID);
            if (collFunc == null) {
                CollaboratorFunctionsDetails d = new CollaboratorFunctionsDetails();
                d.collaboratorID = collab.getID();
                d.dvrID = cd.dvrID;
                d.firstMedicalAidID = cd.vmuID;
                d.receptionTypeID = cd.receptionTypeID;
                d.specialityID = cd.specID;
                d.external_key = cd.extKey;
                collFunc = new CollaboratorFunctionsChunk(collab, d);
                collab.getFunctions().append(collFunc);
                collab.save1();
            }
        }
    }
View Full Code Here

    }

    private CollaboratorFunctionsChunk findFunc(CollaboratorLocal collab, int specID, int receptionTypeID, int dvrID, int vmuID) throws ClipsException {
        SelectorEditable<CollaboratorFunctionsChunk> functions = collab.getFunctions();
        for (int i = 0; i < functions.size(); i++) {
            CollaboratorFunctionsChunk chunk = functions.get(i);
            if (chunk.getSpeciality().getID() == specID
                    && chunk.getReceptionType().getID() == receptionTypeID
                    && chunk.getDvr().getID() == dvrID
                    && chunk.getFirstMedicalAid().getID() == vmuID) {
                return chunk;
            }
        }
        return null;
    }
View Full Code Here

            }
        }
        for (int i = 0; i < collabList.size(); i++) {
            CollaboratorLocal collab = collabList.get(i);
            SelectorEditable<CollaboratorFunctionsChunk> functions = collab.getFunctions();
            CollaboratorFunctionsChunk foundedByExtKey = null;
            for (int j = 0; j < functions.size(); j++) {
                CollaboratorFunctionsChunk cfc = functions.get(j);
                if (cfc.getExtKey() != null && cfc.getExtKey().equals(extkey)) {
                    foundedByExtKey = cfc;
                }
                if (foundedByExtKey != null
                        && foundedByExtKey.getFirstMedicalAid() != null
                        && foundedByExtKey.getFirstMedicalAid().getExtKey() != null
                        && foundedByExtKey.getFirstMedicalAid().getExtKey().equals(vmu)) {
                    return foundedByExtKey;
                }
            }
            if (foundedByExtKey != null) {
                //По внешнему ключу нашли, по типу первичной помощи надо создать
                CollaboratorFunctionsDetails d = new CollaboratorFunctionsDetails();
                d.collaboratorID = collab.getID();
                d.dvrID = foundedByExtKey.getDvr().getID();
                d.firstMedicalAidID = dirVmu.getItemFromExtKey(vmu).getID();
                d.receptionTypeID = foundedByExtKey.getReceptionType().getID();
                d.specialityID = foundedByExtKey.getSpeciality().getID();
                d.external_key = foundedByExtKey.getExtKey();
                CollaboratorFunctionsChunk collFunc = new CollaboratorFunctionsChunk(collab, d);
                collab.getFunctions().append(collFunc);
                try {
                    collab.save1();
                } catch (ClipsException ex) {
                    collab.clearBean();
View Full Code Here

    }

    private CollaboratorFunctionsChunk getCollFunc(CollaboratorLocal collab, String extkey) throws ClipsException {
        SelectorEditable<CollaboratorFunctionsChunk> functions = collab.getFunctions();
        for (int i = 0; i < functions.size(); i++) {
            CollaboratorFunctionsChunk cfc = functions.get(i);
            if (cfc.getExtKey() != null && cfc.getExtKey().equals(extkey)) {
                return cfc;
            }
        }
        return functions.get(0);
    }
View Full Code Here

    private String getExtraText(CollaboratorLocal coll) throws ClipsException {
        SelectorEditable<CollaboratorFunctionsChunk> it = coll.getFunctions();
        String s = "";
        for (int i = 0; i < it.size(); i++) {
            CollaboratorFunctionsChunk cfc = it.get(i);
            s = s + cfc.getSpeciality().toString();
            if (i != (it.size() - 1)) {
                s = s + ", ";
            }
        }
        return s;
View Full Code Here

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        try {
            if (chunks != null) {
                CollaboratorFunctionsChunk chunk = chunks.get(rowIndex);
                switch (columnIndex) {
                    case CL_RECEPTIONTYPE:
                        return chunk.getReceptionType();
                    case CL_DVR:
                        return chunk.getDvr();
                    case CL_FMA:
                        return chunk.getFirstMedicalAid();
                    case CL_SPECIALITY:
                        return chunk.getSpeciality();
                }
            } else {
                DirectoryCollaboratorFunctionsItem item = directoryItems.get(rowIndex);
                switch (columnIndex) {
                    case CL_RECEPTIONTYPE:
View Full Code Here

TOP

Related Classes of clips.delegate.client.CollaboratorFunctionsChunk

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.