Package beans.followup.entity

Examples of beans.followup.entity.FollowupEvent


            List<Object[]> res = query.getResultList();
            ArrayList<FollowupData> target = new ArrayList<FollowupData>();
            for (int i = 0; i < res.size(); i++) {
                Object[] line = res.get(i);
                Followup f = (Followup) line[0];
                FollowupEvent e = (FollowupEvent) line[1];
                Client c = (Client) line [2];
                FollowupData d = new FollowupData();
                d.details = f.getDetails(this);
                d.fio = c.getFio();
                d.clientID = c.getId();
                d.lastEventDetails = e.getDetails(this);
                target.add(d);
            }
            return target;
    }
View Full Code Here


    @Override
    public ModificationInfo setEvent(FollowupEventDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_WRITE_FOLLOWUP_EVENT);
        Followup entity = getExistentEntity();
       
        FollowupEvent event = null;
        if (details.date.before(DateTimeUtils.getDateOnly()) && !isSuperUser() && !hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA)) {
            throw new ESecurity("Недостаточно прав для записи о приеме по ДУ задним числом");
        }
        AuditDoc<FollowupEvent> auditFEvent;
        if(details.id != 0) {
            event = findEntity(FollowupEvent.class, details.id);
            checkTheSame(event.getFollup());
            auditFEvent = new AuditDoc<FollowupEvent>(event, getCollaborator());
        } else {
            event = new FollowupEvent();
            auditFEvent = new AuditDoc<FollowupEvent>(event, getCollaborator());
            event.setFollup(entity);
        }
        event.setDate(details.date);
        event.setCancelled(details.cancelled);
        event.setCalled(details.called);
        int id = saveEntity(event);
        auditFEvent.check(event);
        return new ModificationInfo(id, persistAudit(auditFEvent));
    }
View Full Code Here

    @Override
    public ModificationInfo removeEvent(int id) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_WRITE_FOLLOWUP_EVENT);
        checkEntityExist();
       
        FollowupEvent event = findEntity(FollowupEvent.class, id);
        checkTheSame(event.getFollup());
        AuditDoc<FollowupEvent> auditFevent = new AuditDoc<FollowupEvent>(event, getCollaborator());
        manager.remove(event);
        auditFevent.check(null);
        return new ModificationInfo(0, persistAudit(auditFevent));
    }
View Full Code Here

        if (details.id == 0) {
            throw new ClipsServerException("Необходимо сохранить приём");
        }
        ArrayList<AuditDoc> auditDoclList = new ArrayList<AuditDoc>();

        FollowupEvent event = findEntity(FollowupEvent.class, details.id);
        checkTheSame(event.getFollup());
        AuditDoc<FollowupEvent> auditFevent = new AuditDoc<FollowupEvent>(event, getCollaborator());
        auditDoclList.add(auditFevent);
        Disease disease = new Disease();//сделаем заболевание
        AuditDoc<Disease> auditDisease = new AuditDoc<Disease>(disease, getCollaborator());
        auditDoclList.add(auditDisease);
        Date current = new Date();
        disease.setCreated(current);//дата по первому созданию
        disease.setVisitingPurpose(findEntity(VisitingPurpose.class, VisitingPurpose.VP_FOLLOWUP));
        disease.setDateReg(details.date);
        disease.setEmc(getExistentEntity().getSerrenUp().getDisease().getEmc());
        disease.setCollaborator(findEntity(Collaborator.class, getCollaboratorId()));
        event.setDisease(disease);
        manager.persist(disease);
        manager.merge(event);
        manager.flush();
        manager.refresh(disease);
        manager.refresh(event);
View Full Code Here

                followup.setSerrenUp(diagUp.getServiceRender());
                followup.setSerrenDown(diagDown == null ? null : diagDown.getServiceRender());
                followup.setDiagnosisUp(diagUp);
                manager.persist(followup);
                for (Diagnosis diagnosis : diagList) {
                    FollowupEvent followupEvent = new FollowupEvent();
                    followupEvent.setFollup(followup);
                    followupEvent.setDate(diagnosis.getDate());
                    followupEvent.setCancelled(false);
                    followupEvent.setCalled(true);
                    followupEvent.setDisease(diagnosis.getServiceRender().getDisease());
                    manager.persist(followupEvent);
                }
            }
            counter ++;
            it.remove();
View Full Code Here

TOP

Related Classes of beans.followup.entity.FollowupEvent

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.