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);