|
@@ -2,35 +2,26 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.diagbot.biz.push.entity.Item;
|
|
|
-import com.diagbot.dto.IndicationDTO;
|
|
|
-import com.diagbot.dto.PushDTO;
|
|
|
-import com.diagbot.dto.PushPlanDTO;
|
|
|
-import com.diagbot.dto.RespDTO;
|
|
|
-import com.diagbot.entity.PacsInfo;
|
|
|
-import com.diagbot.entity.SysUser;
|
|
|
+import com.diagbot.biz.push.entity.Pacs;
|
|
|
+import com.diagbot.dto.*;
|
|
|
+import com.diagbot.entity.TemplateInfo;
|
|
|
+import com.diagbot.entity.TranPacsInfo;
|
|
|
import com.diagbot.entity.TranDatadockingLog;
|
|
|
import com.diagbot.entity.TranHospitalRelation;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
-import com.diagbot.enums.StatusEnum;
|
|
|
-import com.diagbot.service.PacsInfoService;
|
|
|
-import com.diagbot.service.impl.PacsInfoServiceImpl;
|
|
|
+import com.diagbot.service.impl.TranPacsInfoServiceImpl;
|
|
|
import com.diagbot.util.*;
|
|
|
import com.diagbot.vo.*;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/*
|
|
|
* @Description:对外对接业务处理类
|
|
@@ -60,7 +51,7 @@ public class DataPageDockFacade {
|
|
|
private KlConceptStaticFacade KlConceptStaticFacade;
|
|
|
|
|
|
@Autowired
|
|
|
- PacsInfoServiceImpl pacsInfoServiceImpl;
|
|
|
+ TranPacsInfoServiceImpl tranPacsInfoServiceImpl;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -193,13 +184,21 @@ public class DataPageDockFacade {
|
|
|
dataPageDockVO.setDiag(getItem(sourceMap.get("诊断")));
|
|
|
dataPageDockVO.setDrug(getDrug(sourceMap.get("药品")));
|
|
|
dataPageDockVO.setDiseaseName(getDisease(sourceMap.get("诊断")));
|
|
|
+
|
|
|
+ // 查询检查表
|
|
|
+ List<TranPacsInfo> pacsInfoList = tranPacsInfoServiceImpl.list(new QueryWrapper<TranPacsInfo>()
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .in("apply_no", dataPageDockVO.getApplyNo())
|
|
|
+ );
|
|
|
+ dataPageDockVO.setPacsOrder(getPacs(pacsInfoList));
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private List<Drug> getDrug(String value) {
|
|
|
Drug drug = new Drug();
|
|
|
List<Drug> drugList = new ArrayList<>();
|
|
|
drug.setName(value);
|
|
|
- // drug.setUniqueName(value);
|
|
|
+ // drug.setUniqueName(value);
|
|
|
drugList.add(drug);
|
|
|
return drugList;
|
|
|
}
|
|
@@ -208,7 +207,7 @@ public class DataPageDockFacade {
|
|
|
Item item = new Item();
|
|
|
List<Item> itemList = new ArrayList<>();
|
|
|
item.setName(value);
|
|
|
- // item.setUniqueName(value);
|
|
|
+ // item.setUniqueName(value);
|
|
|
itemList.add(item);
|
|
|
return itemList;
|
|
|
}
|
|
@@ -218,10 +217,26 @@ public class DataPageDockFacade {
|
|
|
Item item = new Item();
|
|
|
item.setName(value);
|
|
|
// item.setUniqueName(value);
|
|
|
- // item.add(item);
|
|
|
+ // item.add(item);
|
|
|
return item;
|
|
|
}
|
|
|
|
|
|
+ private List<Pacs> getPacs(List<TranPacsInfo> pacsInfoList) {
|
|
|
+ Pacs pacs = new Pacs();
|
|
|
+ List<Pacs> pacsList = new ArrayList<>();
|
|
|
+ for (TranPacsInfo pacsInfo : pacsInfoList){
|
|
|
+ if(StringUtil.isNotBlank(pacsInfo.getPacsName())){
|
|
|
+ pacs.setName(pacsInfo.getPacsName());
|
|
|
+ pacs.setUniqueName(pacsInfo.getPacsName());
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotBlank(pacsInfo.getApplyDate())){
|
|
|
+ pacs.setDateValue(pacsInfo.getApplyDate());
|
|
|
+ }
|
|
|
+ pacsList.add(pacs);
|
|
|
+ }
|
|
|
+ return pacsList;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @Description:病历推理
|
|
@@ -347,30 +362,43 @@ public class DataPageDockFacade {
|
|
|
return hospitalId;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public RespDTO sendPacsInfos(List<PacsVO> list) {
|
|
|
+ /**
|
|
|
+ * @Description: 保存检查信息
|
|
|
+ * @Author:dsYun
|
|
|
+ * @time: ${DATE} ${TIME}
|
|
|
+ **/
|
|
|
+ public RespDTO<String> sendPacsInfos(PacsVO pacsVO) {
|
|
|
try {
|
|
|
- if(list!=null && list.size()>0){
|
|
|
+ if (pacsVO != null) {
|
|
|
//循环验证数据有效性
|
|
|
- for (PacsVO pacsVO:list) {
|
|
|
- if(StringUtil.isEmpty(pacsVO.getApplyNo())){
|
|
|
- return RespDTO.onError("请输入申请单号!");
|
|
|
- }
|
|
|
+ if (StringUtil.isEmpty(pacsVO.getApplyNo())) {
|
|
|
+ return RespDTO.onError("请输入申请单号!");
|
|
|
+ }
|
|
|
+ //保存检查信息
|
|
|
+ if (pacsVO.getType() == 0) {
|
|
|
+ TranPacsInfo pacsInfo = new TranPacsInfo();
|
|
|
+ BeanUtil.copyProperties(pacsVO, pacsInfo);
|
|
|
+ tranPacsInfoServiceImpl.save(pacsInfo);
|
|
|
+ } else if (pacsVO.getType() == 1) { //更新检查信息删除状态
|
|
|
+ UpdateWrapper<TranPacsInfo> tranPacsInfo = new UpdateWrapper<>();
|
|
|
+ tranPacsInfo.eq("apply_no", pacsVO.getApplyNo())
|
|
|
+ .set("is_deleted", IsDeleteEnum.Y.getKey())
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
+ tranPacsInfoServiceImpl.update(new TranPacsInfo(), tranPacsInfo);
|
|
|
+ } else if (pacsVO.getType() == 2) { //更新修改的检查信息删除状态
|
|
|
+ UpdateWrapper<TranPacsInfo> tranPacsInfo = new UpdateWrapper<>();
|
|
|
+ tranPacsInfo.eq("apply_no", pacsVO.getApplyNo())
|
|
|
+ .set("pacs_name", pacsVO.getPacsName())
|
|
|
+ .set("results", pacsVO.getResults())
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
+ tranPacsInfoServiceImpl.update(new TranPacsInfo(), tranPacsInfo);
|
|
|
}
|
|
|
-
|
|
|
- List<PacsInfo> pacsInfoList= Lists.newArrayList();
|
|
|
- list.stream().forEach(s->{
|
|
|
- PacsInfo pacsInfo = new PacsInfo();
|
|
|
- BeanUtil.copyProperties(s,pacsInfo);
|
|
|
- pacsInfoList.add(pacsInfo);
|
|
|
- });
|
|
|
- pacsInfoServiceImpl.saveBatch(pacsInfoList);
|
|
|
|
|
|
return RespDTO.onSuc("操作正常!");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return RespDTO.onError("未接收到数据!");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
return RespDTO.onError(e.getMessage());
|
|
|
}
|
|
|
}
|