|
@@ -21,6 +21,7 @@ import com.google.common.collect.Lists;
|
|
|
import io.github.lvyahui8.spring.aggregate.facade.DataBeanAggregateQueryFacade;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
+import org.apache.poi.hssf.record.DVALRecord;
|
|
|
import org.apache.poi.ss.formula.functions.Na;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -77,7 +78,8 @@ public class ConsoleFacade {
|
|
|
private DoctorAdviceFacade doctorAdviceFacade;
|
|
|
@Autowired
|
|
|
private MedIndexResultFacade medIndexResultFacade;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private MedIndexRelevanceFacade medIndexRelevanceFacade;
|
|
|
//region-----------------------聚合接口开始-------------------------------
|
|
|
|
|
|
/**
|
|
@@ -596,31 +598,79 @@ public class ConsoleFacade {
|
|
|
*/
|
|
|
public void getMedicaIndicator(FilterVO filterVO){
|
|
|
MedIndexResult medIndexResult = new MedIndexResult();
|
|
|
- Map<String, Long> selectOperationNumMap = behospitalInfoFacade.selectOperationNum(filterVO);
|
|
|
+ List<Map<String, String>> selectOperationNumMap = behospitalInfoFacade.selectOperationNum(filterVO);
|
|
|
+ if(ListUtil.isNotEmpty(selectOperationNumMap)) {
|
|
|
//出院人数
|
|
|
- Long startCount = selectOperationNumMap.get(QualityContent.DISCHARGED_PATIENTS);
|
|
|
- Long operationFeeNum = 0L;
|
|
|
- filterVO.setFlagStr("2");
|
|
|
- List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
- Map<String, Long> adviceNum = getAdviceNum(filterVO,doctorAdviceMedManageParams);
|
|
|
- //手术人数
|
|
|
- operationFeeNum = selectOperationNumMap.get("operationFee");
|
|
|
- Long operation = adviceNum.get("operation");
|
|
|
- operationFeeNum = operationFeeNum + operation;
|
|
|
+ CopyOnWriteArrayList<String> operationCode = new CopyOnWriteArrayList<>();
|
|
|
+ CopyOnWriteArrayList<String> operationPathologyCode = new CopyOnWriteArrayList<>();
|
|
|
+ CopyOnWriteArrayList<String> antibiosisCode = new CopyOnWriteArrayList<>();
|
|
|
+ Long operationFeeNum = 0L;
|
|
|
+ filterVO.setFlagStr("2");
|
|
|
+ List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
+ Map<String, List<String>> adviceNum = getAdviceNum(filterVO, doctorAdviceMedManageParams);
|
|
|
+ Long startCount = (Long.valueOf(selectOperationNumMap.size()));
|
|
|
+ for (Map<String, String> stringStringMap : selectOperationNumMap) {
|
|
|
+ if (Double.parseDouble(stringStringMap.get("operationFee"))>0){
|
|
|
+ String behospitalCode = stringStringMap.get("behospitalCode");
|
|
|
+ operationCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map<String, String> stringStringMap : selectOperationNumMap) {
|
|
|
+ if (Double.parseDouble(stringStringMap.get("operationFee"))>0 && Double.parseDouble(stringStringMap.get("pathologyFee"))>QualityContent.pathologyFee){
|
|
|
+ String behospitalCode = stringStringMap.get("behospitalCode");
|
|
|
+ operationPathologyCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (Map<String, String> stringStringMap : selectOperationNumMap) {
|
|
|
+ if (Double.parseDouble(stringStringMap.get("antibiosisFee"))>0){
|
|
|
+ String behospitalCode = stringStringMap.get("behospitalCode");
|
|
|
+ antibiosisCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //手术人
|
|
|
+ List<String> operationList = adviceNum.get("operation");
|
|
|
+ if(ListUtil.isNotEmpty(operationList)){
|
|
|
+ for (String s : operationList) {
|
|
|
+ operationCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ operationFeeNum = Long.valueOf(String.valueOf(operationCode.size()));
|
|
|
//CT人数
|
|
|
- Long CTNum = adviceNum.get("CT");
|
|
|
+ List<String> ctList = adviceNum.get("CT");
|
|
|
+ Long CTNum=0L;
|
|
|
+ if(ListUtil.isNotEmpty(ctList)) {
|
|
|
+ CTNum = Long.valueOf(String.valueOf(ctList.size()));
|
|
|
+ }
|
|
|
//MR人数
|
|
|
- Long MRNum = adviceNum.get("MR");
|
|
|
+ List<String> mrList = adviceNum.get("MR");
|
|
|
+ Long MRNum=0L;
|
|
|
+ if(ListUtil.isNotEmpty(ctList)) {
|
|
|
+ MRNum = Long.valueOf(String.valueOf(mrList.size()));
|
|
|
+ }
|
|
|
//手术病理人数
|
|
|
- Long operationPathologyFeeNum = selectOperationNumMap.get("operationPathologyFee");
|
|
|
- Long operationPathology = adviceNum.get("operationPathology");
|
|
|
- operationPathologyFeeNum = operationPathologyFeeNum + operationPathology;
|
|
|
+ List<String> operationPathologyList = adviceNum.get("operationPathology");
|
|
|
+ if(ListUtil.isNotEmpty(operationPathologyList)){
|
|
|
+ for (String s : operationPathologyList) {
|
|
|
+ operationPathologyCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Long operationPathologyFeeNum = Long.valueOf(operationPathologyCode.size());
|
|
|
//抗菌药物人数
|
|
|
- Long antibiosisFeeNum = selectOperationNumMap.get("antibiosisFee");
|
|
|
- Long antibiosisNum = adviceNum.get("antibiosis");
|
|
|
- antibiosisFeeNum = antibiosisFeeNum + antibiosisNum;
|
|
|
+
|
|
|
+ List<String> antibiosisList = adviceNum.get("antibiosis");
|
|
|
+
|
|
|
+ if(ListUtil.isNotEmpty(antibiosisList)) {
|
|
|
+ for (String s : antibiosisList) {
|
|
|
+ antibiosisCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Long antibiosisFeeNum = Long.valueOf(antibiosisCode.size());
|
|
|
//恶性肿瘤化学治疗人数
|
|
|
- Long chemotherapyMalignantTumorsNum = adviceNum.get("chemotherapyMalignantTumors");
|
|
|
+ List<String> chemotherapyMalignantTumorsList = adviceNum.get("chemotherapyMalignantTumors");
|
|
|
+ Long chemotherapyMalignantTumorsNum =0L;
|
|
|
+ if(ListUtil.isNotEmpty(chemotherapyMalignantTumorsList)) {
|
|
|
+ chemotherapyMalignantTumorsNum= Long.valueOf(chemotherapyMalignantTumorsList.size());
|
|
|
+ }
|
|
|
//出院人数
|
|
|
if(startCount!=null){
|
|
|
medIndexResult.setAdmissionResult(Double.valueOf(startCount));
|
|
@@ -676,7 +726,42 @@ public class ConsoleFacade {
|
|
|
medIndexResult.setEndDate(filterVO.getEndDate());
|
|
|
medIndexResult.setGmtCreate(new Date());
|
|
|
medIndexResultFacade.save(medIndexResult);
|
|
|
-
|
|
|
+ Integer id = medIndexResult.getId();
|
|
|
+ MedIndexRelevance medIndexRelevance = new MedIndexRelevance();
|
|
|
+ medIndexRelevance.setIndexResultId(id);
|
|
|
+ medIndexRelevance.setHospitalId(filterVO.getHospitalId());
|
|
|
+ medIndexRelevance.setStartDate(filterVO.getStartDate());
|
|
|
+ medIndexRelevance.setEndDate(filterVO.getEndDate());
|
|
|
+ medIndexRelevance.setGmtCreate(new Date());
|
|
|
+ if(ListUtil.isNotEmpty(ctList)) {
|
|
|
+ if(ListUtil.isNotEmpty(operationCode)) {
|
|
|
+ medIndexRelevance.setRelevanceType(4);
|
|
|
+ for (String Code : operationCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ medIndexRelevance.setRelevanceType(8);
|
|
|
+ for (String CTCode : ctList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(CTCode);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ListUtil.isNotEmpty(mrList)) {
|
|
|
+ medIndexRelevance.setRelevanceType(9);
|
|
|
+ for (String MrCode : mrList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(MrCode);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ListUtil.isNotEmpty(operationPathologyCode)) {
|
|
|
+ medIndexRelevance.setRelevanceType(10);
|
|
|
+ for (String Code : operationPathologyCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
/**
|
|
|
* 两数据相除得到百分比
|
|
@@ -757,10 +842,10 @@ public class ConsoleFacade {
|
|
|
/**
|
|
|
* 遍历医嘱信息存入相关数据
|
|
|
*/
|
|
|
- public Map<String,Long> getAdviceNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParamsList) {
|
|
|
+ public Map<String,List<String>> getAdviceNum(FilterVO filterVO, List<MedManageParamsDTO> doctorAdviceMedManageParamsList) {
|
|
|
CopyOnWriteArrayList<MedManageParamsDTO> doctorAdviceMedManageParams = new CopyOnWriteArrayList<>(doctorAdviceMedManageParamsList);
|
|
|
String indexName = filterVO.getIndexName();
|
|
|
- Map map = new HashMap<String,Integer>();
|
|
|
+ Map mapCode = new HashMap<String,List<String>>();
|
|
|
List<String> CTBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
List<String> operationPathologyBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
List<String> MRBehospitalCode = new CopyOnWriteArrayList<>();
|
|
@@ -892,42 +977,53 @@ public class ConsoleFacade {
|
|
|
myPool.shutdown();
|
|
|
|
|
|
if(ListUtil.isEmpty(CTBehospitalCode)){
|
|
|
- map.put("CT",Long.valueOf(0));
|
|
|
+ // map.put("CT",Long.valueOf(0));
|
|
|
+ mapCode.put("CT",null);
|
|
|
}else {
|
|
|
- map.put("CT",Long.valueOf(CTBehospitalCode.size()));
|
|
|
+ // map.put("CT",Long.valueOf(CTBehospitalCode.size()));
|
|
|
+ mapCode.put("CT",CTBehospitalCode);
|
|
|
}
|
|
|
if(ListUtil.isEmpty(MRBehospitalCode)){
|
|
|
- map.put("MR",Long.valueOf(0));
|
|
|
+ // map.put("MR",Long.valueOf(0));
|
|
|
+ mapCode.put("MR",null);
|
|
|
}else {
|
|
|
- map.put("MR",Long.valueOf(MRBehospitalCode.size()));
|
|
|
+ // map.put("MR",Long.valueOf(MRBehospitalCode.size()));
|
|
|
+ mapCode.put("MR",MRBehospitalCode);
|
|
|
}
|
|
|
if(ListUtil.isEmpty(operationBehospitalCode)){
|
|
|
- map.put("operation",Long.valueOf(0));
|
|
|
+ // map.put("operation",Long.valueOf(0));
|
|
|
+ mapCode.put("operation",null);
|
|
|
}else {
|
|
|
- map.put("operation",Long.valueOf(operationBehospitalCode.size()));
|
|
|
+ // map.put("operation",Long.valueOf(operationBehospitalCode.size()));
|
|
|
+ mapCode.put("operation",operationBehospitalCode);
|
|
|
}
|
|
|
if(ListUtil.isEmpty(operationBehospitalCode)||ListUtil.isEmpty(operationPathologyBehospitalCode)){
|
|
|
- map.put("operationPathology",Long.valueOf(0));
|
|
|
+ // map.put("operationPathology",Long.valueOf(0));
|
|
|
+ mapCode.put("operationPathology",null);
|
|
|
}else {
|
|
|
for (String operation : operationBehospitalCode) {
|
|
|
if(pathologyBehospitalCode.contains(operation)){
|
|
|
operationPathologyBehospitalCode.add(operation);
|
|
|
}
|
|
|
}
|
|
|
- map.put("operationPathology",Long.valueOf(operationPathologyBehospitalCode.size()));
|
|
|
+ // map.put("operationPathology",Long.valueOf(operationPathologyBehospitalCode.size()));
|
|
|
+ mapCode.put("operationPathology",operationBehospitalCode);
|
|
|
}
|
|
|
if(ListUtil.isEmpty(antibiosisBehospitalCode)){
|
|
|
- map.put("antibiosis",Long.valueOf(0));
|
|
|
+ // map.put("antibiosis",Long.valueOf(0));
|
|
|
+ mapCode.put("antibiosis",null);
|
|
|
}else {
|
|
|
- map.put("antibiosis",Long.valueOf(antibiosisBehospitalCode.size()));
|
|
|
+ // map.put("antibiosis",Long.valueOf(antibiosisBehospitalCode.size()));
|
|
|
+ mapCode.put("antibiosis",antibiosisBehospitalCode);
|
|
|
}
|
|
|
if(ListUtil.isEmpty(chemotherapyMalignantTumorsBehospitalCode)){
|
|
|
- map.put("chemotherapyMalignantTumors",Long.valueOf(0));
|
|
|
+ // map.put("chemotherapyMalignantTumors",Long.valueOf(0));
|
|
|
+ mapCode.put("chemotherapyMalignantTumors",null);
|
|
|
}else {
|
|
|
- map.put("chemotherapyMalignantTumors",Long.valueOf(chemotherapyMalignantTumorsBehospitalCode.size()));
|
|
|
+ // map.put("chemotherapyMalignantTumors",Long.valueOf(chemotherapyMalignantTumorsBehospitalCode.size()));
|
|
|
+ mapCode.put("chemotherapyMalignantTumors",antibiosisBehospitalCode);
|
|
|
}
|
|
|
-
|
|
|
- return map;
|
|
|
+ return mapCode;
|
|
|
}
|
|
|
}
|
|
|
/**
|