|
@@ -37,6 +37,9 @@ import java.text.SimpleDateFormat;
|
|
|
import java.time.*;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.CopyOnWriteArrayList;
|
|
|
+import java.util.concurrent.ExecutionException;
|
|
|
+import java.util.concurrent.ForkJoinPool;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static io.netty.util.internal.SystemPropertyUtil.contains;
|
|
@@ -449,24 +452,25 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
if (QualityContent.NEED_MEDICAL_ADVICE.contains(indexName)) {
|
|
|
filterVO.setFlagStr("2");
|
|
|
- // List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
- // Map<String, Integer> operationPathologyNumMap = getOperationPathologyNum(filterVO, doctorAdviceMedManageParams);
|
|
|
- Map<String, Long> adviceNum = getAdviceNum(filterVO);
|
|
|
+ List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
+ Map<String, Long> adviceNum = null;
|
|
|
+ try {
|
|
|
+ adviceNum = getAdviceNum(filterVO,doctorAdviceMedManageParams);
|
|
|
+ } catch (ExecutionException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
//手术人数
|
|
|
Long operationFeeNum = selectOperationNumMap.get("operationFee");
|
|
|
- // Integer operationNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION);
|
|
|
Long operation = adviceNum.get("operation");
|
|
|
operationFeeNum = operationFeeNum + operation;
|
|
|
- // Map<String, Long> longMap = getCTNum(doctorAdviceMedManageParams);
|
|
|
//CT人数
|
|
|
- // Long CTNum = longMap.get("CT");
|
|
|
Long CTNum = adviceNum.get("CT");
|
|
|
//MR人数
|
|
|
- // Long MRNum = longMap.get("MR");
|
|
|
Long MRNum = adviceNum.get("MR");
|
|
|
//手术病理人数
|
|
|
Long operationPathologyFeeNum = selectOperationNumMap.get("operationPathologyFee");
|
|
|
- // Integer operationPathologyNum = operationPathologyNumMap.get(QualityContent.NO_RECORD_OPERATION_PATHOLOGY);
|
|
|
Long operationPathology = adviceNum.get("operationPathology");
|
|
|
operationPathologyFeeNum = operationPathologyFeeNum + operationPathology;
|
|
|
//手术记录完成率
|
|
@@ -583,68 +587,13 @@ public class ConsoleFacade {
|
|
|
*/
|
|
|
public List<String> adviceVerify(FilterVO filterVO){
|
|
|
List<Map<String, String>> medicalRecords = behospitalInfoFacade.getMedicalRecords(filterVO);
|
|
|
- List<String> behospitalCodeList = new ArrayList<>();
|
|
|
+ List<String> behospitalCodeList = new CopyOnWriteArrayList<>();
|
|
|
for (Map<String, String> medicalRecord : medicalRecords) {
|
|
|
String behospitalCode = medicalRecord.get("behospital_code");
|
|
|
behospitalCodeList.add(behospitalCode);
|
|
|
}
|
|
|
return behospitalCodeList;
|
|
|
}
|
|
|
- /**
|
|
|
- * 医嘱表判断无病案首页是否为手术患者
|
|
|
- */
|
|
|
-/* public List<String> getOperationNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
|
|
|
- List<String> behospitalCodeList = adviceVerify(filterVO);
|
|
|
- ArrayList<String> stringList = new ArrayList<>();
|
|
|
- if(ListUtil.isNotEmpty(behospitalCodeList)&&behospitalCodeList.size()>0) {
|
|
|
- for (String behospitalCode : behospitalCodeList) {
|
|
|
- //手术
|
|
|
- for (MedManageParamsDTO doctorAdviceMedManageParam : doctorAdviceMedManageParams) {
|
|
|
- if (doctorAdviceMedManageParam.getBehospitalCode().equals(behospitalCode)) {
|
|
|
- String name = doctorAdviceMedManageParam.getDaItemName();
|
|
|
- if (StringUtil.isNotEmpty(name)) {
|
|
|
- String[][] operationList = QualityContent.OPERATION_LIST;
|
|
|
- Boolean stair = stairCondition(name, operationList);
|
|
|
- if(stair) {
|
|
|
- String[][] operationArg = QualityContent.OPERATION_ARG;
|
|
|
- Boolean levelCondition = secondLevelCondition(name, operationArg);
|
|
|
- if (levelCondition) {
|
|
|
- stringList.add(behospitalCode);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return stringList;
|
|
|
- }*/
|
|
|
- /**
|
|
|
- * 医嘱表判断无病案首页为手术患者的前提下判断是否为病理手术患者
|
|
|
- */
|
|
|
-/* public Map<String,Integer> getOperationPathologyNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParams){
|
|
|
- Map<String, Integer> map = new HashMap<>();
|
|
|
- List<String> operationBehospitalCode = getOperationNum(filterVO, doctorAdviceMedManageParams);
|
|
|
- int operationPathologyNum=0;
|
|
|
- int operationNum=operationBehospitalCode.size();
|
|
|
- for (String behospitalCode : operationBehospitalCode) {
|
|
|
- for (MedManageParamsDTO doctorAdviceMedManage : doctorAdviceMedManageParams) {
|
|
|
- if (doctorAdviceMedManage.getBehospitalCode().equals(behospitalCode)) {
|
|
|
- String Name = doctorAdviceMedManage.getDaItemName();
|
|
|
- Boolean condition = stairCondition(Name, QualityContent.BL_LIST);
|
|
|
- if (condition) {
|
|
|
- operationPathologyNum++;
|
|
|
- break ;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- map.put(QualityContent.NO_RECORD_OPERATION_PATHOLOGY,operationPathologyNum);
|
|
|
- map.put(QualityContent.NO_RECORD_OPERATION,operationNum);
|
|
|
- return map;
|
|
|
- }*/
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 医嘱二级条件判断 或且
|
|
@@ -695,16 +644,18 @@ public class ConsoleFacade {
|
|
|
/**
|
|
|
* 遍历医嘱信息存入相关数据
|
|
|
*/
|
|
|
- public Map<String,Long> getAdviceNum(FilterVO filterVO){
|
|
|
+ public Map<String,Long> getAdviceNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParamsList) throws ExecutionException, InterruptedException {
|
|
|
+ CopyOnWriteArrayList<MedManageParamsDTO> doctorAdviceMedManageParams = new CopyOnWriteArrayList<>(doctorAdviceMedManageParamsList);
|
|
|
Map map = new HashMap<String,Integer>();
|
|
|
- List<String> CTBehospitalCode = new ArrayList<>();
|
|
|
- List<String> operationPathologyBehospitalCode = new ArrayList<>();
|
|
|
- List<String> MRBehospitalCode = new ArrayList<>();
|
|
|
- List<String> operationBehospitalCode = new ArrayList<>();
|
|
|
- List<String> pathologyBehospitalCode = new ArrayList<>();
|
|
|
+ List<String> CTBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
+ List<String> operationPathologyBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
+ List<String> MRBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
+ List<String> operationBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
+ List<String> pathologyBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
List<String> behospitalCodeList = adviceVerify(filterVO);
|
|
|
- List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
- for (MedManageParamsDTO adviceMedManageParam : doctorAdviceMedManageParams) {
|
|
|
+ ForkJoinPool myPool = new ForkJoinPool(4);
|
|
|
+ myPool.submit(() ->
|
|
|
+ doctorAdviceMedManageParams.parallelStream().forEach(adviceMedManageParam->{
|
|
|
String daItemName = adviceMedManageParam.getDaItemName();
|
|
|
String behospitalCode = adviceMedManageParam.getBehospitalCode();
|
|
|
String doctorAdviceType = adviceMedManageParam.getDoctorAdviceType();
|
|
@@ -730,7 +681,6 @@ public class ConsoleFacade {
|
|
|
pathologyBehospitalCode.add(behospitalCode);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
//得到为临时医嘱
|
|
|
if (StringUtil.isNotEmpty(doctorAdviceType)) {
|
|
@@ -762,9 +712,9 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
-
|
|
|
+ })).get();
|
|
|
+ myPool.shutdown();
|
|
|
for (String operation : operationBehospitalCode) {
|
|
|
if(pathologyBehospitalCode.contains(operation)){
|
|
|
operationPathologyBehospitalCode.add(operation);
|
|
@@ -793,73 +743,7 @@ public class ConsoleFacade {
|
|
|
|
|
|
return map;
|
|
|
}
|
|
|
- /**
|
|
|
- * 获取CT/MRI人数
|
|
|
- */
|
|
|
- /* public Map<String,Long> getCTNum( List<MedManageParamsDTO> doctorAdviceMedManageParams){
|
|
|
- Map<String, Long> map = new HashMap<>();
|
|
|
- List<String> codeList = new ArrayList<>();
|
|
|
- ArrayList<String> codeMri = new ArrayList<>();
|
|
|
- for (MedManageParamsDTO doctorAdviceMedManageParam : doctorAdviceMedManageParams) {
|
|
|
- String behospitalCode = doctorAdviceMedManageParam.getBehospitalCode();
|
|
|
- if (!codeList.contains(behospitalCode)) {
|
|
|
- String doctorAdviceType = doctorAdviceMedManageParam.getDoctorAdviceType();
|
|
|
- if(StringUtil.isNotEmpty(doctorAdviceType)) {
|
|
|
- if(doctorAdviceType.equals(QualityContent.STAT_ORDER)){
|
|
|
- String daItemName = doctorAdviceMedManageParam.getDaItemName();
|
|
|
- if (StringUtil.isNotEmpty(daItemName)) {
|
|
|
- String[][] ctList = QualityContent.CT_LIST;
|
|
|
- Boolean stair = stairCondition(daItemName, ctList);
|
|
|
- if (stair) {
|
|
|
- String[][] ctRegulation = QualityContent.CT_REGULATION;
|
|
|
- Boolean levelCondition = secondLevelCondition(daItemName, ctRegulation);
|
|
|
- if (levelCondition) {
|
|
|
- codeList.add(behospitalCode);
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (MedManageParamsDTO doctorAdviceMedManageParam : doctorAdviceMedManageParams) {
|
|
|
- String behospitalCodeMri = doctorAdviceMedManageParam.getBehospitalCode();
|
|
|
- if (!codeMri.contains(behospitalCodeMri)) {
|
|
|
- String doctorAdviceType = doctorAdviceMedManageParam.getDoctorAdviceType();
|
|
|
- if(StringUtil.isNotEmpty(doctorAdviceType)) {
|
|
|
- if(doctorAdviceType.equals(QualityContent.STAT_ORDER)) {
|
|
|
- String daItemName = doctorAdviceMedManageParam.getDaItemName();
|
|
|
- if (StringUtil.isNotEmpty(daItemName)) {
|
|
|
- String[][] mrList = QualityContent.MR_LIST;
|
|
|
- Boolean stair = stairCondition(daItemName, mrList);
|
|
|
- if (stair) {
|
|
|
- String[][] mrRegulation = QualityContent.MR_REGULATION;
|
|
|
- Boolean levelCondition = secondLevelCondition(daItemName, mrRegulation);
|
|
|
- if (levelCondition) {
|
|
|
- codeMri.add(behospitalCodeMri);
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(ListUtil.isEmpty(codeList)){
|
|
|
- map.put("CT",Long.valueOf(0));
|
|
|
- }else {
|
|
|
- map.put("CT",Long.valueOf(codeList.size()));
|
|
|
- }
|
|
|
- if(ListUtil.isEmpty(codeMri)){
|
|
|
- map.put("MR",Long.valueOf(0));
|
|
|
- }else {
|
|
|
- map.put("MR",Long.valueOf(codeMri.size()));
|
|
|
- }
|
|
|
|
|
|
- return map;
|
|
|
- }*/
|
|
|
|
|
|
/**
|
|
|
* 获取无病案首页抗菌药物使用人数
|