|
|
@@ -45,6 +45,7 @@ import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.Iterator;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
@@ -74,6 +75,9 @@ public class HospGetDataToRuleEngine {
|
|
|
|
|
|
String detailSql = "select * from V_YBKF_ADVICE_DETAILS where patient_id=:PATIENT_ID and visit_no=:VISIT_NO and medical_project_code is not null";
|
|
|
String diagnoseSql = "select * from V_YBKF_DIAGNOSES where patient_id=:PATIENT_ID and visit_no=:VISIT_NO and medical_diagnose_code is not null";
|
|
|
+ String diagnosesTreatmentSql = "select ITEM_CODE as PROJECT_CODE,ITEM_NAME as PROJECT_NAME,INSUR_ITEM_CODE AS MEDICAL_PROJECT_CODE," +
|
|
|
+ "INSUR_ITEM_NAME AS MEDICAL_PROJECT_NAME, RECEIPT_CLASS as EXPENSE_CATEGORY,SL as QUANTITY,CLINIC_PRICE as PRICE from V_YBKF_CLINIC_COLLATE " +
|
|
|
+ "where ITEM_CODE=:ITEM_CODE ";
|
|
|
|
|
|
public Result getHopsDataByVisiVo(HospMidIncidentWarningVO hospMidIncidentWarningVO) {
|
|
|
Result result = null;
|
|
|
@@ -113,17 +117,39 @@ public class HospGetDataToRuleEngine {
|
|
|
// if (CollectionUtil.isNotEmpty(sysUserList)) {
|
|
|
// doctorLevel = sysUserList.get(0).getDoctorLevel();
|
|
|
// }
|
|
|
+ List<Map<String,Object>> diagTreatMapList = new ArrayList<>();
|
|
|
+ Iterator<Map<String,Object>> iterator = detailList.iterator();
|
|
|
+ while(iterator.hasNext()){
|
|
|
+ Map<String,Object> detailMap = iterator.next();
|
|
|
+ Object projectType = detailMap.get("PROJECT_TYPE");
|
|
|
+ if(null != projectType && "diagnosis_treatment".equals(projectType.toString())){
|
|
|
+ Map<String,Object> diagTreatParamMap = new HashMap<>();
|
|
|
+ diagTreatParamMap.put("ITEM_CODE", detailMap.get("PROJECT_CODE"));
|
|
|
+ List<Map<String,Object>> diagTreatTempMapList = namedParameterJdbcTemplate.queryForList(diagnosesTreatmentSql, diagTreatParamMap);
|
|
|
+ if(CollectionUtil.isNotEmpty(diagTreatTempMapList)){
|
|
|
+ Map<String,Object> diagTreatNewMap = new HashMap<>();
|
|
|
+ for(Map<String,Object> diagTreatTemMap : diagTreatTempMapList){
|
|
|
+ diagTreatNewMap.putAll(detailMap);
|
|
|
+ diagTreatNewMap.putAll(diagTreatTemMap);
|
|
|
+ diagTreatMapList.add(diagTreatNewMap);
|
|
|
+ }
|
|
|
+ iterator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for (Map<String, Object> detailMap : detailList) {
|
|
|
if (CollectionUtil.isNotEmpty(diagnoseList)) {
|
|
|
detailMap.putAll(diagnoseList.get(0));
|
|
|
}
|
|
|
CommonUtil.setMidChangeClass(detailMap);
|
|
|
- Object pCategory = detailMap.get("EXPENSE_CATEGORY");
|
|
|
- if (null != pCategory && StringUtils.isNotBlank(pCategory.toString())) {
|
|
|
- detailMap.put("EXPENSE_CATEGORY", categoriesItemMap.getOrDefault(pCategory, pCategory.toString()));
|
|
|
+ Object expense_category = detailMap.get("EXPENSE_CATEGORY");
|
|
|
+ if (null != expense_category && StringUtils.isNotBlank(expense_category.toString())) {
|
|
|
+ detailMap.put("EXPENSE_CATEGORY", categoriesItemMap.getOrDefault(expense_category, expense_category.toString()));
|
|
|
}
|
|
|
CommonUtil.setDockerLevel(detailMap);
|
|
|
CommonUtil.setProjectType(detailMap);
|
|
|
+
|
|
|
Map<String, Object> lowercaseMap = new HashMap<>();
|
|
|
for (Map.Entry<String, Object> entry : detailMap.entrySet()) {
|
|
|
String lowercaseKey = entry.getKey().toLowerCase();
|