|
@@ -28,6 +28,7 @@ import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.BehospitalInfoServiceImpl;
|
|
|
import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
+import com.diagbot.util.EncrypDES;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.MapUtil;
|
|
@@ -42,6 +43,7 @@ import com.diagbot.vo.QcResultAlgVO;
|
|
|
import com.diagbot.vo.QueryVo;
|
|
|
import com.diagbot.vo.RecordContentVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -50,6 +52,7 @@ import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -88,6 +91,8 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
AuthServiceClient authServiceClient;
|
|
|
@Autowired
|
|
|
QcCasesEntryPagedataFacade qcCasesEntryPagedataFacade;
|
|
|
+ @Value("${encrypt.enable}")
|
|
|
+ Boolean encryptFlag;
|
|
|
|
|
|
public IPage<BehospitalInfoDTO> pageFac(BehospitalPageVO behospitalPageVO) {
|
|
|
//入参验证
|
|
@@ -201,6 +206,21 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
RecordContentVO recordContentVO = new RecordContentVO();
|
|
|
BeanUtil.copyProperties(analyzeVO, recordContentVO);
|
|
|
List<RecordContentDTO> recordContentDTOList = medicalRecordFacade.getRecordContentFac(recordContentVO);
|
|
|
+ String recTitle = "";
|
|
|
+ // 解密数据
|
|
|
+ if (encryptFlag) {
|
|
|
+ try {
|
|
|
+ EncrypDES encrypDES = new EncrypDES();
|
|
|
+ for (RecordContentDTO recordContentDTO : recordContentDTOList) {
|
|
|
+ recTitle = recordContentDTO.getRecTitle();
|
|
|
+ recordContentDTO.setContentText(encrypDES.decryptor(recordContentDTO.getContentText()));
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
+ "解密错误!病历号=【" + analyzeVO.getBehospitalCode() + "】,医院文书名称=【" + recTitle + "】");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
Map<String, List<RecordContentDTO>> recMap = EntityUtil.makeEntityListMap(recordContentDTOList, "standModelName");
|
|
|
|
|
|
// 获取医嘱
|
|
@@ -258,6 +278,9 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
addData("输血后效果评价", recMap, medrecVoList);
|
|
|
addData("病理检验送检单", recMap, medrecVoList);
|
|
|
|
|
|
+ addDataWithInnerKey("知情同意书", recMap, medrecVoList);
|
|
|
+ addDataWithInnerKey("谈话告知书", recMap, medrecVoList);
|
|
|
+
|
|
|
// 会诊记录
|
|
|
addDataWithKey("会诊", recMap, medrecVoList,
|
|
|
Arrays.asList("会诊记录", "会诊结果单", "会诊申请单"));
|
|
@@ -274,8 +297,10 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
// 病案首页
|
|
|
- addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
|
|
|
- homePageList, homeOperationInfoList);
|
|
|
+ if (homePage != null) {
|
|
|
+ addDataWithFirstPage("病案首页", homePage, medrecVoList, dicMap,
|
|
|
+ homePageList, homeOperationInfoList);
|
|
|
+ }
|
|
|
|
|
|
queryVo.setMedrec(medrecVoList);
|
|
|
|
|
@@ -380,6 +405,34 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 拼接数据(例如:知情同意书、谈话告知书)
|
|
|
+ *
|
|
|
+ * @param key
|
|
|
+ * @param recMap
|
|
|
+ * @param medrecVoList
|
|
|
+ */
|
|
|
+ public void addDataWithInnerKey(String key, Map<String, List<RecordContentDTO>> recMap, List<MedrecVo> medrecVoList) {
|
|
|
+ MedrecVo medrecVo = new MedrecVo();
|
|
|
+ medrecVo.setTitle(key);
|
|
|
+ Map<String, Object> content = new HashMap<>();
|
|
|
+ Map<String, List<String>> listMap = new HashMap<>();
|
|
|
+ List<RecordContentDTO> recordContentDTOList = recMap.get(key);
|
|
|
+ if (ListUtil.isNotEmpty(recordContentDTOList)) {
|
|
|
+ Map<String, List<RecordContentDTO>> keyMap =
|
|
|
+ EntityUtil.makeEntityListMap(recordContentDTOList, "recTitle");
|
|
|
+ Set<String> keyList = keyMap.keySet();
|
|
|
+ for (String k : keyList) {
|
|
|
+ if (ListUtil.isNotEmpty(keyMap.get(k))) {
|
|
|
+ listMap.put(k, keyMap.get(k).stream().map(r -> r.getContentText()).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ content.put("content", listMap);
|
|
|
+ medrecVo.setContent(content);
|
|
|
+ medrecVoList.add(medrecVo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 拼接数据(医嘱),从数据字典获取信息转换
|
|
|
*
|