瀏覽代碼

Merge branch 'dev' of lyr/patient-co-management into dev

lyr 8 年之前
父節點
當前提交
9d4ac4ca75

+ 0 - 133
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -1121,137 +1121,4 @@ public class SignPatientLabelInfoService extends BaseService {
        return 1;
    }
    /**
     * 疾病转标签
     *
     * @return
     */
    public boolean diseaseToLabel() {
        List<PatientDisease> diseases = diseaseDao.findByDel("1");
        Iterator<Patient> patients = patientDao.findAll().iterator();
        Map<String, String> patientNames = new HashMap<>();
        while (patients.hasNext()) {
            Patient p = patients.next();
            patientNames.put(p.getCode(), p.getName());
        }
        for (PatientDisease disease : diseases) {
            SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
            labelInfo.setPatient(disease.getPatient());
            labelInfo.setPname(patientNames.get(disease.getPatient()));
            labelInfo.setLabel(disease.getDisease());
            labelInfo.setLabelName(disease.getDiseaseName());
            labelInfo.setLabelType("3");
            labelInfo.setStatus(1);
            labelInfo.setCzrq(new Date());
            labelInfoDao.save(labelInfo);
        }
        return true;
    }
    /**
     * 分组转标签
     *
     * @return
     */
    public boolean groupToLabel() throws Exception {
        Iterator<Patient> patients = patientDao.findAll().iterator();
        Map<String, Patient> patientNames = new HashMap<>();
        Map<String, SignPatientLabelInfo> normalLabel = new HashMap<>();
        Map<String, SignPatientLabelInfo> manbingLabel = new HashMap<>();
        Map<String, SignPatientLabelInfo> sixFiveLabel = new HashMap<>();
        while (patients.hasNext()) {
            Patient p = patients.next();
            patientNames.put(p.getCode(), p);
        }
        List<DoctorPatientGroupInfo> groupInfos = groupInfoDao.findByGroupAndStatus("1", 1);
        for (DoctorPatientGroupInfo groupInfo : groupInfos) {
            Patient p = patientNames.get(groupInfo.getPatient());
            if (p == null) {
                continue;
            }
            SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
            labelInfo.setPatient(p.getCode());
            labelInfo.setPname(p.getName());
            labelInfo.setLabel("1");
            labelInfo.setLabelName("普通人群");
            labelInfo.setLabelType("1");
            labelInfo.setStatus(1);
            labelInfo.setCzrq(new Date());
            normalLabel.put(p.getCode(), labelInfo);
        }
        List<DoctorPatientGroupInfo> groupInfos1 = groupInfoDao.findByGroupAndStatus("2", 1);
        for (DoctorPatientGroupInfo groupInfo : groupInfos1) {
            Patient p = patientNames.get(groupInfo.getPatient());
            if (p == null) {
                continue;
            }
            SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
            labelInfo.setPatient(p.getCode());
            labelInfo.setPname(p.getName());
            labelInfo.setLabel("2");
            labelInfo.setLabelName("慢病人群");
            labelInfo.setLabelType("1");
            labelInfo.setStatus(1);
            labelInfo.setCzrq(new Date());
            manbingLabel.put(p.getCode(), labelInfo);
        }
        List<DoctorPatientGroupInfo> groupInfos2 = groupInfoDao.findByGroupAndStatus("3", 1);
        for (DoctorPatientGroupInfo groupInfo : groupInfos2) {
            Patient p = patientNames.get(groupInfo.getPatient());
            if (p == null) {
                continue;
            }
            SignPatientLabelInfo labelInfo = new SignPatientLabelInfo();
            labelInfo.setPatient(p.getCode());
            labelInfo.setPname(p.getName());
            labelInfo.setLabel("3");
            labelInfo.setLabelName("65岁以上人群");
            labelInfo.setLabelType("1");
            labelInfo.setStatus(1);
            labelInfo.setCzrq(new Date());
            sixFiveLabel.put(p.getCode(), labelInfo);
        }
        if (normalLabel.size() > 0) {
            for (SignPatientLabelInfo labelInfo : normalLabel.values()) {
                labelInfoDao.save(labelInfo);
            }
        }
        if (manbingLabel.size() > 0) {
            for (SignPatientLabelInfo labelInfo : manbingLabel.values()) {
                labelInfoDao.save(labelInfo);
            }
        }
        if (sixFiveLabel.size() > 0) {
            for (SignPatientLabelInfo labelInfo : sixFiveLabel.values()) {
                labelInfoDao.save(labelInfo);
            }
        }
        return true;
    }
}

+ 5 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/ExpensesRemindService.java

@ -103,6 +103,11 @@ public class ExpensesRemindService extends BaseService {
                    Patient p = patientDao.findByCode(String.valueOf(map.get("patient")));
                    if (p != null) {
                        String epTime = redisTemplate.opsForValue().get("expenses:remind:" + p.getCode());
                        if(StringUtils.isNotEmpty(epTime) &&
                                new SimpleDateFormat("yyyy-MM-dd").format(new Date()).equals(epTime)) {
                            continue;
                        }
                        remindPatientExpenses(p, doc, hos, true);
                    }
                }

+ 0 - 27
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -353,31 +353,4 @@ public class SignPatientLabelInfoController extends BaseController {
        }
    }
    @RequestMapping(value = "/disease_to_label")
    public String diseaseToLabel() {
        try {
            if (labelInfoService.diseaseToLabel()) {
                return write(200, "转换成功");
            } else {
                return error(-1, "转换失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "转换失败");
        }
    }
    @RequestMapping(value = "/group_to_label")
    public String groupToLabel() {
        try {
            if (labelInfoService.groupToLabel()) {
                return write(200, "转换成功");
            } else {
                return error(-1, "转换失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "转换失败");
        }
    }
}