|
@@ -1,5 +1,7 @@
|
|
|
package thyyxxk.webserver.service.outpatient.triage;
|
|
|
|
|
|
+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.metadata.IPage;
|
|
@@ -8,19 +10,34 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import thyyxxk.webserver.config.exception.BizException;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.constants.Capacity;
|
|
|
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.*;
|
|
|
+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.socketmessage.ApiMessageBody;
|
|
|
import thyyxxk.webserver.entity.socketmessage.SendUserList;
|
|
|
import thyyxxk.webserver.service.externalhttp.WebSocketService;
|
|
|
import thyyxxk.webserver.service.outpatient.wxapi.SendWxInfoService;
|
|
|
-import thyyxxk.webserver.utils.*;
|
|
|
+import thyyxxk.webserver.utils.AssertUtil;
|
|
|
+import thyyxxk.webserver.utils.DateUtil;
|
|
|
+import thyyxxk.webserver.utils.IdCardUtil;
|
|
|
+import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
+import thyyxxk.webserver.utils.StringUtil;
|
|
|
+import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author dj
|
|
@@ -291,4 +308,24 @@ public class TriageService {
|
|
|
}
|
|
|
return ResultVoUtil.success();
|
|
|
}
|
|
|
+
|
|
|
+ public ResultVo<String> saveNewCard(String oldPatientId, String newPatientId) {
|
|
|
+ Map<String,Object> oldPatientInfo = dao.selectCardInfo(oldPatientId);
|
|
|
+ AssertUtil.isnotBlank(oldPatientInfo,"未查询到该病人信息,请确认旧门诊号是否填写正确?");
|
|
|
+ Map<String,Object> patientInfo = dao.selectCardInfo(newPatientId);
|
|
|
+ AssertUtil.isnotBlank(patientInfo,"未查询到该病人信息,请确认新门诊号是否填写正确?");
|
|
|
+ if(!Convert.toStr(oldPatientInfo.get("name"),"").equals(Convert.toStr(patientInfo.get("name"),""))){
|
|
|
+ throw new BizException(ExceptionEnum.LOGICAL_ERROR, StrUtil.format("旧门诊号对应的病人为[{}],新门诊号对应的病人为[{}],不是同一病人,请重新填写数据!",Convert.toStr(oldPatientInfo.get("name"),""),Convert.toStr(patientInfo.get("name"),"")));
|
|
|
+ }
|
|
|
+ dao.saveNewCard(oldPatientId, newPatientId, Convert.toStr(patientInfo.get("ic_card_no"),""));
|
|
|
+ return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION,"保存成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<Map<String, Object>> queryCardInfo(String oldPatientId, String newPatientId) {
|
|
|
+ AssertUtil.isnotBlank(oldPatientId,"旧门诊号不能为空");
|
|
|
+ AssertUtil.isnotBlank(newPatientId,"新门诊号不能为空");
|
|
|
+ Map<String,Object> patientInfo = dao.selectCardInfo(newPatientId);
|
|
|
+ AssertUtil.isnotBlank(patientInfo,"未查询到该病人信息,请确认新门诊号是否填写正确?");
|
|
|
+ return ResultVoUtil.success(patientInfo);
|
|
|
+ }
|
|
|
}
|