Forráskód Böngészése

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

huangwenjie 7 éve
szülő
commit
c53b171ece

+ 0 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/AsyncService.java

@ -28,7 +28,6 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 异步方法,减少体征数据接收主线程压力

+ 28 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/disease/PatientDiseaseService.java

@ -497,7 +497,13 @@ public class PatientDiseaseService extends BaseService {
            }
        }
    }
    
    /**
     * 根据居民关联获取标签信息
     * @param doctor
     * @param teamCode
     * @return
     */
    public List<Map<String,Object>> getPatientDiseaseCount(String doctor, Long teamCode) {
        String sql ="SELECT " +
                "count(b.id) AS count," +
@ -505,7 +511,7 @@ public class PatientDiseaseService extends BaseService {
                "b.disease AS label " +
                "FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
                "JOIN wlyy.wlyy_patient_disease_server b ON a.patient=b.patient and b.del=1 " +
                "WHERE a.sign_status> 0 AND a.`status`>=0 " +
                "WHERE a.sign_status> 0 AND a.`status`>=0 AND b.del =1 " +
                "AND a.doctor='"+doctor+"' " +
                "GROUP BY b.disease";
    
@ -518,4 +524,24 @@ public class PatientDiseaseService extends BaseService {
        
        return result;
    }
    /**
     * 根据专病关联id进行关联获取标签
     * @param doctor
     * @return
     */
    public List<Map<String,Object>> getPatientDiseaseCount(String doctor) {
        String sql ="SELECT " +
                "count(b.id) AS count," +
                "b.disease_name AS labelName," +
                "b.disease AS label " +
                "FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
                "JOIN wlyy.wlyy_patient_disease_server b ON a.id = b.specialist_relation_code and b.del=1 " +
                "WHERE a.sign_status> 0 AND a.`status`>=0 AND b.del =1 " +
                "AND a.doctor='"+doctor+"' " +
                "GROUP BY b.disease";
        List<Map<String,Object>> result =  jdbcTemplate.queryForList(sql);
        return result;
    }
}

+ 31 - 26
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/RehabilitationPlanService.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.specialist;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.util.http.HttpResponse;
@ -28,8 +29,10 @@ public class RehabilitationPlanService extends BaseService {
    private String specialistUrl;
    @Autowired
    private AdminTeamService teamService;
    @Autowired
    private SpecialistEvaluateSevice specialistEvaluateSevice;
    public JSONObject findTemplateInfo(String doctor, String patient) {
    public JSONArray findTemplateInfo(String doctor, String patient) throws Exception {
        Map<String, Object> param = new HashedMap();
        Long adminTeamId = null;
        AdminTeam team = teamService.findByLeaderCode(doctor);
@ -47,10 +50,13 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取模板列表失败!");
    }
    public JSONObject findTemplateDetailInfo(String templateId) {
    public JSONArray findTemplateDetailInfo(String templateId) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("templateId", templateId);
        HttpResponse response = null;
@ -60,10 +66,13 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取模板明细列表失败!");
    }
    public String createTemplate(String title, Doctor doctor, Long teamId) {
    public String createTemplate(String title, Doctor doctor, Long teamId) throws Exception {
        JSONObject json = new JSONObject();
        json.put("title", title);
        json.put("adminTeamCode", teamId);
@ -124,7 +133,7 @@ public class RehabilitationPlanService extends BaseService {
        return rs.getString("message");
    }
    public JSONObject findServiceItemsByHospital(String doctorHospital, String signHospital) {
    public JSONArray findServiceItemsByHospital(String doctorHospital, String signHospital) throws Exception {
        Map<String, Object> param = new HashedMap();
        param.put("doctorHospital", doctorHospital);
        param.put("signHospital", signHospital);
@ -135,11 +144,15 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
        if ("success".equals(rs.getString("message"))) {
            return rs.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取机构服务项目列表失败!");
    }
    public String createRehabilitationPlan(String json, Doctor doctor) {
        JSONObject object = new JSONObject(json);
        String patient = object.getString("patient");
        object.put("createUser", doctor.getCode());
        object.put("createUserName", doctor.getName());
        Map<String, Object> param = new HashedMap();
@ -151,6 +164,17 @@ public class RehabilitationPlanService extends BaseService {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        JSONArray detailModelList = (JSONArray) rs.get("detailModelList");
        //康复计划创建完给执行者发送消息
        for (Object obj : detailModelList){
            JSONObject detail = new JSONObject(obj);
            Message message = new Message();
            message.setSender(doctor.getCode());
            message.setType(19);
            message.setRelationCode(detail.getString("planId"));
            message.setReceiver(detail.getString("doctor"));
            specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient,null);
        }
        return rs.getString("message");
    }
@ -167,25 +191,6 @@ public class RehabilitationPlanService extends BaseService {
        return rs.getString("message");
    }
    /**
     * 根据医生code获取签约居民信息
     * @param doctor
     * @return
     */
    public JSONObject getPatientInfoByDoctor(String doctor, String patientInfo) {
        Map<String, Object> param = new HashedMap();
        param.put("doctor", doctor);
        param.put("patientInfo", patientInfo);
        HttpResponse response = null;
        try {
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/getPatientAndDiseaseByDoctor", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject rs = new JSONObject(response.getContent());
        return rs;
    }
    /**
     * 更新计划的状态
     * @param planId

+ 20 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistService.java

@ -23,7 +23,6 @@ import com.yihu.wlyy.repository.specialist.SpecialDiseaseDao;
import com.yihu.wlyy.repository.specialist.TeamDiseaseRelationDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.account.DoctorInfoService;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.app.label.SignPatientLabelService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
@ -843,5 +842,25 @@ public class SpecialistService extends BaseService {
        }
        return null;
    }
    public JSONArray getPatientByDoctorAndDisease(String doctor, String patientInfo, String disease, String page, String size) throws Exception{
        Map<String, Object> param = new HashedMap();
        param.put("doctor", doctor);
        param.put("patientInfo", patientInfo);
        param.put("disease", disease);
        param.put("page", page);
        param.put("size", size);
        HttpResponse response = null;
        try {
            response = HttpUtils.doGet(specialistUrl + "svr-specialist/getPatientAndDiseaseByDoctor", param);
        } catch (Exception e) {
            e.printStackTrace();
        }
        JSONObject result = new JSONObject(response.getContent());
        if(result.getInt("status")==200){
            return result.getJSONArray("detailModelList");
        }
        throw new Exception("请求获取居民信息失败!");
    }
}

+ 35 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/specialist/SpecialistController.java

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.specialist;
import com.alibaba.fastjson.JSONArray;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.team.sign.SignPatientLabelInfo;
import com.yihu.wlyy.service.app.disease.PatientDiseaseService;
import com.yihu.wlyy.service.specialist.SpecialistService;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
@ -27,6 +28,8 @@ public class SpecialistController extends WeixinBaseController {
    @Autowired
    private SpecialistService specialistService;
    @Autowired
    private PatientDiseaseService patientDiseaseService;
    @RequestMapping(value = "setPatientLabelInfo", method = RequestMethod.POST)
    @ApiOperation("设置居民标签")
@ -88,6 +91,17 @@ public class SpecialistController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "findLabelAndPatientCountByDoctor", method = RequestMethod.GET)
    @ApiOperation("根据医生获取标签与居民数量")
    public String findLabelAndPatientCount(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true) String doctor) {
        try {
            return write(200, "获取成功", "data", patientDiseaseService.getPatientDiseaseCount(doctor));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "findSpecialistPatientRelationCout", method = RequestMethod.GET)
    @ApiOperation("获取专科医生下未分配标签居民数目")
    public String findSpecialistPatientRelationCout(@ApiParam(name = "doctor", value = "医生code") @RequestParam(required = true) String doctor) {
@ -357,4 +371,25 @@ public class SpecialistController extends WeixinBaseController {
        }
    }
    @RequestMapping(value = "/getPatientInfoByDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "根据医生code获取签约居民信息")
    public String getPatientInfoByDoctor(@ApiParam(name = "doctor", value = "医生标识")
                                         @RequestParam(required = true)String doctor,
                                         @ApiParam(name = "patientInfo", value = "居民信息")
                                         @RequestParam(required = false)String patientInfo,
                                         @ApiParam(name = "disease", value = "疾病类型")
                                             @RequestParam(required = false)String disease,
                                         @ApiParam(name = "page", value = "第几页,1开始")
                                             @RequestParam(required = true)String page,
                                         @ApiParam(name = "size", value = "每页大小")
                                             @RequestParam(required = true)String size){
        try {
            return write(200, "获取成功", "data", specialistService.getPatientByDoctorAndDisease(doctor, patientInfo, disease, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/PatientFamilyController.java

@ -81,4 +81,15 @@ public class PatientFamilyController extends BaseController {
            return error(-1, "更新失败!"+e.getMessage());
        }
    }
    @RequestMapping("/findSignFamilyByPatient")
    @ApiOperation("根据居民id获取家签信息")
    public String findSignFamilyByPatient(String patient) {
        try {
            return write(200, "查询成功!", "data", familyService.findByPatient(patient));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

+ 0 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/specialist/ThirdRehabilitationPlanController.java

@ -142,17 +142,4 @@ public class ThirdRehabilitationPlanController extends BaseController {
        }
    }
    @RequestMapping(value = "/getPatientInfoByDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "根据医生code获取签约居民信息")
    public String getPatientInfoByDoctor(@ApiParam(name = "doctor", value = "医生标识")
                                         @RequestParam(required = true)String doctor,
                                         @ApiParam(name = "patientInfo", value = "居民信息")
                                         @RequestParam(required = false)String patientInfo){
        try {
            return write(200, "获取成功", "data", rehabilitationPlanService.getPatientInfoByDoctor(doctor, patientInfo));
        } catch (Exception e) {
            error(e);
            return error(-1, "请求失败");
        }
    }
}