浏览代码

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

wangzhinan 11 月之前
父节点
当前提交
c869e683b7

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -7997,7 +7997,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            e.printStackTrace();
        }
        rs.put("sex", basePatientDO.getSex());
        rs.put("sex", IdCardUtil.getSex(basePatientDO.getSex(),basePatientDO.getCardType(),basePatientDO.getIdcard()));
        rs.put("provinceCode", basePatientDO.getProvinceCode());
        rs.put("provinceName", basePatientDO.getProvinceName());
        rs.put("cityCode", basePatientDO.getCityCode());

+ 24 - 31
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -6297,26 +6297,18 @@ public class StatisticsEsService {
        }
        //专家咨询数量 = 图文咨询 + 视频咨询
        //协同门诊
        List<SaveModel> xt_list = elasticsearchUtil.findDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "14", SaveModel.timeLevel_ZL, "12", null, "4");
        ///图文咨询
        List<SaveModel> twzx_list = elasticsearchUtil.findDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "1", null, "4");
        //图文复诊
        List<SaveModel> twfz_list = elasticsearchUtil.findDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "12", SaveModel.timeLevel_ZL, "9", null, "4");
        //视频咨询
        List<SaveModel> spzx_list = elasticsearchUtil.findDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "17", null, "4");
        //视频复诊
        List<SaveModel> spfz_list = elasticsearchUtil.findDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "16", SaveModel.timeLevel_ZL, "16", null, "4");
        List<SaveModel> wz_model01_17 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, null, "17");
        List<SaveModel> wz_model01_1 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, null, "1");
        List<SaveModel> wz_model01_9 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, null, "9");
        List<SaveModel> wz_model01_12 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, null, "12");
        List<SaveModel> wz_model01_16 = elasticsearchUtil.findListDateQuotaLevel1(qvo.getStartDate(), qvo.getEndDate(), qvo.getArea(), qvo.getLevel(), "5", SaveModel.timeLevel_ZL, null, "16");
        JSONObject result = new JSONObject();
        int xtmz = countListTotal(xt_list);
        int twzx = countListTotal(twzx_list);
        int twfz = countListTotal(twfz_list);
        int spzx = countListTotal(spzx_list);
        int spfz = countListTotal(spfz_list);
        int xtmz = countListTotal(wz_model01_12);//问诊类型_专科协同
        int twzx = countListTotal(wz_model01_1);//问诊类型_图文咨询
        int twfz = countListTotal(wz_model01_9);//问诊类型_图文复诊
        int spzx = countListTotal(wz_model01_17);//问诊类型_视频咨询
        int spfz = countListTotal(wz_model01_16);//问诊类型_视频复诊
        //计算百分比
        int total = xtmz + twzx + twfz + spzx + spfz;
