Jelajahi Sumber

死亡记录可编辑保存(质控评分)

xiewei 7 bulan lalu
induk
melakukan
5f18b6e4e8

+ 13 - 0
src/main/java/com/diagbot/facade/StrDeathDiscussionFacade.java

@@ -1,11 +1,13 @@
 package com.diagbot.facade;
 
+import com.diagbot.dto.AnalyzeRunDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.entity.MedicalRecord;
 import com.diagbot.entity.StrDeathDiscussion;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.impl.StrDeathDiscussionServiceImpl;
+import com.diagbot.vo.AnalyzeRunVO;
 import com.diagbot.vo.str.StrDeathDiscussionVO;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -23,6 +25,9 @@ public class StrDeathDiscussionFacade extends StrDeathDiscussionServiceImpl {
     @Autowired
     private MedicalRecordFacade medicalRecordFacade;
 
+    @Autowired
+    private BehospitalInfoFacade behospitalInfoFacade;
+
     public RespDTO<StrDeathDiscussionVO> sendDeathDiscussionInfos(StrDeathDiscussion strDeathDiscussion) {
 
         try {
@@ -42,6 +47,14 @@ public class StrDeathDiscussionFacade extends StrDeathDiscussionServiceImpl {
             strDeathDiscussion.setWholeData(strResult);
             //修改或更新表中记录
             boolean saveOrUpdate = this.saveOrUpdate(strDeathDiscussion);
+            //修改评分数据,并进行质控评分
+            if(saveOrUpdate){
+                AnalyzeRunVO analyzeRunVO=new AnalyzeRunVO();
+                analyzeRunVO.setBehospitalCode(medicalRecord.getBehospitalCode());
+                analyzeRunVO.setHospitalId(medicalRecord.getHospitalId());
+                analyzeRunVO.setModeId(medicalRecord.getModeId());
+                AnalyzeRunDTO analyzeRunDTO=behospitalInfoFacade.analyzeRun(analyzeRunVO);
+            }
             return saveOrUpdate == true? RespDTO.onSuc("操作正常!") : RespDTO.onError("保存记录失败!");
         } catch (JsonProcessingException e) {
             throw new CommonException(CommonErrorCode.INSERT_DATA_FAILED);