You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
156 lines
7.6 KiB
156 lines
7.6 KiB
package com.ynxbd.push.controller;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.ynxbd.push.entity.type.MessageTypeEnum;
|
|
import com.ynxbd.push.entity.response.ResponseResult;
|
|
import com.ynxbd.push.helper.BusinessHelper;
|
|
import com.ynxbd.push.rabbit.send.RabbitSender;
|
|
import com.ynxbd.push.service.HisUniversalService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import weixin.popular.bean.message.MessageSendResult;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* @author 李进才
|
|
* @ClassName BusinessController
|
|
* @Description 发送lis报告单结果推送
|
|
* @date 2021/12/6 3:23 下午
|
|
*/
|
|
@Controller
|
|
@Slf4j
|
|
@RequestMapping(value = "business")
|
|
public class BusinessController {
|
|
@Autowired
|
|
private RabbitSender rabbitSender;
|
|
|
|
@Autowired
|
|
private HisUniversalService hisUniversalService;
|
|
|
|
@GetMapping(value = "report")
|
|
@ResponseBody
|
|
public MessageSendResult reportTip(String organizeName, String patientId, String idCard, String reportId, String itemName, String reportTime, String patientName, String sex, String age, String applyDept, String applyDoctor) {
|
|
log.info("进入接口-[检验检查报告通知]organizeName-{},patientId-{},idCard-{},reportId-{}, itemName-{},reportTime-{},patientName-{},sex-{},age-{},applyDept-{},applyDoctor-{}", organizeName, patientId, idCard, reportId, itemName, reportTime, patientName, sex, age, applyDept, applyDoctor);
|
|
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, idCard, null);
|
|
if (!check.getErrcode().equals("0")) {
|
|
return check;
|
|
}
|
|
Map<String, String> message = new HashMap<>();
|
|
message.put("tip", MessageTypeEnum.REPORT_TIP.CODE);
|
|
message.put("organizeName", organizeName);
|
|
message.put("patientId", patientId);
|
|
message.put("idCard", idCard);
|
|
message.put("reportId", reportId);
|
|
message.put("itemName", itemName);
|
|
message.put("reportTime", reportTime);
|
|
message.put("patientName", patientName);
|
|
message.put("sex", sex);
|
|
message.put("age", age);
|
|
message.put("applyDept", applyDept);
|
|
message.put("applyDoctor", applyDoctor);
|
|
rabbitSender.TipSend(message);
|
|
return ResponseResult.JOIN_QUEUE.toMessResult();
|
|
}
|
|
|
|
@GetMapping(value = "queue")
|
|
@ResponseBody
|
|
public MessageSendResult queueTip(String organizeName, String patientId, String idCard, String patientName, String deptName, String doctorName, String currentNumber, String selfNumber, String waitNumber) {
|
|
log.info("进入接口-[排队叫号提醒]organizeName-{},patientId-{},idCard-{},patientName-{},deptName-{},doctorName-{},currentNumber-{},selfNumber-{},waitNumber-{}", organizeName, patientId, idCard, patientName, deptName, doctorName, currentNumber, selfNumber, waitNumber);
|
|
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, idCard, null);
|
|
if (!check.getErrcode().equals("0")) {
|
|
return check;
|
|
}
|
|
Map<String, String> message = new HashMap<>();
|
|
message.put("tip", MessageTypeEnum.QUEUE_TIP.CODE);
|
|
message.put("organizeName", organizeName);
|
|
message.put("patientId", patientId);
|
|
message.put("idCard", idCard);
|
|
message.put("patientName", patientName);
|
|
message.put("deptName", deptName);
|
|
message.put("doctorName", doctorName);
|
|
message.put("currentNumber", currentNumber);
|
|
message.put("selfNumber", selfNumber);
|
|
message.put("waitNumber", waitNumber);
|
|
rabbitSender.TipSend(message);
|
|
return ResponseResult.JOIN_QUEUE.toMessResult();
|
|
}
|
|
|
|
@PostMapping("medicalRecord")
|
|
@ResponseBody
|
|
public MessageSendResult medicalRecord(String organizeName, String patientId, String applyId) {
|
|
log.info("进入接口-[病历复印] 病历复印可付费通知(医院通知)organizeName-{}, patientId-{} , applyId-{}", organizeName, patientId, applyId);
|
|
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, null, null);
|
|
if (!check.getErrcode().equals("0")) {
|
|
return check;
|
|
}
|
|
Map<String, String> message = new HashMap<>();
|
|
message.put("tip", MessageTypeEnum.MEDICAL_RECORD.CODE);
|
|
message.put("organizeName", organizeName);
|
|
message.put("patientId", patientId);
|
|
message.put("applyId", applyId);
|
|
rabbitSender.TipSend(message);
|
|
return ResponseResult.JOIN_QUEUE.toMessResult();
|
|
}
|
|
|
|
@PostMapping("treatPlan")
|
|
@ResponseBody
|
|
public MessageSendResult treatPlan(String title, String name, String planTime, String content, String patientId, String organizeName, String remark, String url) {
|
|
log.info("进入接口-[诊疗计划提醒] organizeName-{}, patientId-{} , title-{},name-{},planTime-{},content-{},remark-{},url-{}", organizeName, patientId, title, name, planTime, content, remark, url);
|
|
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, null, null);
|
|
if (!check.getErrcode().equals("0")) {
|
|
return check;
|
|
}
|
|
if (name == null || planTime == null || content == null) {
|
|
log.info("[诊疗计划提醒] 必填字段为空,name-{},planTime-{},content-{}", name, planTime, content);
|
|
return ResponseResult.PARAMETER_IS_NULL.toMessResult();
|
|
}
|
|
Map<String, String> message = new HashMap<>();
|
|
message.put("tip", MessageTypeEnum.TREAT_PLAN.CODE);
|
|
message.put("title", title == null ? "" : title);
|
|
message.put("name", name);
|
|
message.put("patientId", patientId);
|
|
message.put("organizeName", organizeName);
|
|
message.put("planTime", planTime);
|
|
message.put("content", content);
|
|
message.put("url", url == null ? "" : url);
|
|
message.put("remark", remark == null ? "" : remark);
|
|
rabbitSender.TipSend(message);
|
|
return ResponseResult.JOIN_QUEUE.toMessResult();
|
|
}
|
|
|
|
@PostMapping("universal")
|
|
@ResponseBody
|
|
public MessageSendResult universal(String content, String patientId, String url, String organizeName, String IdCard, String doctorCode) {
|
|
log.info("进入接口-[通用推送接口]-绑定通知,content-{},patientId-{},url-{},organizeName-{},IdCard-{},doctorCode-{}", content, patientId, url, organizeName, IdCard, doctorCode);
|
|
MessageSendResult check = BusinessHelper.ParamsCheck(organizeName, patientId, null, doctorCode);
|
|
if (!check.getErrcode().equals("0")) {
|
|
return check;
|
|
}
|
|
if (content == null) {
|
|
log.info("[通用推送接口]-绑定通知, 必填字段为空");
|
|
return ResponseResult.PARAMETER_IS_NULL.toMessResult();
|
|
}
|
|
Map<String, String> message = new HashMap<>();
|
|
message.put("tip", MessageTypeEnum.UNIVERSAL.CODE);
|
|
message.put("organizeName", organizeName);
|
|
message.put("patientId", patientId);
|
|
message.put("doctorCode", doctorCode);
|
|
message.put("IdCard", IdCard);
|
|
message.put("content", content);
|
|
message.put("url", url == null ? "" : url);
|
|
rabbitSender.TipSend(message);
|
|
return ResponseResult.JOIN_QUEUE.toMessResult();
|
|
}
|
|
|
|
|
|
@PostMapping("hisUniversal")
|
|
@ResponseBody
|
|
public MessageSendResult hisUniversal(@RequestBody Map<String, String> paramsMap) {
|
|
log.info("进入接口-[HIS推送接口],params=[{}]", JSONObject.toJSONString(paramsMap));
|
|
return hisUniversalService.hisUniversal(paramsMap);
|
|
}
|
|
}
|
|
|