@ -7438,24 +7430,24 @@ public class StatisticsEsService {
        WritableWorkbook wwb = Workbook.createWorkbook(os);
        try {
            WritableSheet sheet = wwb.createSheet("sheet", 1);
            String header[] = {"科室", "医生", "问诊量", " 接诊量", "接诊率", "处方量", "诊查费", "药品费", "总收入"};
            String header[] = {"科室", "医生", "问诊量", "接诊量","未接诊量", "接诊率", "处方量", "诊查费", "药品费", "总收入"};
            int i = 0;
            for (String h : header) {
                addCellHospital(sheet, 0, i, h);
                i++;
            }
            int j = 1;
            for (Map<String, Object> map : deptList) {
                addCellHospital(sheet, j, 0, String.valueOf(map.get("deptName")) + "全体");
                addCellHospital(sheet, j, 0, map.get("deptName") + "全体");
                addCellHospital(sheet, j, 1, String.valueOf(map.get("doctorName")));
                addCellHospital(sheet, j, 2, String.valueOf(map.get("total")));
                addCellHospital(sheet, j, 3, String.valueOf(map.get("haveReceiveCount")));//接诊量
                addCellHospital(sheet, j, 4, String.valueOf(map.get("jzl")));//接诊率
                addCellHospital(sheet, j, 5, String.valueOf(map.get("prescription_volume")));//处方量
                addCellHospital(sheet, j, 6, String.valueOf(map.get("free_exam")));//诊查费
                addCellHospital(sheet, j, 7, String.valueOf(map.get("free_prescription")));//药品费
                addCellHospital(sheet, j, 8, String.valueOf(map.get("fee_total")));//药品费
                addCellHospital(sheet, j, 4, String.valueOf(map.get("noReceiveCount")));//未接诊量
                addCellHospital(sheet, j, 5, String.valueOf(map.get("jzl")));//接诊率
                addCellHospital(sheet, j, 6, String.valueOf(map.get("prescription_volume")));//处方量
                addCellHospital(sheet, j, 7, String.valueOf(map.get("free_exam")));//诊查费
                addCellHospital(sheet, j, 8, String.valueOf(map.get("free_prescription")));//药品费
                addCellHospital(sheet, j, 9, String.valueOf(map.get("fee_total")));//药品费
                j++;//换行
                //填充医生数据
                List<Map<String, Object>> doctorList = (List<Map<String, Object>>) linkedHashMap.get(map.get("deptCode"));//取出科室的数据
@ -7464,11 +7456,12 @@ public class StatisticsEsService {
                    addCellHospital(sheet, j, 1, String.valueOf(doctorMap.get("doctorName")));
                    addCellHospital(sheet, j, 2, String.valueOf(doctorMap.get("total")));
                    addCellHospital(sheet, j, 3, String.valueOf(doctorMap.get("haveReceiveCount")));//接诊量
                    addCellHospital(sheet, j, 4, String.valueOf(doctorMap.get("jzl")));//接诊率
                    addCellHospital(sheet, j, 5, String.valueOf(doctorMap.get("prescription_volume")));//处方量
                    addCellHospital(sheet, j, 6, String.valueOf(doctorMap.get("free_exam")));//诊查费
                    addCellHospital(sheet, j, 7, String.valueOf(doctorMap.get("free_prescription")));//药品费
                    addCellHospital(sheet, j, 8, String.valueOf(doctorMap.get("fee_total")));//药品费
                    addCellHospital(sheet, j, 4, String.valueOf(map.get("noReceiveCount")));//未接诊量
                    addCellHospital(sheet, j, 5, String.valueOf(doctorMap.get("jzl")));//接诊率
                    addCellHospital(sheet, j, 6, String.valueOf(doctorMap.get("prescription_volume")));//处方量
                    addCellHospital(sheet, j, 7, String.valueOf(doctorMap.get("free_exam")));//诊查费
                    addCellHospital(sheet, j, 8, String.valueOf(doctorMap.get("free_prescription")));//药品费
                    addCellHospital(sheet, j, 9, String.valueOf(doctorMap.get("fee_total")));//药品费
                    j++;//换行
                }
            }

+ 15 - 0
common/common-util/src/main/java/com/yihu/jw/util/common/IdCardUtil.java

@ -168,6 +168,21 @@ public class IdCardUtil {
        }
    }
    //如果性别不是1或者2 根据身份证计算
    public static String getSex(Integer sex,String cardType,String idcard){
        try {
            if("1".equals(sex)||"2".equals(sex)){
                return sex+"";
            }
            if("身份证".equals(cardType)){
                return getSexForIdcard_new(idcard);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return "3";
    }
    /**
     * 根据身份证的号码算出当前身份证持有者的性别
     * 1 男 2 女 3未知

+ 75 - 71
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/health/service/PatientHealthIndexService.java

@ -93,97 +93,101 @@ public class PatientHealthIndexService {
     * @param obj
     */
    public void handlePatientStandarStatus(DevicePatientHealthIndex obj) {
        //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----START
        String patientCode = obj.getUser();
        //患者信息
        BasePatientDO p = patientDao.findById(patientCode).orElse(null);
        try {
            //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----START
            String patientCode = obj.getUser();
            //患者信息
            BasePatientDO p = patientDao.findById(patientCode).orElse(null);
        String patientsql = "select group_concat(label_code) disease from wlyy_patient_label " +
                "where patient = '" + p.getId() + "' and label_type = 2 and (label_code = 1 or label_code = 2)  GROUP BY patient";
            String patientsql = "select group_concat(label_code) disease from wlyy_patient_label " +
                    "where patient = '" + p.getId() + "' and label_type = 2 and (label_code = 1 or label_code = 2)  GROUP BY patient";
        String patientdisease = "";
        List<Map<String, Object>> diseases = jdbcTemplate.queryForList(patientsql);
        if (diseases.size() > 0) {
            patientdisease = (String) diseases.get(0).get("disease");
        }
            String patientdisease = "";
            List<Map<String, Object>> diseases = jdbcTemplate.queryForList(patientsql);
            if (diseases.size() > 0) {
                patientdisease = (String) diseases.get(0).get("disease");
            }
        int bloodPressureBbnormalCount = 0;//血压异常次数
        int bloodSuggurBbnormalCount = 0;//血糖异常次数
        int stdbloodPressureBbnormalCount = 0;//血压次数
        int stdbloodSuggurBbnormalCount = 0;//血糖次数
            int bloodPressureBbnormalCount = 0;//血压异常次数
            int bloodSuggurBbnormalCount = 0;//血糖异常次数
            int stdbloodPressureBbnormalCount = 0;//血压次数
            int stdbloodSuggurBbnormalCount = 0;//血糖次数
        List<DevicePatientHealthIndex> bloodPressurepatientHealthIndices = new ArrayList<>();
        List<DevicePatientHealthIndex> bloodSuggurpatientHealthIndices = new ArrayList<>();
            List<DevicePatientHealthIndex> bloodPressurepatientHealthIndices = new ArrayList<>();
            List<DevicePatientHealthIndex> bloodSuggurpatientHealthIndices = new ArrayList<>();
        bloodPressurepatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode, 2);
        bloodSuggurpatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode, 1);
            bloodPressurepatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode, 2);
            bloodSuggurpatientHealthIndices = patientHealthIndexDao.findByPatientAndTypeByPage(patientCode, 1);
        if (!bloodPressurepatientHealthIndices.isEmpty()) {
            stdbloodPressureBbnormalCount = bloodPressurepatientHealthIndices.size();
        }
            if (!bloodPressurepatientHealthIndices.isEmpty()) {
                stdbloodPressureBbnormalCount = bloodPressurepatientHealthIndices.size();
            }
        if (!bloodSuggurpatientHealthIndices.isEmpty()) {
            stdbloodSuggurBbnormalCount = bloodSuggurpatientHealthIndices.size();
        }
            if (!bloodSuggurpatientHealthIndices.isEmpty()) {
                stdbloodSuggurBbnormalCount = bloodSuggurpatientHealthIndices.size();
            }
        for (DevicePatientHealthIndex index1 : bloodPressurepatientHealthIndices) {
            if (index1.getStatus() != null && 1 == index1.getStatus()) {
                bloodPressureBbnormalCount++;
            for (DevicePatientHealthIndex index1 : bloodPressurepatientHealthIndices) {
                if (index1.getStatus() != null && 1 == index1.getStatus()) {
                    bloodPressureBbnormalCount++;
                }
            }
        }
        for (DevicePatientHealthIndex index2 : bloodSuggurpatientHealthIndices) {
            if (index2.getStatus() != null && 1 == index2.getStatus()) {
                bloodSuggurBbnormalCount++;
            for (DevicePatientHealthIndex index2 : bloodSuggurpatientHealthIndices) {
                if (index2.getStatus() != null && 1 == index2.getStatus()) {
                    bloodSuggurBbnormalCount++;
                }
            }
        }
        //连续3次异常,修改用户为预警状态 ||计算血糖或者血压一周内的异常记录数量(超过5次,记为预警状态)
        Date end = new Date();
        Date start = DateUtil.setDateTime(end, -7);
        int errorCount1 = patientHealthIndexDao.getCountByTimeAndStatus(start, end, 1,2, patientCode);
        int errorCount2 = patientHealthIndexDao.getCountByTimeAndStatus(start, end, 1,1, patientCode);
        if (bloodPressureBbnormalCount >= 3 || errorCount1 >= 5) {
            if(p.getStandardStatus()==0){
                p.setStandardStatus(1);
            }else if(p.getStandardStatus()==2){
                p.setStandardStatus(3);
            //连续3次异常,修改用户为预警状态 ||计算血糖或者血压一周内的异常记录数量(超过5次,记为预警状态)
            Date end = new Date();
            Date start = DateUtil.setDateTime(end, -7);
            int errorCount1 = patientHealthIndexDao.getCountByTimeAndStatus(start, end, 1,2, patientCode);
            int errorCount2 = patientHealthIndexDao.getCountByTimeAndStatus(start, end, 1,1, patientCode);
            if (bloodPressureBbnormalCount >= 3 || errorCount1 >= 5) {
                if(p.getStandardStatus()==0){
                    p.setStandardStatus(1);
                }else if(p.getStandardStatus()==2){
                    p.setStandardStatus(3);
                }
            }
        }
        if (bloodSuggurBbnormalCount >= 3 || errorCount2 >= 5) {
            if(p.getStandardStatus()==0){
                p.setStandardStatus(2);
            }else if(p.getStandardStatus()==1){
                p.setStandardStatus(3);
            if (bloodSuggurBbnormalCount >= 3 || errorCount2 >= 5) {
                if(p.getStandardStatus()==0){
                    p.setStandardStatus(2);
                }else if(p.getStandardStatus()==1){
                    p.setStandardStatus(3);
                }
            }
        }
        //连续5次正常,修改用户为非预警状态
        if (StringUtils.isNotBlank(patientdisease)) {
            if ("1".equals(patientdisease)||"3".equals(patientdisease)) {
                if (stdbloodPressureBbnormalCount == 5) {
                    if(p.getStandardStatus()==1){
                        p.setStandardStatus(0);
                    }else if(p.getStandardStatus()==3){
                        p.setStandardStatus(2);
                    }
            //连续5次正常,修改用户为非预警状态
            if (StringUtils.isNotBlank(patientdisease)) {
                if ("1".equals(patientdisease)||"3".equals(patientdisease)) {
                    if (stdbloodPressureBbnormalCount == 5) {
                        if(p.getStandardStatus()==1){
                            p.setStandardStatus(0);
                        }else if(p.getStandardStatus()==3){
                            p.setStandardStatus(2);
                        }
//                    cancalTrackPatientByDoctor(patientCode);
                    }
                }
            }
            if ("2".equals(patientdisease)||"3".equals(patientdisease)) {
                if (stdbloodSuggurBbnormalCount == 5 ) {
                    if(p.getStandardStatus()==2){
                        p.setStandardStatus(0);
                    }else if(p.getStandardStatus()==3){
                        p.setStandardStatus(1);
                if ("2".equals(patientdisease)||"3".equals(patientdisease)) {
                    if (stdbloodSuggurBbnormalCount == 5 ) {
                        if(p.getStandardStatus()==2){
                            p.setStandardStatus(0);
                        }else if(p.getStandardStatus()==3){
                            p.setStandardStatus(1);
                        }
                    }
                }
            }
        } else {
            p.setStandardStatus(0);
            } else {
                p.setStandardStatus(0);
//            cancalTrackPatientByDoctor(patientCode);
            }
            patientDao.save(p);
            //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----END
        }catch (Exception e){
            e.printStackTrace();
        }
        patientDao.save(p);
        //连续5次体征值正常,则修改为非预警状态;连续5次异常,修改为预警状态-----END
    }
    /**