|
|
@@ -68,14 +68,29 @@ public class HospGetDataToRuleEngine {
|
|
|
String diagnoseSql = "select * from V_YBKF_DIAGNOSES where patient_id=:PATIENT_ID and visit_no=:VISIT_NO and medical_diagnose_code is not null";
|
|
|
|
|
|
public Result getHopsDataByVisiVo(HospMidIncidentWarningVO hospMidIncidentWarningVO) {
|
|
|
+ Result result = null;
|
|
|
NamedParameterJdbcTemplate namedParameterJdbcTemplate = DynamicDBUtil.getNamedParameterJdbcTemplate(Constant.FY_ORACLE);
|
|
|
log.info("接收报文:{}", JSON.toJSONString(hospMidIncidentWarningVO));
|
|
|
- MidResult midResult = new MidResult();
|
|
|
Map<String, Object> paramMap = new HashMap<>();
|
|
|
paramMap.put("PATIENT_ID", hospMidIncidentWarningVO.getPatient_id());
|
|
|
paramMap.put("VISIT_NO", hospMidIncidentWarningVO.getVisit_no());
|
|
|
List<Map<String, Object>> detailList = namedParameterJdbcTemplate.queryForList(detailSql, paramMap);
|
|
|
+ if(CollectionUtil.isEmpty(detailList)){
|
|
|
+ log.error("未查询到对应的带有医保编码的医嘱明细,无法进行规则判断");
|
|
|
+ return Result.error("未查询到对应的带有医保编码的医嘱明细,无法进行规则判断");
|
|
|
+ }
|
|
|
List<Map<String, Object>> diagnoseList = namedParameterJdbcTemplate.queryForList(diagnoseSql, paramMap);
|
|
|
+ if(CollectionUtil.isEmpty(diagnoseList)){
|
|
|
+ log.error("未查询到对应的带有医保编码的诊断,无法进行规则判断");
|
|
|
+ return Result.error("未查询到对应的带有医保编码的诊断,无法进行规则判断");
|
|
|
+ }
|
|
|
+// List<Map<String, Object>> diagnoseList = new ArrayList<>();
|
|
|
+// for(Map<String, Object> diagnoseMap : allDiagnoseList){
|
|
|
+// if(null != diagnoseMap.get("MEDICAL_DIAGNOSE_CODE") && StringUtils.isNotBlank(diagnoseMap.get("MEDICAL_DIAGNOSE_CODE").toString())){
|
|
|
+// diagnoseList.add(diagnoseMap);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
List<Map<String, Object>> detailMapList = new ArrayList<>();
|
|
|
Double totalAmount = 0.0;
|
|
|
Map<String, String> categoriesItemMap = CommonUtil.getCategoriesItemsMap();
|
|
|
@@ -125,9 +140,9 @@ public class HospGetDataToRuleEngine {
|
|
|
}
|
|
|
diagnoseMapList.add(lowercaseMap);
|
|
|
}
|
|
|
- dealMidInterfaceEngin(detailMapList, diagnoseMapList, totalAmount);
|
|
|
- log.info("返回报文:{}", JSON.toJSONString(midResult));
|
|
|
- return Result.OK();
|
|
|
+ result = dealMidInterfaceEngin(detailMapList, diagnoseMapList, totalAmount);
|
|
|
+ log.info("返回报文:{}", JSON.toJSONString(result));
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
public Result dealMidInterfaceEngin(List<Map<String, Object>> detailMapList, List<Map<String, Object>> diagnoseList, Double totalAmount) {
|