Package beans.service

Examples of beans.service.ServiceRender


            f = new Field[]{new Field("disease", entity.getDisease())};
        }

        Iterator ii = findEntityList(ServiceRender.class, f).iterator();
        while (ii.hasNext()) {//шуршим по всем услугам в заболевании
            ServiceRender serviceRender = (ServiceRender) ii.next();
            srbl.initByID(serviceRender.getId(), getSessionId());//скормим бину сущность
            //TODO вернуть список аудита
            srbl.removeAndBreakPacket();//и удаляем
        }

        if (overItemsCount == 0){//если других итемов нет - удалим заболевание
View Full Code Here


            //поэтому выбросим их из списка необходимых услуг
            //и хер с ней оказана она или нет
            Field[] f = new Field[]{new Field("disease", disease)};
            Iterator iterator = findEntityList(ServiceRender.class, f).iterator();
            while (iterator.hasNext()) {
                ServiceRender sr = (ServiceRender)iterator.next();
                Iterator<ServiceCheckupChunk> servIter = itemChunk.serviceList.iterator();
                while (servIter.hasNext()) {
                    ServiceCheckupChunk chunk = servIter.next();
                    if (chunk.serviceID == sr.getService().getId()){
                        servIter.remove();//выкидываем услугу
                    }
                }
            }
        } else {
//            pchItem = new ProfcheckupItem();
            disease = new Disease();//сделаем заболевание
            Date current = new Date();
            disease.setCreated(current);//дата по первому созданию
            disease.setDateReg(current);
        }

        Polis polis = findEntity(Polis.class, itemChunk.polisID);
        Integer clientID = polis.getClient().getId();
        Field[] f = {new Field("client.id", clientID)};
        Iterator it = findEntityList(Emc.class, f).iterator();
        if (emcMap.get(clientID) == null) {//проверим в кеше
            Emc emc;
            if (it.hasNext()) {
                emc = (Emc) it.next();
            } else {
                throw new EDataIntegrity("у пациента " + polis.getClient().getSurname() + " " +
                        polis.getClient().getName() + " " + polis.getClient().getPathronymic() +
                        " нет медицинской карты");
            }
            emcMap.put(clientID, emc);
        }
        disease.setEmc(emcMap.get(clientID));
        disease.setCollaborator(findEntity(Collaborator.class, getCollaboratorId()));
        if (disease.getId() == 0) {
            manager.persist(disease);//теперь есть заболевание, мона его юзать(или нет?)
        } else {
            disease = manager.merge(disease);
        }
        manager.flush();
        manager.refresh(disease);

        //заполним профчекапитем
        pchItem.setPolis(polis);
        pchItem.setPassed(false);
        pchItem.setDanger(findEntity(Danger.class, itemChunk.dangerId));
        pchItem.setProfcheckup(findEntity(Profcheckup.class, itemChunk.profcheckupId));
        pchItem.setDisease(disease);
        manager.persist(pchItem);//теперь есть профчекапитем, мона его юзать
        manager.flush();
        manager.refresh(pchItem);
        //Пометим список услуг что они с дангерами
        for (int i = 0; i < itemChunk.serviceList.size(); i++) {
            ServiceCheckupChunk scc = itemChunk.serviceList.get(i);
            scc.dangerID = itemChunk.dangerId;
        }
        //создадим услугу
        NewServicesChunk chunk = new NewServicesChunk(disease.getId(),
                                                0,
                                                polis.getDetails(this),
                                                0,
                                                itemChunk.serviceList,
                                                new HashMap<Integer, Integer>());
        csbl.setSession(getSessionId());
        List<AuditDetails> auditDetailsList = csbl.createNewServices(chunk).getAudit();
        for (AuditDetails ad : auditDetailsList) {
            if (!ad.entityClass.equals(ServiceRender.class.getSimpleName())) {
                continue;
            }
            ServiceRender render = findEntity(ServiceRender.class, ad.getEntityId);
            if (render.getService().getCheckupType() == null){
                MedSerrenResult result = new MedSerrenResult();
                result.setSerren(render);
                manager.persist(result);
            }
        }
