Examples of EDataIntegrity


Examples of framework.generic.EDataIntegrity

        checkEntityExist();
        Polis polis = findEntity(Polis.class, id);
        checkTheSame(polis.getContract());
        if (getEntityCount(ServiceRender.class,
            new Field[]{new Field("polis", polis)}, "") > 0) {
            throw new EDataIntegrity("Нельзя удалить данного участника договора так как у него уже есть услуги");
        }
        if (getEntityCount(ProfcheckupItem.class,
            new Field[]{new Field("polis", polis)}, "") > 0) {
            throw new EDataIntegrity("Нельзя удалить данного участника договора так как у него уже есть услуги");
        }
        Address address = polis.getAddress();
        if (address != null) {
            removeEntity(address);
        }
View Full Code Here

Examples of framework.generic.EDataIntegrity

        } else {
            throw new UnsupportedOperationException("Данный метод применим только к договору ОМС");
        }
        int serrenCount = getEntityCount(ServiceRender.class, new Field[]{new Field("polis.contract", getExistentEntity())});
        if (serrenCount > 0) {
            throw new EDataIntegrity("Невозможно обновить цены в контракте по которому уже были назначены услуги (" +
                    + serrenCount + " услуг).");
        }

        /*Сначала выбираются все контрактсервайсы относящиеся к посещениям
         * создается 3 мапа
         * 1) код услуги - услуга
         * 2) код типа приема - тип приема
         * 3) код(услуги+типа приема) - контрактсервайс
         */
        Field[] f = new Field[]{
            new Field("serviceGroup.id", ServiceGroup.SERVICE_GROUP_VISIT)
        };
        List<Service> services = findEntityList(Service.class, f);
        HashMap<String, Service> serviceMap = new HashMap<String, Service>();
        for (Service service : services) {
            serviceMap.put(service.getCode(), service);
        }

        List<ReceptionType> rtList = findEntityList(ReceptionType.class);
        HashMap<String, ReceptionType> rtMap = new HashMap<String, ReceptionType>();
        for (ReceptionType rt : rtList) {
            rtMap.put(rt.getExtKey(), rt);
        }

        Field[] f2 = new Field[]{
            new Field("contract", getExistentEntity()),
            new Field("service.serviceGroup.id", ServiceGroup.SERVICE_GROUP_VISIT)
        };
        List<ServicePrice> prices = findEntityList(ServicePrice.class, f2);
        HashMap<String, ServicePrice> priceMap = new HashMap<String, ServicePrice>();
        for (ServicePrice servicePrice : prices) {
            priceMap.put(servicePrice.getReceptionType().getExtKey() + servicePrice.getService().getCode(), servicePrice);
        }

        ArrayList<AuditDetails> auditDetList = new ArrayList<AuditDetails>();
        CollaboratorAbstract collab = getCollaborator();
        for (VisitPrice visitPrice : visitPriceList) {
            if (Float.parseFloat(visitPrice.getPrice()) == 0) {
                continue;
            }
            String rt;
            String visit;
            int price;
            if (visitPrice.getId().length() != 6) {
                throw new EDataIntegrity("В таблице стоимости посещений неверный ID : " + visitPrice.getId());
            }
            rt = visitPrice.getId().substring(0, 3);
            visit = visitPrice.getId().substring(3, 6);
            price = (int) (Float.parseFloat(visitPrice.getPrice())*100);
            Service service = serviceMap.get(visit);
            if (service == null) {
                throw new EDataIntegrity("В базе отсутствует посещение с кодом " + visit +
                        ". Обновите справочник посещений");
            }
            ReceptionType receptionType = rtMap.get(rt);
            if (receptionType == null) {
                throw new EDataIntegrity("В базе отсутствует тип приема с кодом " + visit +
                        ". Обновите справочник типов приемов");
            }


            ServicePrice servicePrice = priceMap.get(visitPrice.getId());
View Full Code Here

Examples of framework.generic.EDataIntegrity

        entity.setTraumaType(d.traumaTypeID == 0 ? null : findEntity(TraumaType.class, d.traumaTypeID));
       
        Diagnosis ref = d.referenced == 0 ? null : findEntity(Diagnosis.class, d.referenced);
        if(ref != null
                &&ref.getServiceRender().getId() != entity.getServiceRender().getId()) {
            throw new EDataIntegrity("Связанные диагнозы должны быть в одной услуге");
        }
        entity.setReferenced(ref);
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @throws ClipsServerException есть справки данного типа в базе
     */   
    @Override
    protected void onRemove(Laboratory entity) throws ClipsServerException {
        if (entity.getCheckupTypes().size() > 0) {
                throw new EDataIntegrity("К данной лаборатории привязаны анализы");
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @param details
     * @throws generic.ClipsServerException
     */
    private void check(LaboratoryDetails d) throws ClipsServerException {
    if (d.lpuId == 0){
      throw new EDataIntegrity("Не заданна поликлиника");
    }
    }   
View Full Code Here

Examples of framework.generic.EDataIntegrity

        super.onRemove(entity, audit);
        Field[] fields = new Field[]{
            new Field("direction", entity, Field.OPERATOR_EQUAL)
        };
        if (getEntityCount(CommitteeDirection.class, fields) > 0) {
            throw new EDataIntegrity("Невозможно удалить направление на комиссию, комиссия уже назначена");
        }
    }   
View Full Code Here

Examples of framework.generic.EDataIntegrity

        entity.setAnamnez(d.anamnez);
    }

    @Override
    protected void onRemove(Emc entity, List<AuditDoc> audit) throws ClipsServerException {
        throw new EDataIntegrity("Удаление ЭМК не предусмотрено");
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     */
    @Override
    protected void onRemove(District entity) throws ClipsServerException {
        Field f[] = { new Field("district", entity) };
        if(getEntityCount(Client.class, f) > 0) {
            throw new EDataIntegrity("В базе есть пациенты, приписанные к данному участку, удаление невозможно");
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @throws generic.ClipsServerException
     */
    private void check(DistrictDetails details) throws ClipsServerException {
        DistrictDetails d = details;
    if (d.lpu == 0){
      throw new EDataIntegrity("Не задана поликлиника");
    }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

            }
            if(ser.getCancelled()) {
                throwNeedAdminSecurityException("Одна из услуг уже отменена");
            }
            if(ser.getPolis().getClient().getId() != details.clientID) {
                throw new EDataIntegrity("Попытка записать услугу пациента в прием другого");
            }
            ls.add(ser);
        }

        Collaborator collab = findEntity(Collaborator.class, details.collaboratorID);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.