|
@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -13,19 +14,17 @@ import thyyxxk.webserver.config.exception.BizException;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
import thyyxxk.webserver.constants.Gender;
|
|
|
+import thyyxxk.webserver.dao.his.outpatient.triage.EmergencyRegDao;
|
|
|
import thyyxxk.webserver.dao.his.outpatient.triage.TriageDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.FloorScreen;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.MessageForPush;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.MzYshTzxx;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.MzfzPatientOrder;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.MzfzZdDeptRoom;
|
|
|
-import thyyxxk.webserver.entity.outpatient.triage.TriageNotifyRelation;
|
|
|
+import thyyxxk.webserver.entity.inpatient.chargeinputinquiry.InquiryParams;
|
|
|
+import thyyxxk.webserver.entity.outpatient.triage.*;
|
|
|
import thyyxxk.webserver.entity.socketmessage.ApiMessageBody;
|
|
|
import thyyxxk.webserver.entity.socketmessage.SendUserList;
|
|
|
import thyyxxk.webserver.service.externalhttp.WebSocketService;
|
|
|
import thyyxxk.webserver.service.outpatient.wxapi.SendWxInfoService;
|
|
|
+import thyyxxk.webserver.service.redislike.RedisLikeService;
|
|
|
import thyyxxk.webserver.utils.AssertUtil;
|
|
|
import thyyxxk.webserver.utils.DateUtil;
|
|
|
import thyyxxk.webserver.utils.IdCardUtil;
|
|
@@ -46,13 +45,17 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class TriageService {
|
|
|
private final TriageDao dao;
|
|
|
+ private final EmergencyRegDao erdao;
|
|
|
private final WebSocketService socketService;
|
|
|
private final SendWxInfoService sendWxInfoService;
|
|
|
+ private final RedisLikeService redis;
|
|
|
|
|
|
- public TriageService(TriageDao dao, WebSocketService socketService, SendWxInfoService sendWxInfoService) {
|
|
|
+ public TriageService(TriageDao dao, EmergencyRegDao erdao, WebSocketService socketService, SendWxInfoService sendWxInfoService, RedisLikeService redis) {
|
|
|
this.dao = dao;
|
|
|
+ this.erdao = erdao;
|
|
|
this.socketService = socketService;
|
|
|
this.sendWxInfoService = sendWxInfoService;
|
|
|
+ this.redis = redis;
|
|
|
}
|
|
|
|
|
|
public String getBigScreenFooter() {
|
|
@@ -351,4 +354,46 @@ public class TriageService {
|
|
|
AssertUtil.isnotBlank(patientInfo,"未查询到该病人信息,请确认新门诊号是否填写正确?");
|
|
|
return ResultVoUtil.success(patientInfo);
|
|
|
}
|
|
|
+
|
|
|
+ public EmergencyRegInfo getEmergencyRegInfo(String patientId, Integer times) {
|
|
|
+ QueryWrapper<EmergencyRegInfo> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq("patient_id", patientId);
|
|
|
+ wrapper.eq("times", times);
|
|
|
+ EmergencyRegInfo info = erdao.selectOne(wrapper);
|
|
|
+ if (null == info) {
|
|
|
+ info = erdao.getRawEntity(patientId, times);
|
|
|
+ }
|
|
|
+ if (null == info) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ String idCard = info.getIdCard();
|
|
|
+ if (IdCardUtil.isValidatedIdCard(idCard)) {
|
|
|
+ info.setAge(IdCardUtil.getAgeByIdCard(idCard) + "岁");
|
|
|
+ String inpatientNo = erdao.getInpatientNo(idCard);
|
|
|
+ if (StringUtil.notBlank(inpatientNo)) {
|
|
|
+ info.setHospitalization(erdao.getDeptName(inpatientNo));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ String userCode = TokenUtil.getInstance().getTokenUserId();
|
|
|
+ String userName = redis.getEmployeeName(userCode);
|
|
|
+ info.setCreateStaffCode(userCode);
|
|
|
+ info.setCreateStaffName(userName);
|
|
|
+ return info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Integer saveEmergencyRegInfo(EmergencyRegInfo info) {
|
|
|
+ if (null != info.getId()) {
|
|
|
+ erdao.updateById(info);
|
|
|
+ } else {
|
|
|
+ erdao.insert(info);
|
|
|
+ }
|
|
|
+ return info.getId();
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<EmergencyRegInfo> getEmrRegExportData(String start, String end) {
|
|
|
+ QueryWrapper<EmergencyRegInfo> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.ge("create_time", start);
|
|
|
+ wrapper.le("create_time", end);
|
|
|
+ return erdao.selectList(wrapper);
|
|
|
+ }
|
|
|
}
|