|
@ -1016,6 +1016,7 @@ public class ImService {
|
|
//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+12(图文,视频,图文+视频)
|
|
//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+12(图文,视频,图文+视频)
|
|
sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
|
|
sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
|
|
obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_COLLABORATION_HOSPITAL);
|
|
obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_COLLABORATION_HOSPITAL);
|
|
|
|
|
|
}else{
|
|
}else{
|
|
messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
|
|
messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
|
|
//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
|
|
//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
|
|
@ -1793,6 +1794,8 @@ public class ImService {
|
|
throw new RuntimeException(obj.getString("message"));
|
|
throw new RuntimeException(obj.getString("message"));
|
|
}
|
|
}
|
|
ct.setStartMsgId(obj.get("start_msg_id").toString());
|
|
ct.setStartMsgId(obj.get("start_msg_id").toString());
|
|
|
|
ct.setActualSender(generalDoctor.getId());//实际发起人-全科医生
|
|
|
|
ct.setActualSenderName(generalDoctor.getName());//实际发起人-全科医生
|
|
consultTeamDao.save(ct);
|
|
consultTeamDao.save(ct);
|
|
consultDao.save(consult);
|
|
consultDao.save(consult);
|
|
|
|
|
|
@ -1843,4 +1846,160 @@ public class ImService {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (健康咨询)医生咨询记录查询
|
|
|
|
* @param doctor 医生标识
|
|
|
|
* @param id 会话ID(等同IM表topicId)
|
|
|
|
* @param type 咨询会话类型 : 0 全部
|
|
|
|
* @param status 咨询状态:0全部,1候诊中,2就诊中,3结束
|
|
|
|
* @param pagesize 分页大小
|
|
|
|
* @param title 标题关键字
|
|
|
|
* @param start_time 开始时间
|
|
|
|
* @param end_time 结束时间
|
|
|
|
* @param patient 居民CODE
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public List<ConsultVO> findexpertConsultRecordByDoctor(String doctor, String id,
|
|
|
|
Integer type, Integer status,
|
|
|
|
int page,int pagesize,
|
|
|
|
String title,String start_time,String end_time,String patinet) {
|
|
|
|
|
|
|
|
if(page >=1){
|
|
|
|
page --;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pagesize <= 0) {
|
|
|
|
pagesize = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
|
"a.id AS id," +
|
|
|
|
"a.type AS type," +
|
|
|
|
"a.title AS title," +
|
|
|
|
"a.symptoms AS symptoms," +
|
|
|
|
"a.czrq AS czrq," +
|
|
|
|
"b.status AS status," +
|
|
|
|
"b.evaluate AS evaluate," +
|
|
|
|
"d.name AS patientName," +
|
|
|
|
"d.id as patientId," +
|
|
|
|
"d.idcard as patientIdcard," +
|
|
|
|
"d.sex as patientsex," +
|
|
|
|
"d.photo AS patientphoto " +
|
|
|
|
"FROM wlyy_consult a," +
|
|
|
|
"wlyy_consult_team b," +
|
|
|
|
"base_patient d, " +
|
|
|
|
"WHERE a.id=b.consult " +
|
|
|
|
"AND b.patient=d.id AND b.patient='"+patinet+"' "+
|
|
|
|
"AND b.actual_sender='"+doctor+"' ";
|
|
|
|
List<ConsultVO> result = new ArrayList<>();
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(title)){
|
|
|
|
title="%"+title+"%";
|
|
|
|
sql +=" and a.title like '"+title+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(start_time)){
|
|
|
|
sql +=" and a.czrq >= '"+start_time+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(end_time)){
|
|
|
|
sql +=" and a.czrq <= '"+end_time+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//咨询状态
|
|
|
|
if(status != 0){
|
|
|
|
|
|
|
|
if(status ==2 ){//就诊中
|
|
|
|
sql +=" and b.status = 0 ";
|
|
|
|
}else if(status ==3 ){
|
|
|
|
sql +=" and b.status = 1 ";
|
|
|
|
}else{}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//咨询状态
|
|
|
|
if(type != 0){
|
|
|
|
sql +=" AND a.type="+type;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(id)) {
|
|
|
|
sql += " and a.id = '" + id + "'";
|
|
|
|
}
|
|
|
|
sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
|
|
|
|
|
|
|
|
result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (健康咨询)查询患者所有的咨询记录总数
|
|
|
|
* @param doctor 患者标识
|
|
|
|
* @param id 会话ID(等同IM表topicId)
|
|
|
|
* @param type 咨询会话类型
|
|
|
|
* @param status 咨询状态:0全部,1候诊中,2就诊中,3结束
|
|
|
|
* @param pagesize 分页大小
|
|
|
|
* @param title 标题关键字
|
|
|
|
* @param start_time 开始时间
|
|
|
|
* @param end_time 结束时间
|
|
|
|
* @param patient 居民CODE
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public Long findexpertConsultRecordByDoctor(String doctor, String id,Integer type, Integer status,String title,String start_time,String end_time,String patient) {
|
|
|
|
|
|
|
|
String sql = "SELECT " +
|
|
|
|
" COUNT(1) AS total " +
|
|
|
|
"FROM wlyy_consult a," +
|
|
|
|
"wlyy_consult_team b," +
|
|
|
|
"base_patient d," +
|
|
|
|
"WHERE a.id=b.consult " +
|
|
|
|
"AND b.patient=d.id AND b.patient='"+patient+"' "+
|
|
|
|
"AND b.actual_sender='"+doctor+"' ";
|
|
|
|
List<ConsultVO> result = new ArrayList<>();
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(title)){
|
|
|
|
title="%"+title+"%";
|
|
|
|
sql +=" and a.title like '"+title+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(start_time)){
|
|
|
|
sql +=" and a.czrq >= '"+start_time+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(end_time)){
|
|
|
|
sql +=" and a.czrq <= '"+end_time+"'";
|
|
|
|
}
|
|
|
|
|
|
|
|
//咨询状态
|
|
|
|
if(status != 0){
|
|
|
|
|
|
|
|
if(status ==2 ){//就诊中
|
|
|
|
sql +=" and b.status = 0 ";
|
|
|
|
}else if(status ==3 ){
|
|
|
|
sql +=" and b.status = 1 ";
|
|
|
|
}else{}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//咨询状态
|
|
|
|
if(type != 0){
|
|
|
|
sql +=" AND a.type="+type;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!StringUtils.isEmpty(id)) {
|
|
|
|
sql += " and a.id = '" + id + "'";
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql);
|
|
|
|
Long count = 0L;
|
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
|
count = (Long) rstotal.get(0).get("total");
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
}
|
|
}
|