Переглянути джерело

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

huangwenjie 7 роки тому
батько
коміт
70c24862d1

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -2828,5 +2828,21 @@ public class ConsultTeamService extends ConsultService {
        re.put("list",ja);
        return re.toString();
    }
    
    //判断居民家庭医生专科是否有共管关系
    public int getSpecialDoctorFamilyDoctorPatientCount(String patient,String special_doctor,String family_doctor){
        String sql = "SELECT " +
                "count(a.id) FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
                "JOIN wlyy.wlyy_sign_family b " +
                "ON a.patient=b.patient " +
                "AND b.`status`=1 " +
                "WHERE a.sign_status> 0 " +
                "AND a.`status`>=0 " +
                "AND a.doctor='"+special_doctor+"' " +
                "AND (b.doctor='"+family_doctor+"' or b.doctor_health='"+family_doctor+"')" +
                "AND a.patient='"+patient+"'";
        int count = jdbcTemplate.queryForObject(sql,Integer.class);
        return  count;
    }
}

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

@ -504,7 +504,7 @@ public class PatientDiseaseService extends BaseService {
                "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.patient=b.patient " +
                "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 " +
                "AND a.doctor='"+doctor+"' " +
                "GROUP BY b.disease";

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -1223,10 +1223,17 @@ public class DoctorConsultController extends WeixinBaseController {
                                   @ApiParam(name = "sessionId", value = "会话id", defaultValue = "")
                                   @RequestParam(value = "sessionId", required = true) String sessionId,
                                   @ApiParam(name = "businessType", value = "businessType", defaultValue = "1")
                                   @RequestParam(value = "businessType", required = true) String businessType){
                                   @RequestParam(value = "businessType", required = true) String businessType,
                                   @ApiParam(name = "specialdoctor", value = "专科医生CODE", defaultValue = "")
                                   @RequestParam(value = "specialdoctor", required = true) String specialdoctor,
                                   @ApiParam(name = "familydoctor", value = "家庭医生CODE", defaultValue = "")
                                   @RequestParam(value = "familydoctor", required = true) String familydoctor){
        try {
            String doctorCode = getUID();
            Doctor doctor = doctorService.findDoctorByCode(doctorCode);
            //判断居民家庭医生专科是否有共管关系
            int count= consultTeamService.getSpecialDoctorFamilyDoctorPatientCount(patient,specialdoctor,familydoctor);
            Patient p = patientService.findByCode(patient);
            com.alibaba.fastjson.JSONObject content = new com.alibaba.fastjson.JSONObject();
            content.put("name",p.getName());
@ -1234,6 +1241,7 @@ public class DoctorConsultController extends WeixinBaseController {
            content.put("photo",p.getPhoto());
            content.put("age",IdCardUtil.getAgeForIdcard(p.getIdcard()));
            content.put("sex",IdCardUtil.getSexForIdcard(p.getIdcard()));
            content.put("count",count);//大于0的就有共管关系
            SignFamily signFamily = signFamilyDao.findByPatient(patient);
            if(signFamily!=null){
                content.put("hospitalName",signFamily.getHospitalName());