Browse Source

续方咨询,随访相关接口BUG修改

huangwenjie 7 years ago
parent
commit
edd01f7aad

+ 1 - 1
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/ConsultTeamDao.java

@ -14,6 +14,6 @@ import java.util.List;
public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam, Long>, JpaSpecificationExecutor<ConsultTeam> {
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0")
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0 and a.type = 8")
	List<ConsultTeam> findUnfinishedConsult(String patient);
}

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -293,4 +293,7 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	@Query("select a.doctor from ConsultTeam a where team = ?1  and del = '1' and type=?2 ")
	List<Object> findByTeamAndType(String fromConsult, int type);
	
	@Query("select a from ConsultTeam a where a.patient = ?1 and a.del = '1' and a.status = 0 and a.type = 8")
	List<ConsultTeam> findUnfinishedConsultPrescription(String code);
}

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

@ -2656,9 +2656,6 @@ public class ConsultTeamService extends ConsultService {
        }
        contentobj.put("doctorremind","已向居民发送问卷填写请求,填写完成后您将收到消息提醒");
        contentobj.put("patientremind","填写完成并提交后,医生将可以查看您的问卷内容");
        contentobj.put("sender_id",prescription.getDoctor());
        contentobj.put("sender_name",prescription.getDoctorName());
        contentobj.put("content_type","17");
        contentobj.put("msgType",type);
        //医生发送Im消息
        ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "17", contentobj.toString(), null);

+ 14 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -888,13 +888,17 @@ public class PatientHealthIndexService extends BaseService {
            }
    
            obj = patientHealthIndexDao.save(obj);
    
            //判断是否有未结束的续方咨询,发送消息给对应的医生
            sendPrescriptionHealthIndexMsgresult(obj,patient);
    
            //保存完后上传基卫
            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
//            new Thread(new HealthIndexUploadTask(String.valueOf(obj.getId()))).start();
        } else {
            throw new Exception("不存在该患者!");
        }
        return obj;
    }
    
@ -905,7 +909,7 @@ public class PatientHealthIndexService extends BaseService {
     */
    private void sendPrescriptionHealthIndexMsgresult(DevicePatientHealthIndex result, Patient patient) {
        
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsult(patient.getCode());
        List<ConsultTeam> consultTeams = consultTeamDao.findUnfinishedConsultPrescription(patient.getCode());
        
        if(1 == result.getType()){
            for (ConsultTeam consultTeam:consultTeams) {
@ -913,9 +917,11 @@ public class PatientHealthIndexService extends BaseService {
                    org.json.JSONObject contentPatient = new org.json.JSONObject();
                    //患者发送的消息
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1());
                    contentPatient.put("tzMsg", "体征记录:血糖 "+result.getValue1()+" mmol/L");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",1);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }
@ -928,7 +934,9 @@ public class PatientHealthIndexService extends BaseService {
                    contentPatient.put("title", "【本消息为系统提醒】:");
                    contentPatient.put("tzMsg", "体征记录:血压 "+result.getValue1()+"/"+result.getValue2()+" mmHg");
                    contentPatient.put("tzTime", "检测时间:"+DateUtil.dateToStrLong(result.getRecordDate()));
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以自动填入本次随访记录");
                    contentPatient.put("tzAlert","温馨提示:本条体征为居民上传的健康体征数据,您可以");
                    contentPatient.put("needUpload","false");
                    contentPatient.put("type",2);
                    //患者发送Im消息
                    ImUtill.sendTopicIM(patient.getCode(), patient.getName(), consultTeam.getConsult(), "16", contentPatient.toString(), null);
                }

+ 0 - 12
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionFollowupContentService.java

@ -364,9 +364,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needUpload","false");
				contentDoctor.put("type",2);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
@ -389,9 +386,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("text", "请提供您最近一次的血糖检测数值及检测时间");
				contentDoctor.put("needUpload","true");
				contentDoctor.put("type",2);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				
@ -464,9 +458,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("text", "请提供您最近一次的血压检测数值及检测时间");
				contentDoctor.put("needUpload","false");
				contentDoctor.put("type",1);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
@ -490,9 +481,6 @@ public class PrescriptionFollowupContentService extends BaseService {
				contentDoctor.put("text", "请提供您最近一次的血压检测数值及检测时间");
				contentDoctor.put("needUpload","true");
				contentDoctor.put("type",1);
				contentDoctor.put("sender_id",prescription.getDoctor());
				contentDoctor.put("sender_name",prescription.getDoctorName());
				contentDoctor.put("content_type","16");
				//医生发送Im消息
				ImUtill.sendTopicIM(prescription.getDoctor(), prescription.getDoctorName(), prescription.getConsult(), "16", contentDoctor.toString(), null);
				

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -395,8 +395,7 @@ public class PatientHealthController extends BaseController {
//                patient = getUID();
            }
            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, patient, null);
            
            //血糖和血压需要校验
            if (type.equals("1") || type.equals("2")) {
                healthIndexService.verifyHealthIndex(obj.getId());