View Full Code Here

        List contracts = findEntityList(ServiceRender.class, fields);

        List<ServiceRenderDetails> res = new ArrayList<ServiceRenderDetails>();
        Iterator i = contracts.iterator();
        while (i.hasNext()) {
            ServiceRender sr = (ServiceRender) i.next();
            res.add(sr.getDetails(this));
        }
        return res;
    }
View Full Code Here

        List contracts = findEntityList(ServiceRender.class, fields);

        List<ServiceRenderDetails> res = new ArrayList<ServiceRenderDetails>();
        Iterator i = contracts.iterator();
        while (i.hasNext()) {
            ServiceRender sr = (ServiceRender) i.next();
            res.add(sr.getDetails(this));
        }
        return res;
    }
View Full Code Here

        }

        List<ServiceRenderDetails> res = new ArrayList<ServiceRenderDetails>();
        Iterator i = serRens.iterator();
        while (i.hasNext()) {
            ServiceRender sr = (ServiceRender) i.next();
            res.add(sr.getDetails(this));
        }
        return res;
    }
View Full Code Here

    @Override
    protected void onUpdate(Followup entity, EntityDetails details,
            AuditDoc auditDoc, List<AuditDoc> auditDocList)
            throws ClipsServerException {
        FollowupDetails d = (FollowupDetails) details;
        ServiceRender serviceRender = findEntity(ServiceRender.class, d.serrenUpID);
        Diagnosis diagnosis = findEntity(Diagnosis.class, d.diagnosisUpID);
        if (diagnosis.getServiceRender().getDisease().getId() != serviceRender.getDisease().getId()){
            throw new EDataIntegrity("Услуга, по которой пациент поставлен на учёт, " +
                    "и услуга, в рамках которой поставлен диагноз, должны находиться в одном заболевании");
        }
       
        entity.setDateup(d.dateUp);
View Full Code Here

                        if (!polis.isTrash()) {
                            inTrash = false;
                        }
                        List<ServiceRender> serrenList = findEntityList(ServiceRender.class, "polis.id", polisID);
                        for (int i = 0; i < serrenList.size(); i++) {
                            ServiceRender serviceRender = serrenList.get(i);
                            serviceRender.setPolis(main);
                            saveEntity(serviceRender);
                        }
                        List<ProfcheckupItem> profCheckupList = findEntityList(ProfcheckupItem.class, "polis.id", polisID);
                        for (int i = 0; i < profCheckupList.size(); i++) {
                            ProfcheckupItem profcheckupItem = profCheckupList.get(i);
View Full Code Here

            throwNeedAdminSecurityException("Недостаточно прав для удаления медосмотра, имеющего результаты");
        }
        List<MedSerrenResult> msrList = findEntityList(MedSerrenResult.class, "serren.disease", entity.getDisease());
        for (int i = 0; i < msrList.size(); i++) {
            MedSerrenResult msr = msrList.get(i);
            ServiceRender serren = msr.getSerren();
            List<ServiceRender> findEntityList = findEntityList(ServiceRender.class, "referenced", serren);
            if (findEntityList.size() != 0) {
                for (ServiceRender referenced : findEntityList) {
                    srbl.initByID(referenced.getId(), getSessionId());
                    ServiceRenderBean.breakPacket(manager, referenced, getCollaborator(), auditDocLsit);
                    srbl.onRemove(referenced, auditDocLsit);
                    ServiceRenderBean.remove(manager, referenced, getCollaborator(), auditDocLsit);
                }
            }
            srbl.initByID(serren.getId(), getSessionId());
            ServiceRenderBean.breakPacket(manager, serren, getCollaborator(), auditDocLsit);
            srbl.onRemove(serren, auditDocLsit);
            ServiceRenderBean.remove(manager, serren, getCollaborator(), auditDocLsit);
        }
        Disease disease = entity.getDisease();
View Full Code Here

        //load reception services
        for(int j=0; j<res.size(); j++) {
            SheduleReceptionDetails d = res.get(j);
            Iterator<ServiceRender> ser = findEntityList(ServiceRender.class, "reception.id", d.id).iterator();
            while(ser.hasNext()) {
                ServiceRender sr = (ServiceRender) ser.next();
                d.serviceRenders.add(sr.getId());
            }
        }
        return res;       
    }   
View Full Code Here

        //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);
        }
View Full Code Here

TOP

Related Classes of beans.service.ServiceRender

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.