Package beans.doctor.sicklist.entity

Examples of beans.doctor.sicklist.entity.Sicklist


       
        List list = findEntityList(Sicklist.class, "diagOpen.serviceRender.disease.emc.client", entity, "order by a.dateOpen");
        List<SicklistDetails> res = new ArrayList<SicklistDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
            Sicklist j = (Sicklist) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here


        List list = findEntityList(Sicklist.class, fields, " order by a.dateOpen");
        List<SicklistDetails> res = new ArrayList<SicklistDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
            Sicklist j = (Sicklist) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here

     * удаление
     */
  // внимание возможна проблеме если бин не будет Stateful
    @Override
    protected void initBeanRights() throws ClipsServerException {
        Sicklist entity = (getId() == 0) ? null : getExistentEntity();
        int[] r = new int[7];
        r[COMMAND_CREATE] = RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id);
        r[COMMAND_READ] = RightPresence(UserRightsSet.READ_MEDICAL_DATA.id);
        if (entity != null) {
            Collaborator opener = entity.getOpener();
            Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
            //выставление команд на модификацию

            /*Запись серийника
             * возможна при наличии соответствующего права
             * только сотрудником из той же поликлиники, где был открыт больничный
             */
            if (RightPresence(UserRightsSet.WRITE_SICKLIST_SERIAL.id) > 0) {
                if (opener.getLpu().getId() == lpu.getId()) {
                    r[COMMAND_WRITE_SERIAL] = UserRightsSet.WRITE_SICKLIST_SERIAL.id;
                } else {
                    r[COMMAND_WRITE_SERIAL] = -UserRightsSet.WRITE_SICKLIST_SERIAL.id;
                }
            } else {
                r[COMMAND_WRITE_SERIAL] = -UserRightsSet.WRITE_SICKLIST_SERIAL.id;
            }

            /*Продление
             * возможно при наличии права записывать мед данные, в любой поликлинике
             */
            r[COMMAND_WRITE_LONG] = RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id);

            /*Закрытие
             * возможно при наличии права записывать мед данные, в любой поликлинике
             * либо при наличии команды записи серийника (для закрытия в кабинете
             * регистрации БЛ в случае неявки пациента)
             */
            r[COMMAND_WRITE_LONG] = RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id);
            if (r[COMMAND_WRITE_LONG] < 0 && r[COMMAND_WRITE_SERIAL] > 0) {
                r[COMMAND_WRITE_LONG] = r[COMMAND_WRITE_SERIAL];
            }

            /* модификация возможна при любом из 3 случаев
             */
            if (r[COMMAND_WRITE_CLOSE] > 0) {
                r[COMMAND_MODIFY] = r[COMMAND_WRITE_CLOSE];
            } else if (r[COMMAND_WRITE_LONG] > 0) {
                r[COMMAND_MODIFY] = r[COMMAND_WRITE_LONG];
            } else if (r[COMMAND_WRITE_SERIAL] > 0) {
                r[COMMAND_MODIFY] = r[COMMAND_WRITE_SERIAL];
            } else {
                r[COMMAND_MODIFY] = -UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id;
            }

            /* Удаление возможно при таких же проверках как и для других
             * медицинских данных (см. MedicalDataBean)
             */
            int removeRight = 0;
            if (RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY.id) > 0){
                //Начинаем проверять со слабого права
                removeRight = entity.getDiagOpen().getServiceRender().canWriteDuringDay(
                        isSuperUser(),
                        UserRightsSet.WRITE_MEDICAL_DATA_DURING_DAY,
                        getCollaboratorId());
            }
            if (RightPresence(UserRightsSet.WRITE_MEDICAL_DATA_ANY_TIME.id) > 0){
                //Если есть более сильное право, то команда перезаписывается им
                removeRight = entity.getDiagOpen().getServiceRender().canWriteAnyTime(
                        isSuperUser(),
                        UserRightsSet.WRITE_MEDICAL_DATA_ANY_TIME,
                        findEntity(Collaborator.class, getCollaboratorId()));
            }
            if (isSuperUser() && removeRight <= 0) {
View Full Code Here

    @SuppressWarnings("unchecked")
    ArrayList<Sicklist>      list =
          new ArrayList<Sicklist>(findEntityList(Sicklist.class, "diagOpen.id", diag.getId()));
    list.addAll(findEntityList(Sicklist.class, "diagClose.id", diag.getId()));
    topfor: for (Sicklist found : list) {
      Sicklist        cur = entity;
      while (cur != null){
        if (found.getId() == cur.getId()){
          isHasCurSicklists = true;
        }
        cur = cur.getReferenced();
      }
    }
    if (list.size() > 0 && !isHasCurSicklists){
      throw new EDataIntegrity("По данному диагнозу уже выдан другой больничный лист");
    }
View Full Code Here

      }
      entity.setEnterprise(d.entID == 0 ? null: findEntity(Enterprise.class, d.entID));
      entity.setOtherDirection(d.otherDirection);

      Diagnosis      diagnosis = findEntity(Diagnosis.class, d.diagOpenID);
      Sicklist      referenced = d.refID == 0? null: findEntity(Sicklist.class, d.refID);
      entity.setReferenced(referenced);
            //обновляем head
            if(referenced != null) {
                Sicklist head = referenced.getHead();
                if(head == null) {
                    head = referenced;
                }
                entity.setHead(head);
            }
View Full Code Here

        Collection<Sicklist> serRens = findEntityList(Sicklist.class, fields , " ORDER by a.dateOpen");
       
        List<SicklistDetails> res = new ArrayList<SicklistDetails>();
        Iterator<Sicklist> iter = serRens.iterator();
        while(iter.hasNext()) {
            Sicklist j =  iter.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;         
    }
View Full Code Here

        SickLong sickLong = null;
        if (!sicklongList.isEmpty()) {
            sickLong = sicklongList.get(sicklongList.size() - 1);
        }
        Sicklist sicklist = null;
        if (!sickLists.isEmpty()) {
            sicklist = sickLists.get(sickLists.size() - 1);
        }
        if (sickLong == null && sicklist == null) {
            return null;
        } else if (sickLong == null) {
            return sicklist.getDetails(this);
        } else if (sicklist == null) {
            return sickLong.getSicklist().getDetails(this);
        } else if (sickLong.getDate().after(sicklist.getDateToWork())) {
            return sickLong.getSicklist().getDetails(this);
        } else {
            return sicklist.getDetails(this);
        }
    }
View Full Code Here

TOP

Related Classes of beans.doctor.sicklist.entity.Sicklist

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.