Package framework.generic

Examples of framework.generic.ClipsServerException


    @Override
    public ModDisease createDisease(FollowupEventDetails detailsthrows ClipsServerException {
        checkCommandAccessibility(COMMAND_WRITE_FOLLOWUP_EVENT);
        checkEntityExist();
        if (details.id == 0) {
            throw new ClipsServerException("Необходимо сохранить приём");
        }
        ArrayList<AuditDoc> auditDoclList = new ArrayList<AuditDoc>();

        FollowupEvent event = findEntity(FollowupEvent.class, details.id);
        checkTheSame(event.getFollup());
View Full Code Here


        JobDetails d = (JobDetails) details;

        if (entity.getId() == 0) {
            entity.setClient(findEntity(Client.class, d.clientID));
        } else if (d.clientID != entity.getClient().getId()) {
            throw new ClipsServerException("Попытка записи данных о работе другому пациенту");
        }
        if (d.enterpriseID == 0) {
            throw new ClipsServerException("Не указано предприятие");
        }
        if (d.begin != null) {
            entity.setBegin(d.begin);
        } else {
            throw new ClipsServerException("Не указана дата принятия на работу");
        }
        entity.setEnd(d.end == null ? null : d.end);
        entity.setEnterprise(findEntity(Enterprise.class, d.enterpriseID));
        entity.setProfession(d.prof == 0 ? null : findEntity(Profession.class, d.prof));
        entity.setAppointment(d.appoint == 0 ? null : findEntity(Appointment.class, d.appoint));
View Full Code Here

        collL = findEntityList(Collaborator.class, "client.id", src.getId());
        if (!collL.isEmpty()) {
            coll2 = collL.get(0);
        }
        if (coll1 != null && coll2 != null) {
            throw new ClipsServerException("На каждого из объединяемых пациентов ссылаются \"Сотрудники\"");
        } else if (coll2 != null) {
            AuditDoc<Collaborator> auditColl = new AuditDoc<Collaborator>(coll2, getCollaborator());
            coll2.setClient(dst);
            saveEntity(coll2);
            auditColl.check(coll2);
View Full Code Here

            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

    private void checkPossibilityRemove(Diagnosis entity) throws ClipsServerException {
        int size = findEntityList(Sicklist.class, new Field[]{new Field("diagOpen", entity)}).size();
        size += findEntityList(Sicklist.class, new Field[]{new Field("diagClose", entity)}).size();
        if (size > 0) {
            throw new ClipsServerException("Диагноз указан в больничном, удаление невозможно");
        }
        size = findEntityList(Followup.class, new Field[]{new Field("diagnosisUp", entity)}).size();
        if (size > 0) {
            throw new ClipsServerException("Диагноз указан в диспансерном учете, удаление невозможно");
        }
    }
View Full Code Here

            copyMembers(contract, newContract, auditDocList);

            return new ModificationInfo(id, persistAudit(auditDocList));

        } catch (CloneNotSupportedException ex) {
            throw new ClipsServerException("Внутренняя ошибка: не удалось скопировать договор", ex);
        }
    }
View Full Code Here

        q.setParameter("ctype", Contract.TYPE_OMI);
        q.setParameter("current", GregorianCalendar.getInstance().getTime());
        @SuppressWarnings("unchecked")
        List<Contract> contrList = q.getResultList();
        if (contrList.isEmpty()) {
            throw new ClipsServerException("Не найден контракт ОМС");
        } else {
            contract = contrList.get(0);
        }
    }
View Full Code Here

                addDet = kladrBean.correctDetails(addDet);
            } catch (Exception ex) {
                if (ex instanceof ClipsServerException) {
                    throw (ClipsServerException) ex;
                } else {
                    throw new ClipsServerException("Неизвестная ошибка ", ex);
                }
            }
            clientBean.setAddress(addDet);
        } else {
            if (!code.isEmpty()) {
                throw new ClipsServerException("В КЛАДРе отсутствует нас. пункт с кодом " + code);
            }
        }

        //ДОКУМЕНТ, УДОСТОВЕРЯЮЩИЙ ЛИЧНОСТЬ
        ClientDocumentDetails docdet = new ClientDocumentDetails();
View Full Code Here

        if (!d.number.equals(getExistentEntity().getNumber())){
            Query    qery = manager.createQuery("select a.number from " + Emc.class.getSimpleName() + " a");
            @SuppressWarnings("unchecked")
            List<String> list = qery.getResultList();
            if (list.contains(d.number)) {
                throw new ClipsServerException("Уже существует ЭМК с данным номером");
            }
        }
        entity.setNumber(d.number);
        entity.setAnamnez(d.anamnez);
    }
View Full Code Here

        //бин д/б аутентифицирован
        checkAuthentic();

        //ОДЗ
        if(details.duration <= 0) {
            throw new ClipsServerException("Нельзя записать на прием с нулевой длительностью");
        }
        checkIsNotInThePast(details.begin);

        //check service renders
        List<ServiceRender> ls = new ArrayList<ServiceRender>();
        for(int i=0; i<details.serviceRenders.size(); i++) {
            Integer sid = details.serviceRenders.get(i);
            ServiceRender ser = findEntity(ServiceRender.class, sid);
            if(ser.isRendered()) {
                throwNeedAdminSecurityException("Одна из услуг уже оказана");
            }
            if(ser.getCancelled()) {
                throwNeedAdminSecurityException("Одна из услуг уже отменена");
            }
            if(ser.getPolis().getClient().getId() != details.clientID) {
                throw new EDataIntegrity("Попытка записать услугу пациента в прием другого");
            }
            ls.add(ser);
        }

        Collaborator collab = findEntity(Collaborator.class, details.collaboratorID);
        if(collab.isTrash()) {
            throw new ClipsServerException("Нельзя записать на прием к уволенному сотруднику");
        }
       
        SheduleReception sr = null;
        if(details.id != 0) {
             sr = findEntity(SheduleReception.class, details.id);
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.