Przeglądaj źródła

续方咨询修改

yeshijie 7 lat temu
rodzic
commit
0ed9e36add

+ 0 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/message/HealthMessageJob.java

@ -22,7 +22,6 @@ import org.springframework.util.StringUtils;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * Created by Administrator on 2016.10.25.

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -45,4 +45,10 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
    // 按类型查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient,Integer type, Pageable pageRequest);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1' and a.type=?4 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, String title, long id,Integer type, Pageable pageRequest);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?3 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, String title,Integer type, Pageable pageRequest);
}

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

@ -128,11 +128,21 @@ public class ConsultService extends BaseService {
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		if (id > 0) {
			return consultDao.findByPatientAndType(patient, id,type, pageRequest);
		} else {
			return consultDao.findByPatientAndType(patient,type, pageRequest);
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultDao.findByPatientAndType(patient,title, id,type, pageRequest);
			} else {
				return consultDao.findByPatientAndType(patient,title,type, pageRequest);
			}
		}else{
			if (id > 0) {
				return consultDao.findByPatientAndType(patient, id,type, pageRequest);
			} else {
				return consultDao.findByPatientAndType(patient,type, pageRequest);
			}
		}
	}
	public Consult findOneConsult(String consult) {

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

@ -879,14 +879,14 @@ public class ConsultTeamService extends ConsultService {
            // 查询患者信息
            Patient p = patientDao.findByCode(patient);
            //获取基位处方详情
            //1、获取基位处方详情(保存续方表、药品续方信息表、续方疾病类型表)
            Prescription prescription = new Prescription();
            savePrescription(prescription,jwCode,doctor,p,ct,reason);
            String symptoms = savePrescription(prescription,jwCode,doctor,p,ct,reason);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("title",p.getName()+"申请续方");
            //获取体征记录
            //2、获取体征记录
            Iterable<PatientDevice> devices = patientDeviceDao.findByUser(patient);
            if(devices!=null||devices.iterator().hasNext()){
                int count = messageDao.findTzMessage(patient);
@ -894,11 +894,11 @@ public class ConsultTeamService extends ConsultService {
            }else{
                jsonObject.put("tzMsg","居民未绑定体征设备");
            }
            //获取上次续方时间:与平安的“智慧医保的审方系统”对接,判断居民上次续方时间,点击跳转上次续方记录。(此功能需与第三方系统对接,如果本次版本无法实现,则消息中不显示此条信息)
            //3、获取上次续方时间:与平安的“智慧医保的审方系统”对接,判断居民上次续方时间,点击跳转上次续方记录。(此功能需与第三方系统对接,如果本次版本无法实现,则消息中不显示此条信息)
            jsonObject.put("lastTime","");
            String symptoms = jsonObject.toString();
            String content = jsonObject.toString();
            //创建咨询
            //4、创建咨询
            JSONObject users = new JSONObject();//咨询参与者
            users.put(patient, 0);
            users.put(doctorCode, 0);
@ -925,10 +925,11 @@ public class ConsultTeamService extends ConsultService {
            ct.setCzrq(new Date());
            ct.setDel("1");
            ct.setStatus(0);
            ct.setEvaluate(0);
            // 医生未读数量为1
            ct.setDoctorRead(1);
            // 添加咨询记录
            Consult consult = addConsult(ct.getPatient(), null, ct.getSymptoms(), ct.getImages(), ct.getType());
            Consult consult = addConsult(ct.getPatient(), "申请续方", ct.getSymptoms(), ct.getImages(), ct.getType());
            // 设置关联指导
            consult.setGuidance(ct.getGuidance());
            //关联业务code
@ -937,9 +938,9 @@ public class ConsultTeamService extends ConsultService {
            ct.setConsult(consult.getCode());
            //推送给IM去创建议题,取得成员消息
            JSONObject messages = ImUtill.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), consult.getSymptoms(), consult.getImages(),agent);
            JSONObject messages = ImUtill.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(),agent);
            //续方咨询的sessionid为居民code+续方code+咨询类型
            //5、(im创建咨询) 续方咨询的sessionid为居民code+续方code+咨询类型
            JSONObject obj = ImUtill.createTopics(patient + "_" + prescription.getCode() + "_" + ct.getType(), consult.getCode(), p.getName(), users, messages, ImUtill.SESSION_TYPE_PRESCRIPTION);
            if (obj == null) {
                throw new RuntimeException("IM消息发送异常!");
@ -951,7 +952,7 @@ public class ConsultTeamService extends ConsultService {
            consultTeamDao.save(ct);
            consultDao.save(consult);
            //记录咨询的医生详情
            //6、记录咨询的医生详情
            ConsultTeamDoctor cd = new ConsultTeamDoctor();
            cd.setConsult(consult.getCode());
            cd.setDel("1");
@ -959,13 +960,13 @@ public class ConsultTeamService extends ConsultService {
            cd.setTo(doctorCode);
            consultTeamDoctorDao.save(cd);
            //发送系统消息提示团队长有未审核的消息
            //7、发送系统消息提示团队长有未审核的消息
            addCheckMessage(prescription,p);
            // 保存医生咨询信息
            //8、 保存医生咨询信息
            // 添加咨询转发记录
            // 添加医生咨询日志
            String content = addLogs(ct);
            addLogs(ct);
            return 1;
        }
@ -1007,7 +1008,8 @@ public class ConsultTeamService extends ConsultService {
     * @param reason
     * @return
     */
    public Prescription savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason){
    public String savePrescription(Prescription prescription,String jwCode,Doctor doctor,Patient p,ConsultTeam ct,String reason){
        String re = "";
        prescription.setCode(getCode());
        prescription.setParentCode(jwCode);
        prescription.setHospitalName(doctor.getHospitalName());
@ -1049,9 +1051,11 @@ public class ConsultTeamService extends ConsultService {
        diagnosis.setUpdateTime(new Date());
        prescriptionDiagnosisDao.save(diagnosis);
        re +=diagnosis.getName();
        prescriptionLogService.addLog(prescription,3,1,1);
        return prescription;
        return re;
    }
    /**

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -157,10 +157,10 @@ public class MessageService extends BaseService {
        if (prescriptionMessage != null && prescriptionMessage.size() > 0) {
            prescriptionJson.put("amount", prescriptionMessage.size());
            JSONObject msgJson = new JSONObject();
            msgJson.put("title", systemMessage.get(0).getTitle());
            msgJson.put("type", systemMessage.get(0).getType());
            msgJson.put("msg", systemMessage.get(0).getContent());
            msgJson.put("msgTime", DateUtil.dateToStrLong(systemMessage.get(0).getCreateTime()));
            msgJson.put("title", prescriptionMessage.get(0).getTitle());
            msgJson.put("type", prescriptionMessage.get(0).getType());
            msgJson.put("msg", prescriptionMessage.get(0).getContent());
            msgJson.put("msgTime", DateUtil.dateToStrLong(prescriptionMessage.get(0).getCreateTime()));
            prescriptionJson.put("lastMessage", msgJson);
        } else {
            prescriptionJson.put("amount", 0);

+ 2 - 18
patient-co/patient-co-wlyy/src/main/resources/application.yml

@ -156,11 +156,6 @@ sign:
quartz:
  name: schedulerFactoryBean_test
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
---
##正式的配置
@ -246,12 +241,6 @@ sign:
quartz:
  name: schedulerFactoryBeanWlyy
ylzpay:
#  onepayApi: https://xmhealth.ylzpay.com:8080/
  onepayApi: http://xmhealth.ylzpay.com:8070/
  onepayAppId: 1BLF5SEGN00087165F0A000027362BE5
  onepayAppSecret: 1BLF5SCBO01V3E78A8C00000F3A0FFE7
---
##开发的配置
spring:
@ -277,7 +266,7 @@ server:
im:
  im_list_get: http://172.19.103.88:3000/
  im_list_get: http://192.168.131.24:3000/
  data_base_name: ichat
wechat:
@ -337,11 +326,6 @@ sign:
quartz:
  name: schedulerFactoryBean_dev
ylzpay:
  onepayApi: http://120.42.37.94:1301/onepay-web/
  onepayAppId: 1BGKM1UHM03P7B2CA8C000005626EB0E
  onepayAppSecret: 1BGKM1UHM03I7B2CA8C00000AB682E9A
---
##开发连测试用这个版本的配置
spring:
@ -367,7 +351,7 @@ server:
im:
  im_list_get: http://172.19.103.88:3000/
  im_list_get: http://192.168.131.24:3000/
  data_base_name: im_new
wechat: