Package beans.doctor.diagnosis

Examples of beans.doctor.diagnosis.Diagnosis


        List list = findEntityList(Diagnosis.class, fields);

        List<DiagnosisDetails> res = new ArrayList<DiagnosisDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
            Diagnosis j = (Diagnosis) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here


        }

        List<DiagnosisDetails> res = new ArrayList<DiagnosisDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
            Diagnosis j = (Diagnosis) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here

            }
            temp.add(diagnosis);
    }
        //Пробежимся по временному массиву и исключим предварительные диагнозы если есть заключительные
        for (int i = temp.size() -1 ; i >= 0; i--) {
            Diagnosis diagnosis = temp.get(i);
            int disID = diagnosis.getServiceRender().getDisease().getId();
            if (setDisease.contains(disID)
                    && diagnosis.getType().getId() == DiagnosisType.DIAGNOSIS_TYPE_PRELIMINARY) {
                temp.remove(i);
            }
        }
        //преобразование и возврат деталей
        ArrayList<DiagnosisDetails> target = new ArrayList<DiagnosisDetails>();
        for (int i = 0; i < temp.size(); i++) {
            Diagnosis diagnosis = temp.get(i);
            target.add(diagnosis.getDetails(this));
        }
    return target;
    }
View Full Code Here

    protected void onUpdate(Followup entity, EntityDetails details,
            AuditDoc auditDoc, List<AuditDoc> auditDocList)
            throws ClipsServerException {
        FollowupDetails d = (FollowupDetails) details;
        ServiceRender serviceRender = findEntity(ServiceRender.class, d.serrenUpID);
        Diagnosis diagnosis = findEntity(Diagnosis.class, d.diagnosisUpID);
        if (diagnosis.getServiceRender().getDisease().getId() != serviceRender.getDisease().getId()){
            throw new EDataIntegrity("Услуга, по которой пациент поставлен на учёт, " +
                    "и услуга, в рамках которой поставлен диагноз, должны находиться в одном заболевании");
        }
       
        entity.setDateup(d.dateUp);
View Full Code Here

        }


        for (FollowupEvent followupEvent : list) {
            if (followupEvent.getDisease() != null){
                Diagnosis d = m.get(followupEvent.getDisease().getId());
                res.put(followupEvent.getDetails(this), d != null ? d.getMkb10().getId() : null);
            }else{
                res.put(followupEvent.getDetails(this), null);
            }
        }
        return res;
View Full Code Here

                       "ORDER BY d.date";
        Query q = manager.createQuery(query);
        q.setParameter("follupid", follupid);
        List list = q.getResultList();
        for (int i = 0; i < list.size(); i++) {
            Diagnosis diag = (Diagnosis) list.get(i);
            res.add(diag.getDetails(this));
        }
        return res;
    }
View Full Code Here

                ArrayList<Diagnosis> diagList = new ArrayList<Diagnosis>();
                for (EventKey eventKey : eventKeyList) {
                    diagList.add(findEntity(Diagnosis.class, eventKey.diagID));
                }

                Diagnosis diagUp = diagList.get(0);
                /*определяем diagDown - если при последнем диагнозе было снятие с
                 диспансеризации то diagDown не нулл
                 * */
                Diagnosis diagDown = diagList.get(diagList.size() - 1);
                int disp = 0;
                int dispSn = 0;
                for (EventKey eventKey : eventKeyList) {
                    if (eventKey.diagID == diagDown.getId()) {
                        disp = eventKey.disp;
                        dispSn = eventKey.dispSn;
                    }
                }
                if (disp != 4) {
                    diagDown = null;
                }

                Followup followup = new Followup();
                followup.setDateup(diagUp.getDate());
                followup.setDatedown(diagDown == null ? null : diagDown.getDate());
                followup.setCollaboratorUp(diagUp.getServiceRender().getDisease().getCollaborator());
                followup.setCollaboratorDown(diagDown == null ? null : diagDown.getServiceRender().getDisease().getCollaborator());
                followup.setUpReason(upReason);
                FollowDownReason fd = fdmap.get(dispSn);
                if (fd == null) {
                    fd = downReason;
                }
                followup.setDownReason(diagDown == null ? null : fd);
                followup.setValue(null);
                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);
View Full Code Here

            if ((counter % 10000) == 0) {
                System.out.println("Загрузка и подсчет диагнозов - выполнено " + counter/((float)diagnosisList.size())*100 + "% (" + counter + ") запись");
                manager.clear();
        System.gc();
            }
            Diagnosis diagnosis = findEntity(Diagnosis.class, diagID);
            int dsID = diagnosis.getServiceRender().getDisease().getId();
            Integer value = mapDisease.get(dsID);
            value ++;
            mapDisease.put(dsID, value);
            counter ++;
        }
View Full Code Here

        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];
            Integer typeID = (Integer) line[2];
            String mkbCode = (String) line[3];
            mkbCode = fixMkbCode(mkbCode);
            DiagnosisEncounter encounter = (DiagnosisEncounter) line[4];
            DiagInfo diagInfo = target.get(disID);
View Full Code Here

        throw new EDataIntegrity("Запрещено указывать две организации, куда выдан больничный");
      }
      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);
            }
           
      entity.setComment(d.comment);
      entity.setDisabilityType(findEntity(DisabilityType.class, d.disabID));
      // доделал код виталия, сотрудника создавшего больничный, можно установить по первому sickLong
      // (мое имхо отчеты будет выбирать страшний геморой)
      if (d.openerID != 0){
        if (d.altOpener != null){
          throw new EDataIntegrity("Указано одновременно два сотрудника, открывших больничный лист");
        }
        if (d.altLpu != null){
          throw new EDataIntegrity("Сотрудниник этой поликлиники выдал больнчный альтернативной. Внутренняя ошибка.");
        }
        entity.setOpener(findEntity(Collaborator.class, d.openerID));
        entity.setAltlpu(null);
        entity.setAltopener(null);
      }else{
        if (d.altLpu == null){
          throw new EDataIntegrity("Не указанна организация выдавшая больничный");
        }
       
        if (d.altOpener == null || d.altOpener.trim().length() < 3){
          throw new EDataIntegrity("Не указан сотрудник, открывший больничный лист");
        }
        entity.setOpener(null);
        entity.setAltlpu(d.altLpu);
        entity.setAltopener(d.altOpener);
      }
      entity.setDateOpen(d.dateOpen);

      // после того как был установлен Referenced
      checkValidSicklistDiagnosis(entity, diagnosis);
      if (referenced != null){
        if (referenced.getDiagClose() == null){
          throw new EDataIntegrity("Попытка продления незакрытого больничного листа, сперва закройте больничный лист");
        }
        if (referenced.getDiagOpen().getServiceRender().getDisease().getEmc().getId()
            != diagnosis.getServiceRender().getDisease().getEmc().getId()){
          throw new EDataIntegrity("Продляемый больничный находится в другой медицинской карте");
        }
      }
      entity.setDiagOpen(diagnosis);
View Full Code Here

TOP

Related Classes of beans.doctor.diagnosis.Diagnosis

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.