瀏覽代碼

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

trick9191 8 年之前
父節點
當前提交
22802577b4

+ 1 - 1
patient-co-statistics/pom.xml

@ -383,7 +383,7 @@
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <version>${version.spring-boot}</version>
            <version>${version.spring-boot}</version>
            <!--<scope>provided</scope>-->
            <scope>provided</scope>
        </dependency>
        </dependency>
        <dependency>
        <dependency>
            <groupId>org.json</groupId>
            <groupId>org.json</groupId>

+ 4 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/EvaluateService.java

@ -203,7 +203,7 @@ public class EvaluateService extends BaseService {
                    evaluateScore.setRemark(remark);
                    evaluateScore.setRemark(remark);
                }else{
                }else{
                    //如果没有评价信息,根据分数评价内容
                    //如果没有评价信息,根据分数评价内容
                    if(score.compareTo(new BigDecimal(71))==0&&score.compareTo(new BigDecimal(71))==1){
                    if(score.compareTo(new BigDecimal(71))==0||score.compareTo(new BigDecimal(71))==1){
                        evaluateScore.setRemark("好评");
                        evaluateScore.setRemark("好评");
                    }else if(score.compareTo(new BigDecimal(41))==-1){
                    }else if(score.compareTo(new BigDecimal(41))==-1){
                        evaluateScore.setRemark("差评");
                        evaluateScore.setRemark("差评");
@ -354,9 +354,9 @@ public class EvaluateService extends BaseService {
    public JSONArray getScoreTitle(String doctor){
    public JSONArray getScoreTitle(String doctor){
        String sql = "SELECT" +
        String sql = "SELECT" +
                " (SELECT evaluate_score FROM wlyy_doctor WHERE code ='"+doctor+"') score ," +
                " (SELECT evaluate_score FROM wlyy_doctor WHERE code ='"+doctor+"') score ," +
                " (SELECT ifnull(FORMAT(avg(score),1),80)  FROM wlyy_evaluate  WHERE evaluate_type = 1 AND doctor ='"+doctor+"') ability ," +
                " (SELECT ifnull(FORMAT(avg(score),1),80)  FROM wlyy_evaluate  WHERE evaluate_type = 2 AND doctor ='"+doctor+"') attitude ," +
                " (SELECT ifnull(FORMAT(avg(score),1),80)  FROM wlyy_evaluate  WHERE evaluate_type = 3 AND doctor ='"+doctor+"') speed";
                " (SELECT ifnull(FORMAT(avg(score),1),0)  FROM wlyy_evaluate  WHERE evaluate_type = 1 AND doctor ='"+doctor+"') ability ," +
                " (SELECT ifnull(FORMAT(avg(score),1),0)  FROM wlyy_evaluate  WHERE evaluate_type = 2 AND doctor ='"+doctor+"') attitude ," +
                " (SELECT ifnull(FORMAT(avg(score),1),0)  FROM wlyy_evaluate  WHERE evaluate_type = 3 AND doctor ='"+doctor+"') speed";
        List<Map<String,Object>> rs =jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> rs =jdbcTemplate.queryForList(sql);
        return new JSONArray(rs);
        return new JSONArray(rs);
    }
    }

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

@ -69,6 +69,8 @@ public class SignPatientLabelInfoService extends BaseService {
    @Autowired
    @Autowired
    SignPatientLabelDao labelDao;
    SignPatientLabelDao labelDao;
    @Autowired
    @Autowired
    SignPatientLabelInfoDao signPatientLabelInfoDao;
    @Autowired
    SignFamilyRenewDao signFamilyRenewDao;
    SignFamilyRenewDao signFamilyRenewDao;
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
@ -1206,6 +1208,92 @@ public class SignPatientLabelInfoService extends BaseService {
        return 1;
        return 1;
    }
    }
    /**
     * 1.3.5取缔setPatientLabels
     * 设置患者标签
     * @param patient 患者code
     * @param health 健康情况
     * @param disease 疾病类型
     * @param custom 自定义标签
     * @return
     */
    public int setPatientLabelInfos(String patient, String health, String disease, String custom){
        Patient p = patientDao.findByCode(patient);
        if (p == null) {
            return 0;
        }
        //存储健康情况,不可为空
        if(StringUtils.isNotBlank(health)){
            //删除居民所有标签信息
            String deleteSql = "DELETE FROM wlyy_sign_patient_label_info WHERE patient='"+patient+"'";
            jdbcTemplate.execute(deleteSql);
            //存储健康情况标签
            String[] healthArr = health.split(",");
            for(int i=0;i<healthArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(healthArr[i],"2");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(healthArr[i]);
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setLabelType("2");
                signPatientLabelInfo.setCzrq(new Date());
                //保存存储健康情况
                labelInfoDao.save(signPatientLabelInfo);
            }
        }else{
            return -2;
        }
        //保存疾病类型
        if(StringUtils.isNotBlank(disease)){
            String[] diseaseArr = disease.split(",");
            for(int i=0;i<diseaseArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(diseaseArr[i],"3");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(diseaseArr[i]);
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setLabelType("3");
                signPatientLabelInfo.setCzrq(new Date());
                //保存居民疾病类型
                labelInfoDao.save(signPatientLabelInfo);
            }
        }
        //保存自定义标签
        if(StringUtils.isNotBlank(custom)){
            String[] customArr = custom.split(",");
            for(int i=0;i<customArr.length;i++){
                SignPatientLabelInfo signPatientLabelInfo = new SignPatientLabelInfo();
                SignPatientLabel signPatientLabel = labelService.getLabelByCodeAndType(customArr[i],"4");
                if(signPatientLabel!=null&&StringUtils.isNotBlank(signPatientLabel.getLabelName())){
                    signPatientLabelInfo.setLabelName(signPatientLabel.getLabelName());
                }else{
                    return -1;
                }
                signPatientLabelInfo.setPatient(patient);
                signPatientLabelInfo.setPname(p.getName());
                signPatientLabelInfo.setLabel(customArr[i]);
                signPatientLabelInfo.setLabelType("4");
                signPatientLabelInfo.setStatus(1);
                signPatientLabelInfo.setCzrq(new Date());
                //保存居民疾病类型
                labelInfoDao.save(signPatientLabelInfo);
            }
        }
        return 1;
    }
    /**
    /**
     * 设置患者标签
     * 设置患者标签
     *
     *
@ -1217,6 +1305,7 @@ public class SignPatientLabelInfoService extends BaseService {
     * @param custom      自定义标签
     * @param custom      自定义标签
     * @return
     * @return
     */
     */
    @Deprecated
    public int setPatientLabels(String patient, String idcard, String patientName, String health, String disease, String custom, String doctor, String caller) {
    public int setPatientLabels(String patient, String idcard, String patientName, String health, String disease, String custom, String doctor, String caller) {
        Patient p = patientDao.findByCode(patient);
        Patient p = patientDao.findByCode(patient);

+ 3 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -1069,8 +1069,7 @@ public class FamilyContractService extends BaseService {
        doctorTeamDoctor.save(wlyyDoctorTeamPatient);
        doctorTeamDoctor.save(wlyyDoctorTeamPatient);
        // 患者标签设置
        // 患者标签设置
        if (!(labelInfoService.setPatientLabels(patient.getCode(), patient.getIdcard(),
                patient.getName(), healthLabel, disease, customLabel, sf.getDoctor(), signDoctorCode) == 1)) {
        if (!(labelInfoService.setPatientLabelInfos(patient.getCode(),healthLabel, disease, customLabel) == 1)) {
            throw new Exception("patient sign label settting error:" + patient.getIdcard());
            throw new Exception("patient sign label settting error:" + patient.getIdcard());
        }
        }
@ -1407,8 +1406,8 @@ public class FamilyContractService extends BaseService {
        }
        }
        // 患者标签设置
        // 患者标签设置
        if (!(labelInfoService.setPatientLabels(p.getCode(), p.getIdcard(),
                p.getName(), healthLabel, disease, customLabel, sf.getDoctor(), caller) == 1)) {
        if (!(labelInfoService.setPatientLabelInfos(p.getCode(),
                healthLabel, disease, customLabel) == 1)) {
            throw new Exception("patient sign label settting error:" + p.getIdcard());
            throw new Exception("patient sign label settting error:" + p.getIdcard());
        }
        }

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -1444,7 +1444,8 @@ public class SignWebService extends BaseService {
                        setSevId(renew,sevId);
                        setSevId(renew,sevId);
                        //1.3.3.2新增需求
                        //1.3.3.2新增需求
                        //设置居民标签
                        //设置居民标签
                        signPatientLabelInfoService.setPatientLabels(renew.getPatient(), renew.getIdcard(),"", health, disease, custom, renew.getDoctor(), renew.getDoctor());
                        //signPatientLabelInfoService.setPatientLabels(renew.getPatient(), renew.getIdcard(),"", health, disease, custom, renew.getDoctor(), renew.getDoctor());
                        signPatientLabelInfoService.setPatientLabelInfos(renew.getPatient(), health, disease, custom);
                        //1.3.3.2设置可修改健康管理师
                        //1.3.3.2设置可修改健康管理师
                        if(StringUtils.isNotBlank(healthDoctor)){
                        if(StringUtils.isNotBlank(healthDoctor)){
                            updateHealthDoctor(renew,healthDoctor);
                            updateHealthDoctor(renew,healthDoctor);

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -1709,7 +1709,7 @@ public class StatisticsService extends BaseService {
    public JSONObject getAVGSocre(String level, String area) {
    public JSONObject getAVGSocre(String level, String area) {
        String sql = "SELECT ifnull(ROUND(AVG(s.score),1),80) avgCount FROM wlyy_evaluate_score s ,wlyy_doctor d WHERE s.doctor = d.code ";
        String sql = "SELECT ifnull(ROUND(AVG(s.score),1),0) avgCount FROM wlyy_evaluate_score s ,wlyy_doctor d WHERE s.doctor = d.code ";
        //市级
        //市级
        if ("4".equals(level)) {
        if ("4".equals(level)) {
            sql += " AND d.city = ? ";
            sql += " AND d.city = ? ";
@ -1737,7 +1737,7 @@ public class StatisticsService extends BaseService {
            throw new Exception("时间区间错误");
            throw new Exception("时间区间错误");
        }
        }
        String sql = "SELECT DATE_FORMAT(t.czrq,'%Y-%m') mt,ifnull(ROUND(AVG(s.score),1),80)  as avgCount " +
        String sql = "SELECT DATE_FORMAT(t.czrq,'%Y-%m') mt,ifnull(ROUND(AVG(s.score),1),0)  as avgCount " +
                " FROM  wlyy_consult_team t " +
                " FROM  wlyy_consult_team t " +
                "  LEFT JOIN wlyy_doctor d ON d.code = t.doctor" +
                "  LEFT JOIN wlyy_doctor d ON d.code = t.doctor" +
                "  LEFT JOIN wlyy_evaluate_score s ON s.doctor = t.doctor" +
                "  LEFT JOIN wlyy_evaluate_score s ON s.doctor = t.doctor" +
@ -2385,7 +2385,7 @@ public class StatisticsService extends BaseService {
        if ("0".equals(type)) {
        if ("0".equals(type)) {
            sql = "SELECT " +
            sql = "SELECT " +
                    " DATE_FORMAT(t.czrq, '%Y-%m-%d') AS dateNo, " +
                    " DATE_FORMAT(t.czrq, '%Y-%m-%d') AS dateNo, " +
                    " ifnull(ROUND(AVG(s.score), 1), 80) AS avgCount " +
                    " ifnull(ROUND(AVG(s.score), 1), 0) AS avgCount " +
                    " FROM " +
                    " FROM " +
                    " wlyy_evaluate_score s ,wlyy_consult_team t " +
                    " wlyy_evaluate_score s ,wlyy_consult_team t " +
                    " WHERE  " +
                    " WHERE  " +

+ 2 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -376,7 +376,8 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "健康情况标签不能为空");
                return error(-1, "健康情况标签不能为空");
            }
            }
            //xh1D201703150222
            //xh1D201703150222
            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, getUID(), getUID());
            //int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, getUID(), getUID());
            int result = labelInfoService.setPatientLabelInfos(patient,health, disease, custom);
//            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, "xh1D201703150222", "xh1D201703150222");
//            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, "xh1D201703150222", "xh1D201703150222");
            if (result == 0) {
            if (result == 0) {