Examples of Lpu


Examples of beans.directory.lpu.entity.Lpu

    }

    @Override
    public List<ProfcheckupContractChunk> getUsableContractsM(EnterpriseDetails ed) throws ClipsServerException {
        ArrayList<ProfcheckupContractChunk> list = new ArrayList<ProfcheckupContractChunk>();
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();

        Date date = new Date();
        String sql = "SELECT pol, dj " +
                    "FROM Polis pol WHERE pol.contract.enterprise.id IN (SELECT DISTINCT dj.job.enterprise.id FROM DangerJob dj) " +
                    "AND dj.job.client = pol.client " +
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

        if (d.code == null || d.code.isEmpty()) {
            throw new ClipsServerException("Не указан табельный номер сотрудника");
        }
        //Проверка Существует ли другой сотрудник с таким табельным номером
        Collaborator coll = findEntity(Collaborator.class, getCollaboratorId());
        Lpu lpu = coll.getLpu();

        Field[] f = {new Field("code", d.code), new Field("lpu", lpu)};
        List<Collaborator> collabList = findEntityList(Collaborator.class, f);
        boolean founded = false;
        for (Collaborator collaborator : collabList) {
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

        cal.set(Calendar.YEAR, year);
        cal.set(Calendar.MONTH, month-1);
        cal.set(Calendar.DAY_OF_MONTH, 1);
        cal = initCalendar(cal.getTime());
       
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        Date begin = cal.getTime();
        cal.add(Calendar.MONTH, 1);
        Date end = cal.getTime();

        Field f[] = {
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

    public void removeException(Date day) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);
        checkIsNotInThePast(day);


        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        Calendar cal = initCalendar(day);
        Date begin = cal.getTime();
        cal.add(Calendar.DAY_OF_MONTH, 1);
        Date end = cal.getTime();
       
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

    public int setException(Date day, boolean working, String desc,
            int timeBegin, int duration) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);
        checkIsNotInThePast(day);
       
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        Calendar cal = initCalendar(day);
        Date begin = cal.getTime();
        cal.add(Calendar.DAY_OF_MONTH, 1);
        Date end = cal.getTime();
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

        }
        Calendar cal = GregorianCalendar.getInstance();
        cal.setTime(end);
        cal.add(Calendar.DAY_OF_YEAR, 1);
        end = cal.getTime();
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        //HashMap<String, Integer> priceMap = getPriceMap();

        String sqlSr = "SELECT sr FROM ServiceRender sr " +
                "WHERE sr.disease.closed IS NOT NULL " +
                "AND sr.disease.dateReg >= :begin " +
                "AND sr.disease.dateReg < :end " +
                "AND sr.polis.contract.type = :typeOMI " +
                "AND sr.service.serviceClass.id = :visit " +
                "AND sr.functions.collaborator.lpu.id = :lpuID"; //Клиника текущего сотрудника
        Query qSr = manager.createQuery(sqlSr);
        qSr.setParameter("begin", begin);
        qSr.setParameter("end", end);
        qSr.setParameter("typeOMI", Contract.TYPE_OMI);
        qSr.setParameter("visit", ServiceClass.SERVICE_CLASS_VISIT);
        qSr.setParameter("lpuID", lpu.getId());
        List<ServiceRender> resultList = qSr.getResultList(); //Все посещения

        //Подгрузка и маппирование мест работы
        HashMap<Integer, Enterprise> jobMap = createJobMap(begin, end);
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

    private HashMap<Integer, DiagInfo> createDiagMap(Date begin, Date end) throws ClipsServerException {
        /* Замаппироваться должны все диагнозы ссылающиеся на заболевания, для всех
         * заболеваний, на которые есть ссылки из серренов, подходящих под
         */
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        System.out.println("Запрос диагнозов...");
        String sql = "SELECT d.serviceRender.disease.id, " +
                "d.referenced, " +
                "d.type.id, " +
                "d.mkb10.code, " +
                "d.encounter, " +
                "d.id " +
                "from Diagnosis d " +
                "WHERE d.serviceRender.disease.id in (SELECT sr.disease.id FROM ServiceRender sr " +
                    "WHERE sr.disease.closed IS NOT NULL " +
                    "AND sr.disease.dateReg >= :begin " +
                    "AND sr.disease.dateReg < :end " +
                    "AND sr.polis.contract.type = :typeOMI " +
                    "AND sr.service.serviceClass.id = :visit " +
                    "AND sr.functions.collaborator.lpu.id = :lpuID) " + //Клиника текущего сотрудника
                "ORDER BY d.serviceRender.disease.id ASC, d.id DESC";
        Query q = manager.createQuery(sql);
        q.setParameter("begin", begin);
        q.setParameter("end", end);
        q.setParameter("typeOMI", Contract.TYPE_OMI);
        q.setParameter("visit", ServiceClass.SERVICE_CLASS_VISIT);
        q.setParameter("lpuID", lpu.getId());
        List<Object[]> resultList = q.getResultList();
        HashMap<Integer, DiagInfo> target = new HashMap<Integer, DiagInfo>();
        for (Object[] line : resultList) {
            Integer disID = (Integer) line[0];
            Diagnosis referced = (Diagnosis) line[1];
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

    private HashMap<Integer, SickInfo> createSickListMap(Date begin, Date end) throws EDataIntegrity, ClipsServerException {
        /* Заммаппироваться должны все больничные по серренам подходящим для
         выгрузки
         */
        System.out.println("Запрос больничных...");
        Lpu lpu = findEntity(Collaborator.class, getCollaboratorId()).getLpu();
        String sql = "SELECT sl.serren.id, sl.sicklist.id, sl.sicklist.dateOpen, sl.sicklist.dateToWork  from SickLong sl " +
                "WHERE sl.serren.disease.closed IS NOT NULL " +
                "AND sl.serren.disease.dateReg >= :begin " +
                "AND sl.serren.disease.dateReg < :end " +
                "AND sl.serren.polis.contract.type = :typeOMI " +
                "AND sl.serren.service.serviceClass.id = :visit " +
                "AND sl.serren.functions.collaborator.lpu.id = :lpuID "; //Клиника текущего сотрудника
        Query q = manager.createQuery(sql);
        q.setParameter("begin", begin);
        q.setParameter("end", end);
        q.setParameter("typeOMI", Contract.TYPE_OMI);
        q.setParameter("visit", ServiceClass.SERVICE_CLASS_VISIT);
        q.setParameter("lpuID", lpu.getId());
        List<Object[]> resultList = q.getResultList();
        HashMap<Integer, SickInfo> target = new HashMap<Integer, SickInfo>();
        for (Object[] line : resultList) {
            Integer srID = (Integer) line[0];
            Integer id = (Integer) line[1];
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

    protected void onUpdate(Lpu entity, EntityDetails details,
            AuditDoc auditDoc, List<AuditDoc> auditDocList)
            throws ClipsServerException {

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

        lpu.setTitle(d.title);
        lpu.setTitleShort(d.title_short);

        if (d.lpuCode == null) {
            throw new ClipsServerException("Не указан код ЛПУ в кодировке ТФОМС");
        }
        lpu.setLpuCode(d.lpuCode);

        if (d.ogrn == null) {
            throw new ClipsServerException("Не указан ОГРН код ЛПУ");
        }
        lpu.setOgrn(d.ogrn);

        if (d.chiefDoctor == 0) {
            throw new ClipsServerException("Не указан главврач ЛПУ");
        }
        lpu.setChiefDoctor(findEntity(Collaborator.class, d.chiefDoctor));

        if (d.accountant == 0) {
            throw new ClipsServerException("Не указан бухгалтер ЛПУ");
        }
        lpu.setAccountant(findEntity(Collaborator.class, d.accountant));
       
        if (d.clinicType == 0) {
            throw new ClipsServerException("Не указан тип ЛПУ");
        }
        if (d.insurer == 0) {
            throw new ClipsServerException("Не указана страховая компания по умолчанию");
        }
        if (d.subdivisionCode == null) {
            throw new ClipsServerException("Не указан код подразделение ЛПУ");
        }
        if (d.branch == null) {
            throw new ClipsServerException("Не указан код филиала РФОМС");
        }

        lpu.setPhone(d.phone == null ? "" : d.phone);
        lpu.setFax(d.fax == null ? "" : d.fax);
        lpu.setEmail(d.email == null ? "" : d.email);
        lpu.setOkpo(d.okpo == null ? "" : d.okpo);
        lpu.setOkonh(d.okonh == null ? "" : d.okonh);
        lpu.setOkved(d.okved == null ? "" : d.okved);
        lpu.setOkogu(d.okogu == null ? "" : d.okogu);
        lpu.setOkopf(d.okopf == null ? "" : d.okopf);
        lpu.setOkfc(d.okfc == null ? "" : d.okfc);
        lpu.setClinicType(findEntity(ClinicType.class, d.clinicType));
        lpu.setInsurer(findEntity(Insurer.class, d.insurer));
        lpu.setSubdivisionCode(d.subdivisionCode);
        lpu.setBranch(d.branch);

        Address address = lpu.getAddress();
        AddressDetails ad = d.addressDetails;
        if (ad != null && ad.objectId != 0) {
            if (address == null){
                address = new Address();
            }
            address.setAddressObject(findEntity(AddressObject.class, ad.objectId));
            address.setBuilding(ad.building);
            address.setFlat(ad.flat);
            saveEntity(address);
            lpu.setAddress(address);
        }else{
            throw new EDataIntegrity("Не указан адрес");
        }

    }
View Full Code Here

Examples of beans.directory.lpu.entity.Lpu

        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
TOP
Copyright © 2018 www.massapi.com. 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.