Package beans.user.collaborator.entities

Examples of beans.user.collaborator.entities.Collaborator


    for (Object[] line : list) {
      Disease        disease = (Disease) line[0];
      DiseaseRange    range = ranges.get(disease);
      boolean        rendered = line[1] != null;
      Date        date = (Date) line[1];
            Collaborator        coll = rendered ? ((CollaboratorFunctions) line[2]).getCollaborator() : null;
      if (disease == null){
        continue;
      }
      if (range == null){
        range = new DiseaseRange();
View Full Code Here


        LpuDetails d = (LpuDetails) details;
        Lpu lpu = entity;

        if (details.getId() != 0) {
            //Проверка на модификацию только своей клиники
            Collaborator collab = findEntity(Collaborator.class, getCollaboratorId());
            if (collab.getLpu().getId() != lpu.getId()
                    && RightPresence(UserRightsSet.WRITE_REGION_ADMIN_DIRECTORY.id) < 0) {
                throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_REGION_ADMIN_DIRECTORY.id));
            }
        }
View Full Code Here

    return loadChildDetailsList(ServiceRender.class, "referenced");
    }

    @Override
    public String canRenderService() throws ClipsServerException{
        Collaborator collaborator = findEntity(Collaborator.class, getCollaboratorId());
        String sql = "SELECT COUNT(cf) FROM ServicePrice sp, CollaboratorFunctions cf " +
                "WHERE sp.service =:serv " +
                "AND (sp.receptionType = cf.receptionType OR sp.receptionType IS NULL) AND cf.collaborator=:collab ";
        if (!isSuperUser()){
            sql += "AND cf.trash = FALSE";
View Full Code Here

        super.set(entity, details);

        entity.setTitle(details.title);

        if(details.collaboratorID > 0) {
            Collaborator coll = findEntity(Collaborator.class, details.collaboratorID, "сотрудники");
      coll.checkNotFired();
            entity.setCollaborator(coll);
        }
    }
View Full Code Here

        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 {
View Full Code Here

    super.onRemove(entity, audit);
  }
 
  @Override
  protected void getExtraDefaultParameters(Map<String, Object> target, ConfigBeanRemoteM config) throws ClipsServerException{
    Collaborator collab = findEntity(Collaborator.class, getCollaboratorId());
       
        Lpu lpu = collab.getLpu();
        if (lpu != null) {
            target.put("hospital_name", lpu.getTitle());

            if (lpu.getAddress() != null) {
                target.put("hospital_addres", lpu.getAddress().getAsStringShort());
            }

            Collaborator director = collab.getLpu().getChiefDoctor();
            if (director != null){
                target.put("director_fio", director.getClient().getFio());
            }

            target.put("id_ogrn_company_code", lpu.getOgrn() != null ? lpu.getOgrn() : "");
            target.put("id_company_by_okpo", lpu.getOkpo() != null ? lpu.getOkpo() : "");
      target.put("id_industry_by_okonh", lpu.getOkonh() != null ? lpu.getOkonh() : "");
View Full Code Here

        Pair<Polis, AuditDetails> pair = getPolis(chunk.polisDetails);
        Polis polis = pair.first;
        if (pair.second != null) {
            auditDetList.add(pair.second);
        }
        Collaborator collaborator = findEntity(Collaborator.class, getCollaboratorId());

        Set<Integer> contractServIDs = new HashSet<Integer>();
        Iterator it = findEntityList(ServicePrice.class, "contract", polis.getContract()).iterator();
        while (it.hasNext()) {
            ServicePrice j = (ServicePrice) it.next();
View Full Code Here

        Polis polis = pair.first;
        Contract contract = polis.getContract();
        if (pair.second != null) {
            auditDetList.add(pair.second);
        }
        Collaborator collaborator = findEntity(Collaborator.class, getCollaboratorId());
        if (contract.getLpu() != null && contract.getLpu().getId() != collaborator.getLpu().getId()) {
            throw new EDataIntegrity("Указанный контракт не заключен с данной клиникой");
        }

        for (int i = 0; i < chunk.serviceList.size(); i++) {
           
View Full Code Here

            for (int i = 0; i < contractPachetList.size(); i++) {
                Contract contract = (contractPachetList.get(i)).getContract();
                contractSet.add(contract);
            }
        }
        Collaborator collab = findEntity(Collaborator.class, getCollaboratorId());
        Lpu lpu = collab.getLpu();

        //Поиск действующих полисов для пациента
        Client client = findEntity(Client.class, clientID);
        String sql = "SELECT a FROM Polis a" + " WHERE a.client=:client" +
                " AND (a.fromDate <= :current OR a.fromDate IS NULL)" +
View Full Code Here

    @Override
    public SerrenMod createNewSerren(ServiceRenderDetails serrenDetails) throws ClipsServerException {
        AuditDoc<ServiceRender> auditDoc = new AuditDoc<ServiceRender>(null, getCollaborator());
        Contract contract = findEntity(Polis.class, serrenDetails.polisID).getContract();
        Collaborator collaborator = findEntity(Collaborator.class, getCollaboratorId());
        if (contract.getLpu() != null && contract.getLpu().getId() != collaborator.getLpu().getId()) {
            throw new EDataIntegrity("Указанный контракт не заключен с данной клиникой");
        }
        ServiceRender serren = new ServiceRender();
        //date;           //дата назначения услуги - если нет права создавать другим числом то только сегодняшняя дата
        if (DateTimeUtils.belongsToCurrentDay(serrenDetails.date)
                || hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA)) {
            serren.setDate(serrenDetails.date);
        } else {
            throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA.id));
        }

        //renderDate;     //дата оказания - нулл
        if (serrenDetails.renderDate != null) {
            throw new ClipsServerException("Нельзя создавать оказанную услугу");
        } else {
            serren.setRenderedDate(null);
        }

        //discount;        //Скидка в процентах - пофиг, проверка не здесь
        serren.setDiscount(serrenDetails.discount);

        //cancelled;   //флаг отменена - false
        if (serrenDetails.cancelled == true) {
            throw new ClipsServerException("Нельзя создавать отмененную услугу");
        } else {
            serren.setCancelled(serrenDetails.cancelled);
        }

        //repeat;          //повторы услуги - 0
        if (serrenDetails.repeat != 0) {
            throw new ClipsServerException("Нельзя создавать услугу, оказанную повторно");
        } else {
            serren.setRepeat(serrenDetails.repeat);
        }

        //polisID;         // - != 0
        Polis polis;
        if (serrenDetails.polisID == 0) {
            throw new ClipsServerException("Нельзя создавать услугу без указания полиса");
        } else {
            polis = findEntity(Polis.class, serrenDetails.polisID);
            serren.setPolis(polis);
        }

        //collaboratorID;  // - 0
        if (serrenDetails.functionsID != 0) {
            throw new ClipsServerException("Нельзя создавать оказанную услугу");
        } else {
            serren.setFunctions(null);
        }

        //directorID;      // - если нет права создавать от другого имени, то только текущий сотрудник
        if (getCollaboratorId() == serrenDetails.directorID
                || hasRight(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA)) {
            Collaborator director = findEntity(Collaborator.class, serrenDetails.directorID);
            serren.setDirector(director);
        } else {
            throw new ESecurity(SecurityChecker.getClientHasNoRightMsg(UserRightsSet.WRITE_STATISTIC_MEDICAL_DATA.id));
        }
View Full Code Here

TOP

Related Classes of beans.user.collaborator.entities.Collaborator

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.