|
@@ -2,15 +2,19 @@ package thyyxxk.webserver.service.zhuyuanyisheng;
|
|
|
|
|
|
import cn.hutool.extra.spring.SpringUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import lombok.Data;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.exception.ExceptionEnum;
|
|
|
import thyyxxk.webserver.dao.his.zhuyuanyisheng.ContagiousDiseaseDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.dictionary.CodeName;
|
|
|
import thyyxxk.webserver.entity.zhuyuanyisheng.contagiousdisease.CrbMainCard;
|
|
|
import thyyxxk.webserver.service.PublicServer;
|
|
|
+import thyyxxk.webserver.utils.ListUtil;
|
|
|
import thyyxxk.webserver.utils.ResultVoUtil;
|
|
|
import thyyxxk.webserver.utils.TokenUtil;
|
|
|
|
|
@@ -24,6 +28,14 @@ public class ContagiousDiseaseService {
|
|
|
private final ContagiousDiseaseDao dao;
|
|
|
private final PublicServer publicServer;
|
|
|
|
|
|
+
|
|
|
+ @Data
|
|
|
+ public static class PatientDiagnosisIsCrb {
|
|
|
+ private String patNo;
|
|
|
+ private Integer times;
|
|
|
+ private List<String> diagList;
|
|
|
+ }
|
|
|
+
|
|
|
@Autowired
|
|
|
public ContagiousDiseaseService(ContagiousDiseaseDao dao, PublicServer publicServer) {
|
|
|
this.dao = dao;
|
|
@@ -76,5 +88,33 @@ public class ContagiousDiseaseService {
|
|
|
return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
|
|
|
}
|
|
|
|
|
|
+ public Boolean notExistCrbByPatNo(String patNo, Integer times) {
|
|
|
+ QueryWrapper<CrbMainCard> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("patient_id", patNo)
|
|
|
+ .eq("times", times);
|
|
|
+ return dao.selectCount(qw) < 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ResultVo<JSONObject> infectiousDiseasesAreRequired(PatientDiagnosisIsCrb p) {
|
|
|
+ JSONObject js = new JSONObject();
|
|
|
+
|
|
|
+ js.put("fillOut", false);
|
|
|
+
|
|
|
+ QueryWrapper<?> qw = new QueryWrapper<>();
|
|
|
+ qw.eq("infectiousdiseases_flag", 1)
|
|
|
+ .in("code", p.getDiagList());
|
|
|
+
|
|
|
+ List<String> list = dao.selectCrbDiseList(qw);
|
|
|
+
|
|
|
+ if (ListUtil.notBlank(list)) {
|
|
|
+ if (notExistCrbByPatNo(p.getPatNo(), p.getTimes())) {
|
|
|
+ js.replace("fillOut", true);
|
|
|
+ js.put("list", list);
|
|
|
+ return ResultVoUtil.success(js);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return ResultVoUtil.success(js);
|
|
|
+ }
|
|
|
|
|
|
}
|