|
@@ -32,6 +32,7 @@ import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.AlgorithmVO;
|
|
|
import com.diagbot.vo.AnalyzeApiVO;
|
|
|
+import com.diagbot.vo.AnalyzeCdsVO;
|
|
|
import com.diagbot.vo.AnalyzeCodeVO;
|
|
|
import com.diagbot.vo.AnalyzeRunVO;
|
|
|
import com.diagbot.vo.AnalyzeVO;
|
|
@@ -44,6 +45,8 @@ import com.diagbot.vo.QcResultAlgVO;
|
|
|
import com.diagbot.vo.QueryVo;
|
|
|
import com.diagbot.vo.RecordContentVO;
|
|
|
import com.diagbot.vo.TaskVO;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -1268,4 +1271,67 @@ public class BehospitalInfoFacade extends BehospitalInfoServiceImpl {
|
|
|
map.put("date", date);
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * cds访问质控接口
|
|
|
+ *
|
|
|
+ * @param analyzeCdsVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Map<String,String> analyzeCds(AnalyzeCdsVO analyzeCdsVO) {
|
|
|
+ Map<String,String> ret = Maps.newHashMap();
|
|
|
+ List<QcCasesEntryDTO> qcCasesEntryDTOList = qcCasesEntryFacade.getQcCasesEntryCds(analyzeCdsVO);
|
|
|
+ Map<String,String> codeMsgMap = qcCasesEntryDTOList.stream().collect(Collectors.toMap(i->i.getCode(),i->i.getMsg()));
|
|
|
+
|
|
|
+ QueryVo queryVo = new QueryVo();
|
|
|
+ queryVo.setCid(basHospitalInfoFacade.getHosCode(analyzeCdsVO.getHospitalId())); // 设置医院编码
|
|
|
+ queryVo.setHospitalId(String.valueOf(analyzeCdsVO.getHospitalId()));
|
|
|
+ queryVo.setInputCatalogueMap(getInputCatalogueMap(qcCasesEntryDTOList)); // 设置质控条目编码
|
|
|
+ queryVo.setUseCrfCache(false);
|
|
|
+
|
|
|
+ List<MedrecVo> medrecVoList = new ArrayList<>(); // 设置内容
|
|
|
+
|
|
|
+ MedrecVo outDepMedrecVo = new MedrecVo();
|
|
|
+ outDepMedrecVo.setTitle("门诊");
|
|
|
+ Map<String, Object> outDepContent = new HashMap<>();
|
|
|
+ List<Map<String, String>> outDepMaps = Lists.newArrayList();
|
|
|
+ Map<String, String> outDepMap = Maps.newHashMap();
|
|
|
+ outDepMap.put("主诉", analyzeCdsVO.getChief());
|
|
|
+ outDepMap.put("现病史", analyzeCdsVO.getSymptom());
|
|
|
+ outDepMap.put("既往史", analyzeCdsVO.getPasts());
|
|
|
+ outDepMaps.add(outDepMap);
|
|
|
+ outDepContent.put("content", outDepMaps);
|
|
|
+ outDepMedrecVo.setContent(outDepContent);
|
|
|
+ medrecVoList.add(outDepMedrecVo);
|
|
|
+
|
|
|
+ MedrecVo beInfoMedrecVo = new MedrecVo();
|
|
|
+ beInfoMedrecVo.setTitle("住院病历信息");
|
|
|
+ List<BehospitalInfo> behospitalInfoList = Lists.newArrayList();
|
|
|
+ BehospitalInfo behospitalInfo = new BehospitalInfo();
|
|
|
+ behospitalInfo.setBehospitalCode("cds-menzhen");
|
|
|
+ behospitalInfoList.add(behospitalInfo);
|
|
|
+ Map<String, Object> beInfoContent = new HashMap<>();
|
|
|
+ beInfoContent.put("content", behospitalInfoList);
|
|
|
+ beInfoMedrecVo.setContent(beInfoContent);
|
|
|
+ medrecVoList.add(beInfoMedrecVo);
|
|
|
+ queryVo.setBehospitalInfo(behospitalInfo);
|
|
|
+ queryVo.setMedrec(medrecVoList);
|
|
|
+
|
|
|
+ Response<OutputInfo> response = qcServiceClient.extract(queryVo);
|
|
|
+ if (response == null || response.getData() == null) {
|
|
|
+ if (null == response) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!");
|
|
|
+ } else {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "远程质控接口没有返回数据!错误原因:" + response.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ OutputInfo outputInfo = response.getData();
|
|
|
+ outputInfo.getResult().keySet().forEach(key->{
|
|
|
+ ret.put(codeMsgMap.get(key),outputInfo.getResult().get(key).get("info"));
|
|
|
+ });
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
}
|