|
@@ -1,35 +1,22 @@
|
|
package com.diagbot.facade.data;
|
|
package com.diagbot.facade.data;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
-=========
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.diagbot.dto.AnalyzeRunDTO;
|
|
import com.diagbot.dto.AnalyzeRunDTO;
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.data.AMedicalRecordDTO;
|
|
import com.diagbot.dto.data.AMedicalRecordDTO;
|
|
import com.diagbot.dto.data.AMrContentDTO;
|
|
import com.diagbot.dto.data.AMrContentDTO;
|
|
import com.diagbot.entity.*;
|
|
import com.diagbot.entity.*;
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
-import com.diagbot.facade.BehospitalInfoFacade;
|
|
|
|
-import com.diagbot.facade.ModelHospitalFacade;
|
|
|
|
-import com.diagbot.facade.QcAbnormalFacade;
|
|
|
|
-=========
|
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
import com.diagbot.facade.BehospitalInfoFacade;
|
|
import com.diagbot.facade.ModelHospitalFacade;
|
|
import com.diagbot.facade.ModelHospitalFacade;
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
import com.diagbot.facade.QcTypeFacade;
|
|
import com.diagbot.facade.QcTypeFacade;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.MedicalRecordServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
import com.diagbot.service.impl.QcAbnormalServiceImpl;
|
|
-import com.diagbot.util.BeanUtil;
|
|
|
|
-import com.diagbot.util.DateUtil;
|
|
|
|
-import com.diagbot.util.ReadProperties;
|
|
|
|
-import com.diagbot.util.TZDBConn;
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
-import com.diagbot.vo.AnalyzeApiVO;
|
|
|
|
-=========
|
|
|
|
|
|
+import com.diagbot.util.*;
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
|
|
+import com.diagbot.vo.data.ADeleteFlagVO;
|
|
import com.diagbot.vo.data.AMedicalRecordVO;
|
|
import com.diagbot.vo.data.AMedicalRecordVO;
|
|
import com.diagbot.vo.data.AMrContentVO;
|
|
import com.diagbot.vo.data.AMrContentVO;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -68,6 +55,9 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
@Autowired
|
|
@Autowired
|
|
private ReadProperties readProperties;
|
|
private ReadProperties readProperties;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private AMedAbnormalInfoFacade aMedAbnormalInfoFacade;
|
|
|
|
+
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
private TZDBConn tzDBConn = new TZDBConn();
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -86,32 +76,38 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
|
|
public RespDTO<List<AMedicalRecordDTO>> executeMrRecord(List<AMedicalRecordVO> list) {
|
|
- if(list!=null && list.size()>0) {
|
|
|
|
- //循环验证数据有效性
|
|
|
|
- for (AMedicalRecordVO aMedicalRecordVO : list) {
|
|
|
|
- if ("".equals(aMedicalRecordVO.getRecId())) {
|
|
|
|
- return RespDTO.onError("请输入文书序号!");
|
|
|
|
- } else if (aMedicalRecordVO.getHospitalId() == null) {
|
|
|
|
- return RespDTO.onError("请输入医院编码!");
|
|
|
|
- } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
|
|
|
|
- return RespDTO.onError("请输入病人住院编码!");
|
|
|
|
|
|
+ try {
|
|
|
|
+ if(list!=null && list.size()>0) {
|
|
|
|
+ //循环验证数据有效性
|
|
|
|
+ for (AMedicalRecordVO aMedicalRecordVO : list) {
|
|
|
|
+ if ("".equals(aMedicalRecordVO.getRecId())) {
|
|
|
|
+ return RespDTO.onError("请输入文书序号!");
|
|
|
|
+ } else if (aMedicalRecordVO.getHospitalId() == null) {
|
|
|
|
+ return RespDTO.onError("请输入医院编码!");
|
|
|
|
+ } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
|
|
|
|
+ return RespDTO.onError("请输入病人住院编码!");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- //装载数据
|
|
|
|
- List<MedicalRecord> medicalRecordList = Lists.newArrayList();
|
|
|
|
- list.stream().forEach(s->{
|
|
|
|
- MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
|
- BeanUtil.copyProperties(s,medicalRecord);
|
|
|
|
- medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
|
|
|
|
- medicalRecordList.add(medicalRecord);
|
|
|
|
- });
|
|
|
|
- execute(medicalRecordList);
|
|
|
|
-
|
|
|
|
- List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
|
|
|
|
- return RespDTO.onSuc(medicalRecordDTOList);
|
|
|
|
- }else{
|
|
|
|
- return RespDTO.onError("未接收到数据!");
|
|
|
|
|
|
+ //装载数据
|
|
|
|
+ List<MedicalRecord> medicalRecordList = Lists.newArrayList();
|
|
|
|
+ list.stream().forEach(s->{
|
|
|
|
+ MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
|
+ BeanUtil.copyProperties(s,medicalRecord);
|
|
|
|
+ medicalRecord.setRecDate(DateUtil.parseDateTime(s.getRecDate()));
|
|
|
|
+ medicalRecordList.add(medicalRecord);
|
|
|
|
+ });
|
|
|
|
+ execute(medicalRecordList);
|
|
|
|
+
|
|
|
|
+ List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(list, AMedicalRecordDTO.class);
|
|
|
|
+ return RespDTO.onSuc(medicalRecordDTOList);
|
|
|
|
+ }else{
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(list),"","未接收到数据!");
|
|
|
|
+ return RespDTO.onError("未接收到数据!");
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(list),"",e.getMessage());
|
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -121,37 +117,43 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
|
|
public RespDTO<Map<String, Object>> executeMrRecordIng(AMrContentVO aMrContentVO) {
|
|
- if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
|
|
|
|
- AMrContentDTO aMrContentDTO=new AMrContentDTO();
|
|
|
|
- //循环验证数据有效性
|
|
|
|
- for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
|
|
|
|
- if ("".equals(aMedicalRecordVO.getRecId())) {
|
|
|
|
- return RespDTO.onError("请输入文书序号!");
|
|
|
|
- } else if (aMedicalRecordVO.getHospitalId() == null) {
|
|
|
|
- return RespDTO.onError("请输入医院编码!");
|
|
|
|
- } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
|
|
|
|
- return RespDTO.onError("请输入病人住院编码!");
|
|
|
|
- } else if ("".equals(aMedicalRecordVO.getRecTypeId())) {
|
|
|
|
- return RespDTO.onError("请输入病历类别编号!");
|
|
|
|
- } else if ("".equals(aMedicalRecordVO.getRecTitle())) {
|
|
|
|
- return RespDTO.onError("请输入病历标题!");
|
|
|
|
- } else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
|
|
|
|
- return RespDTO.onError("请输入文书详情!");
|
|
|
|
|
|
+ try {
|
|
|
|
+ if(aMrContentVO.getRecords()!=null && aMrContentVO.getRecords().size()>0){
|
|
|
|
+ AMrContentDTO aMrContentDTO=new AMrContentDTO();
|
|
|
|
+ //循环验证数据有效性
|
|
|
|
+ for (AMedicalRecordVO aMedicalRecordVO : aMrContentVO.getRecords()) {
|
|
|
|
+ if ("".equals(aMedicalRecordVO.getRecId())) {
|
|
|
|
+ return RespDTO.onError("请输入文书序号!");
|
|
|
|
+ } else if (aMedicalRecordVO.getHospitalId() == null) {
|
|
|
|
+ return RespDTO.onError("请输入医院编码!");
|
|
|
|
+ } else if ("".equals(aMedicalRecordVO.getBehospitalCode())) {
|
|
|
|
+ return RespDTO.onError("请输入病人住院编码!");
|
|
|
|
+ } else if ("".equals(aMedicalRecordVO.getRecTypeId())) {
|
|
|
|
+ return RespDTO.onError("请输入病历类别编号!");
|
|
|
|
+ } else if ("".equals(aMedicalRecordVO.getRecTitle())) {
|
|
|
|
+ return RespDTO.onError("请输入病历标题!");
|
|
|
|
+ } else if (aMedicalRecordVO.getContents() == null || aMedicalRecordVO.getContents().size() == 0) {
|
|
|
|
+ return RespDTO.onError("请输入文书详情!");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
- //更新文书信息
|
|
|
|
- executeMrRecord(aMrContentVO.getRecords());
|
|
|
|
|
|
+ //更新文书信息
|
|
|
|
+ executeMrRecord(aMrContentVO.getRecords());
|
|
|
|
|
|
- aMrContentVO.getRecords().stream().forEach(s -> {
|
|
|
|
- //更新文书详情
|
|
|
|
- aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
|
|
|
|
- });
|
|
|
|
|
|
+ aMrContentVO.getRecords().stream().forEach(s -> {
|
|
|
|
+ //更新文书详情
|
|
|
|
+ aMedicalRecordContentFacade.executeMrRecordContent(s.getContents());
|
|
|
|
+ });
|
|
|
|
|
|
- //评分后返回结构体
|
|
|
|
- return mrIng(aMrContentVO);
|
|
|
|
|
|
+ //评分后返回结构体
|
|
|
|
+ return mrIng(aMrContentVO);
|
|
|
|
|
|
- }else{
|
|
|
|
- return RespDTO.onError("未接收到数据!");
|
|
|
|
|
|
+ }else{
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"","未接收到数据!");
|
|
|
|
+ return RespDTO.onError("未接收到数据!");
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"",e.getMessage());
|
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -161,171 +163,153 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
|
|
private RespDTO<Map<String, Object>> mrIng(AMrContentVO aMrContentVO){
|
|
- String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
|
|
|
|
- Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
|
|
|
|
- MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
|
- BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
|
|
|
|
- Long modeId=initModeId(medicalRecord);
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- if(aMrContentVO.getDockModeType().equals("1")){
|
|
|
|
-=========
|
|
|
|
- if(aMrContentVO.getDockModeType().equals("0")){
|
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
- List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
|
|
|
|
- map.put("records",medicalRecordDTOList);
|
|
|
|
- return RespDTO.onSuc(map);
|
|
|
|
- }else if(aMrContentVO.getDockModeType().equals("1")){
|
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- if(modeId==0 || modeId==null){
|
|
|
|
- return RespDTO.onError("无对应的文书类型");
|
|
|
|
- }
|
|
|
|
- //页面模式
|
|
|
|
- String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
- map.put("url",url);
|
|
|
|
- return RespDTO.onSuc(map);
|
|
|
|
- }else if(aMrContentVO.getDockModeType().equals("2")){
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- AnalyzeApiVO analyzeApiVO=new AnalyzeApiVO();
|
|
|
|
- analyzeApiVO.setBehospitalCode(behospitalCode);
|
|
|
|
- analyzeApiVO.setHospitalId(hospitalId);
|
|
|
|
- Map<String, Object> map=behospitalInfoFacade.analyzeApi(analyzeApiVO);
|
|
|
|
-=========
|
|
|
|
- AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
|
- analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
|
- analyzeRunVO.setHospitalId(hospitalId);
|
|
|
|
- analyzeRunVO.setModeId(modeId);
|
|
|
|
- AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
- if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
|
- map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
|
- }
|
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- //接口引擎模式
|
|
|
|
- return RespDTO.onSuc(map);
|
|
|
|
- }else{
|
|
|
|
- if(modeId==0 || modeId==null){
|
|
|
|
- return RespDTO.onError("无对应的文书类型");
|
|
|
|
- }
|
|
|
|
- //页面模式
|
|
|
|
- String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
|
-
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- AnalyzeApiVO analyzeApiVO=new AnalyzeApiVO();
|
|
|
|
- analyzeApiVO.setBehospitalCode(behospitalCode);
|
|
|
|
- analyzeApiVO.setHospitalId(hospitalId);
|
|
|
|
- Map<String, Object> map=behospitalInfoFacade.analyzeApi(analyzeApiVO);
|
|
|
|
-
|
|
|
|
- map.put("url",url);
|
|
|
|
-
|
|
|
|
-=========
|
|
|
|
- AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
|
- analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
|
- analyzeRunVO.setHospitalId(hospitalId);
|
|
|
|
- analyzeRunVO.setModeId(modeId);
|
|
|
|
- AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
|
- Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
- if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
|
|
|
+ try {
|
|
|
|
+ String behospitalCode =aMrContentVO.getRecords().get(0).getBehospitalCode();
|
|
|
|
+ Long hospitalId=aMrContentVO.getRecords().get(0).getHospitalId();
|
|
|
|
+ MedicalRecord medicalRecord=new MedicalRecord();
|
|
|
|
+ BeanUtil.copyProperties(aMrContentVO.getRecords().get(0),medicalRecord);
|
|
|
|
+ Long modeId=initModeId(medicalRecord);
|
|
|
|
+ if(aMrContentVO.getDockModeType().equals("0")){
|
|
|
|
+ Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
+ List<AMedicalRecordDTO> medicalRecordDTOList = BeanUtil.listCopyTo(aMrContentVO.getRecords(), AMedicalRecordDTO.class);
|
|
|
|
+ map.put("records",medicalRecordDTOList);
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
|
+ return RespDTO.onSuc(map);
|
|
|
|
+ }else if(aMrContentVO.getDockModeType().equals("1")){
|
|
|
|
+ if(modeId==0 || modeId==null){
|
|
|
|
+ return RespDTO.onError("无对应的文书类型");
|
|
|
|
+ }
|
|
|
|
+ //页面模式
|
|
|
|
+ String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
|
+ Map<String,Object> map=new HashMap<String,Object>();
|
|
map.put("url",url);
|
|
map.put("url",url);
|
|
- map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
|
+ return RespDTO.onSuc(map);
|
|
|
|
+ }else if(aMrContentVO.getDockModeType().equals("2")){
|
|
|
|
+ AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
|
+ analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
|
+ analyzeRunVO.setHospitalId(hospitalId);
|
|
|
|
+ analyzeRunVO.setModeId(modeId);
|
|
|
|
+ AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
|
+ Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
+ if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
|
+ map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
|
+ }
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
|
+ //接口引擎模式
|
|
|
|
+ return RespDTO.onSuc(map);
|
|
|
|
+ }else{
|
|
|
|
+ if(modeId==0 || modeId==null){
|
|
|
|
+ return RespDTO.onError("无对应的文书类型");
|
|
|
|
+ }
|
|
|
|
+ //页面模式
|
|
|
|
+ String url=readProperties.getProcessQcUrl()+"?behospitalCode="+behospitalCode+"&hospitalId="+hospitalId+"&modeId="+modeId;
|
|
|
|
+
|
|
|
|
+ AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
|
|
|
|
+ analyzeRunVO.setBehospitalCode(behospitalCode);
|
|
|
|
+ analyzeRunVO.setHospitalId(hospitalId);
|
|
|
|
+ analyzeRunVO.setModeId(modeId);
|
|
|
|
+ AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
|
|
|
|
+ Map<String,Object> map=new HashMap<String,Object>();
|
|
|
|
+ if(analyzeRunDTO.getMsgDTOList().size()>0){
|
|
|
|
+ map.put("url",url);
|
|
|
|
+ map.put("analyze",analyzeRunDTO.getMsgDTOList());
|
|
|
|
+ }
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),JSON.toJSONString(RespDTO.onSuc(map)),"操作正常!");
|
|
|
|
+ return RespDTO.onSuc(map);
|
|
}
|
|
}
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- return RespDTO.onSuc(map);
|
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(aMrContentVO),"",e.getMessage());
|
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
public void execute(List<MedicalRecord> medicalRecordList){
|
|
public void execute(List<MedicalRecord> medicalRecordList){
|
|
- List<MedicalRecord> addE = Lists.newLinkedList();
|
|
|
|
- List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
|
|
- List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
|
|
|
|
- List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
|
|
- if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
|
|
- medicalRecordList.stream().forEach(s -> {
|
|
|
|
- //初始化mode_id
|
|
|
|
- Long modeId=initModeId(s);
|
|
|
|
- if(modeId==Long.valueOf("0")){
|
|
|
|
- //新增类型到监测表中
|
|
|
|
- QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
|
- qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
- qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
- qcAbnormal.setType(1);
|
|
|
|
- qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
- qcAbnormal.setGmtCreate(new Date());
|
|
|
|
- qcAbnormalList.add(qcAbnormal);
|
|
|
|
- }else if(modeId==Long.valueOf("1")){
|
|
|
|
-
|
|
|
|
- BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
- .eq("behospital_code", s.getBehospitalCode())
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- .eq("hospital_id", s.getHospitalId()));
|
|
|
|
-=========
|
|
|
|
- .eq("hospital_id", s.getHospitalId()), false);
|
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- if(behospitalInfo!=null){
|
|
|
|
- //如果病人住院信息存在,更新对应的qc_type_id
|
|
|
|
- Long qcTypeId=Long.valueOf("0");
|
|
|
|
- QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
|
- .eq("name",s.getRecTitle())
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- .eq("hospital_id", s.getHospitalId()));
|
|
|
|
-=========
|
|
|
|
|
|
+ try {
|
|
|
|
+ List<MedicalRecord> addE = Lists.newLinkedList();
|
|
|
|
+ List<MedicalRecord> updateE = Lists.newLinkedList();
|
|
|
|
+ List<BehospitalInfo> behospitalInfoList=Lists.newLinkedList();
|
|
|
|
+ List<QcAbnormal> qcAbnormalList = Lists.newLinkedList();
|
|
|
|
+ if (medicalRecordList != null && medicalRecordList.size() > 0) {
|
|
|
|
+ medicalRecordList.stream().forEach(s -> {
|
|
|
|
+ //初始化mode_id
|
|
|
|
+ Long modeId=initModeId(s);
|
|
|
|
+ if(modeId==Long.valueOf("0")){
|
|
|
|
+ //新增类型到监测表中
|
|
|
|
+ QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
|
+ qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
+ qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
+ qcAbnormal.setType(1);
|
|
|
|
+ qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
+ qcAbnormal.setGmtCreate(new Date());
|
|
|
|
+ qcAbnormalList.add(qcAbnormal);
|
|
|
|
+ }else if(modeId==Long.valueOf("1")){
|
|
|
|
+ BehospitalInfo behospitalInfo = behospitalInfoFacade.getOne(new QueryWrapper<BehospitalInfo>()
|
|
|
|
+ .eq("behospital_code", s.getBehospitalCode())
|
|
.eq("hospital_id", s.getHospitalId())
|
|
.eq("hospital_id", s.getHospitalId())
|
|
.eq("is_deleted",IsDeleteEnum.N), false);
|
|
.eq("is_deleted",IsDeleteEnum.N), false);
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- if(qcType!=null){
|
|
|
|
- behospitalInfo.setQcTypeId(qcType.getId());
|
|
|
|
- }else{
|
|
|
|
- //新增类型到qc_type表中
|
|
|
|
- QcType qctype=new QcType();
|
|
|
|
- qctype.setHospitalId(s.getHospitalId());
|
|
|
|
- qctype.setName(s.getRecTitle());
|
|
|
|
- qctype.setGmtCreate(new Date());
|
|
|
|
-
|
|
|
|
- Long id=qcTypeFacade.saveT(qctype);
|
|
|
|
- behospitalInfo.setQcTypeId(id);
|
|
|
|
-
|
|
|
|
- //新增类型到监测表中
|
|
|
|
- QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
|
- qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
- qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
- qcAbnormal.setType(2);
|
|
|
|
- qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
- qcAbnormal.setGmtCreate(new Date());
|
|
|
|
- qcAbnormalService.getBaseMapper().insert(qcAbnormal);
|
|
|
|
|
|
+ if(behospitalInfo!=null){
|
|
|
|
+ //如果病人住院信息存在,更新对应的qc_type_id
|
|
|
|
+ Long qcTypeId=Long.valueOf("0");
|
|
|
|
+ QcType qcType=qcTypeFacade.getOne(new QueryWrapper<QcType>()
|
|
|
|
+ .eq("name",s.getRecTitle())
|
|
|
|
+ .eq("hospital_id", s.getHospitalId())
|
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N), false);
|
|
|
|
+ if(qcType!=null){
|
|
|
|
+ behospitalInfo.setQcTypeId(qcType.getId());
|
|
|
|
+ }else{
|
|
|
|
+ //新增类型到qc_type表中
|
|
|
|
+ QcType qctype=new QcType();
|
|
|
|
+ qctype.setHospitalId(s.getHospitalId());
|
|
|
|
+ qctype.setName(s.getRecTitle());
|
|
|
|
+ qctype.setGmtCreate(new Date());
|
|
|
|
+
|
|
|
|
+ Long id=qcTypeFacade.saveT(qctype);
|
|
|
|
+ behospitalInfo.setQcTypeId(id);
|
|
|
|
+
|
|
|
|
+ //新增类型到监测表中
|
|
|
|
+ QcAbnormal qcAbnormal=new QcAbnormal();
|
|
|
|
+ qcAbnormal.setHospitalId(s.getHospitalId());
|
|
|
|
+ qcAbnormal.setBehospitalCode(s.getBehospitalCode());
|
|
|
|
+ qcAbnormal.setType(2);
|
|
|
|
+ qcAbnormal.setDescription(s.getRecTitle());
|
|
|
|
+ qcAbnormal.setGmtCreate(new Date());
|
|
|
|
+ qcAbnormalService.getBaseMapper().insert(qcAbnormal);
|
|
|
|
+ }
|
|
|
|
+ behospitalInfoList.add(behospitalInfo);
|
|
}
|
|
}
|
|
- behospitalInfoList.add(behospitalInfo);
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
- s.setModeId(modeId);
|
|
|
|
- //新增或修改
|
|
|
|
- MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
|
|
|
|
- .eq("rec_id", s.getRecId())
|
|
|
|
- .eq("hospital_id", s.getHospitalId())
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- .eq("behospital_code", s.getBehospitalCode()));
|
|
|
|
-=========
|
|
|
|
- .eq("behospital_code", s.getBehospitalCode()), false);
|
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- if (mRecord != null) {
|
|
|
|
- s.setGmtModified(new Date());
|
|
|
|
- updateE.add(s);
|
|
|
|
- } else {
|
|
|
|
- s.setGmtCreate(new Date());
|
|
|
|
- addE.add(s);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- if(addE.size()>0){
|
|
|
|
- medicalRecordService.saveBatch(addE);
|
|
|
|
- }
|
|
|
|
- if(updateE.size()>0){
|
|
|
|
- medicalRecordService.updateBatchByKey(updateE);
|
|
|
|
- }
|
|
|
|
- if(qcAbnormalList.size()>0){
|
|
|
|
- qcAbnormalService.saveBatch(qcAbnormalList);
|
|
|
|
- }
|
|
|
|
- if(behospitalInfoList.size()>0){
|
|
|
|
- behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|
|
|
|
|
|
+ s.setModeId(modeId);
|
|
|
|
+ //新增或修改
|
|
|
|
+ MedicalRecord mRecord = this.getOne(new QueryWrapper<MedicalRecord>()
|
|
|
|
+ .eq("rec_id", s.getRecId())
|
|
|
|
+ .eq("hospital_id", s.getHospitalId())
|
|
|
|
+ .eq("behospital_code", s.getBehospitalCode()), false);
|
|
|
|
+ if (mRecord != null) {
|
|
|
|
+ s.setGmtModified(new Date());
|
|
|
|
+ updateE.add(s);
|
|
|
|
+ } else {
|
|
|
|
+ s.setGmtCreate(new Date());
|
|
|
|
+ addE.add(s);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ if(addE.size()>0){
|
|
|
|
+ medicalRecordService.saveBatch(addE);
|
|
|
|
+ }
|
|
|
|
+ if(updateE.size()>0){
|
|
|
|
+ medicalRecordService.updateBatchByKey(updateE);
|
|
|
|
+ }
|
|
|
|
+ if(qcAbnormalList.size()>0){
|
|
|
|
+ qcAbnormalService.saveBatch(qcAbnormalList);
|
|
|
|
+ }
|
|
|
|
+ if(behospitalInfoList.size()>0){
|
|
|
|
+ behospitalInfoFacade.updateBatchByKey(behospitalInfoList);
|
|
|
|
+ }
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(medicalRecordList),"","操作正常!");
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息",JSON.toJSONString(medicalRecordList),"",e.getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -337,20 +321,61 @@ public class AMedicalRecordFacade extends MedicalRecordServiceImpl {
|
|
*/
|
|
*/
|
|
private Long initModeId(MedicalRecord medicalRecord){
|
|
private Long initModeId(MedicalRecord medicalRecord){
|
|
Long modeId=Long.valueOf("0");
|
|
Long modeId=Long.valueOf("0");
|
|
- QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
|
|
|
|
- wrapper.eq("hospital_id",medicalRecord.getHospitalId());
|
|
|
|
- wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
|
|
|
|
-<<<<<<<<< Temporary merge branch 1
|
|
|
|
- ModelHospital mode=modelHospitalFacade.getOne(wrapper);
|
|
|
|
-=========
|
|
|
|
- ModelHospital mode=modelHospitalFacade.getOne(wrapper, false);
|
|
|
|
->>>>>>>>> Temporary merge branch 2
|
|
|
|
- if(mode!=null){
|
|
|
|
- modeId=mode.getStandModelId();
|
|
|
|
- }else{
|
|
|
|
- modeId=Long.valueOf("0");
|
|
|
|
|
|
+ try {
|
|
|
|
+ QueryWrapper<ModelHospital> wrapper = new QueryWrapper<>();
|
|
|
|
+ wrapper.eq("hospital_id",medicalRecord.getHospitalId());
|
|
|
|
+ wrapper.eq("hospital_model_name",medicalRecord.getRecTitle());
|
|
|
|
+ ModelHospital mode=modelHospitalFacade.getOne(wrapper, false);
|
|
|
|
+ if(mode!=null){
|
|
|
|
+ modeId=mode.getStandModelId();
|
|
|
|
+ }else{
|
|
|
|
+ modeId=Long.valueOf("0");
|
|
|
|
+ }
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",JSON.toJSONString(medicalRecord),modeId.toString(),"操作成功!");
|
|
|
|
+ return modeId;
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-初始化modeId",JSON.toJSONString(medicalRecord),"",e.getMessage());
|
|
|
|
+ return modeId;
|
|
}
|
|
}
|
|
- return modeId;
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-}
|
|
|
|
|
|
+ public RespDTO deleteFlag(ADeleteFlagVO aDeleteFlagVO){
|
|
|
|
+ try {
|
|
|
|
+ //验证数据是否存在
|
|
|
|
+ if (StringUtil.isEmpty(aDeleteFlagVO.getRecId())) {
|
|
|
|
+ return RespDTO.onError("请输入文书序号!");
|
|
|
|
+ } else if (aDeleteFlagVO.getHospitalId() == null) {
|
|
|
|
+ return RespDTO.onError("请输入医院编码!");
|
|
|
|
+ } else if (StringUtil.isEmpty(aDeleteFlagVO.getBehospitalCode())) {
|
|
|
|
+ return RespDTO.onError("请输入病人住院编码!");
|
|
|
|
+ }else {
|
|
|
|
+ UpdateWrapper<MedicalRecord> updateWrapper=new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.eq("rec_id", aDeleteFlagVO.getRecId())
|
|
|
|
+ .eq("hospital_id", aDeleteFlagVO.getHospitalId())
|
|
|
|
+ .eq("behospital_code", aDeleteFlagVO.getBehospitalCode())
|
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N)
|
|
|
|
+ .set("is_deleted",IsDeleteEnum.Y)
|
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
|
+
|
|
|
|
+ Boolean flag=update(new MedicalRecord(),updateWrapper);
|
|
|
|
+ if(flag){
|
|
|
|
+ UpdateWrapper<MedicalRecordContent> updateWrapperContent=new UpdateWrapper<>();
|
|
|
|
+ updateWrapperContent.eq("rec_id", aDeleteFlagVO.getRecId())
|
|
|
|
+ .eq("hospital_id", aDeleteFlagVO.getHospitalId())
|
|
|
|
+ .eq("is_deleted",IsDeleteEnum.N)
|
|
|
|
+ .set("is_deleted",IsDeleteEnum.Y)
|
|
|
|
+ .set("gmt_modified", DateUtil.now());
|
|
|
|
+
|
|
|
|
+ Boolean flagContent=aMedicalRecordContentFacade.update(new MedicalRecordContent(),updateWrapperContent);
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书内容-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flagContent)),"操作成功!");
|
|
|
|
+ }
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书信息-删除",JSON.toJSONString(aDeleteFlagVO),JSON.toJSONString(RespDTO.onSuc(flag)),"操作成功!");
|
|
|
|
+ return RespDTO.onSuc(flag);
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ aMedAbnormalInfoFacade.saveAbnormalInfo("文书-删除",JSON.toJSONString(aDeleteFlagVO),"",e.getMessage());
|
|
|
|
+ return RespDTO.onError(e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|