|
@@ -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-----------------------聚合接口开始-------------------------------
|
|
|
|
|
|
/**
|
|
@@ -417,6 +419,8 @@ public class ConsoleFacade {
|
|
|
Long ct = triggeringRulesMap.get("CT");
|
|
|
//MR
|
|
|
Long mr = triggeringRulesMap.get("MR");
|
|
|
+ //细菌培养
|
|
|
+ Long bacterialCulture = 0L;
|
|
|
//抗菌药物
|
|
|
Long antibiosis = 0L;
|
|
|
//恶性肿瘤化学治疗
|
|
@@ -508,6 +512,16 @@ public class ConsoleFacade {
|
|
|
hashMapArrayList.add(stringStringHashMap);
|
|
|
}
|
|
|
}
|
|
|
+ //细菌培养
|
|
|
+ if (indexName.equals(QualityContent.XJPY_JCJL_FHL)||indexName.equals(QualityContent.QB)) {
|
|
|
+ if (bacterialCultureNum != null && bacterialCulture != null) {
|
|
|
+ Map<String, String> stringStringHashMap = new LinkedHashMap<>();
|
|
|
+ stringStringHashMap.put("name", QualityContent.XJPY_JCJL_FHL);
|
|
|
+ stringStringHashMap.put("notCopiedStr", getResult(bacterialCultureNum - bacterialCulture, bacterialCultureNum));
|
|
|
+ stringStringHashMap.put("num", bacterialCultureNum.toString());
|
|
|
+ hashMapArrayList.add(stringStringHashMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
//抗菌
|
|
|
if (indexName.equals(QualityContent.KJYW_SY_FHL)||indexName.equals(QualityContent.QB)) {
|
|
|
if (antibiosisFeeNum != null && antibiosis != null) {
|
|
@@ -568,17 +582,24 @@ public class ConsoleFacade {
|
|
|
/**
|
|
|
* 病案指标数据保存
|
|
|
*
|
|
|
- * @param filterVO
|
|
|
+ * @param IndexTimeVO
|
|
|
* @return 2170
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public Boolean saveMedicaIndicator(FilterVO filterVO){
|
|
|
+ public Boolean saveMedicaIndicator(IndexTimeVO IndexTimeVO){
|
|
|
+ FilterVO filterVO = new FilterVO();
|
|
|
+ BeanUtils.copyProperties(IndexTimeVO,filterVO);
|
|
|
List<String> timeList = filterFacade.getTimeList(filterVO);
|
|
|
QueryWrapper<MedIndexResult> qw = new QueryWrapper<>();
|
|
|
qw.eq("hospital_id",filterVO.getHospitalId());
|
|
|
qw.ge("start_date",filterVO.getStartDate()+" 00:00:00");
|
|
|
qw.le("end_date", handleTime(filterVO.getEndDate()));
|
|
|
medIndexResultFacade.remove(qw);
|
|
|
+ QueryWrapper<MedIndexRelevance> qwa = new QueryWrapper<>();
|
|
|
+ qwa.eq("hospital_id",filterVO.getHospitalId());
|
|
|
+ qwa.ge("start_date",filterVO.getStartDate()+" 00:00:00");
|
|
|
+ qwa.le("end_date", handleTime(filterVO.getEndDate()));
|
|
|
+ medIndexRelevanceFacade.remove(qwa);
|
|
|
for (String startTime : timeList) {
|
|
|
filterVO.setStartDate(startTime);
|
|
|
filterVO.setEndDate( handleTime(startTime));
|
|
@@ -587,7 +608,6 @@ public class ConsoleFacade {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 病案指标数据保存
|
|
|
*
|
|
@@ -596,31 +616,97 @@ public class ConsoleFacade {
|
|
|
*/
|
|
|
public void getMedicaIndicator(FilterVO filterVO){
|
|
|
MedIndexResult medIndexResult = new MedIndexResult();
|
|
|
- Map<String, Long> selectOperationNumMap = behospitalInfoFacade.selectOperationNum(filterVO);
|
|
|
- //出院人数
|
|
|
- Long startCount = selectOperationNumMap.get(QualityContent.DISCHARGED_PATIENTS);
|
|
|
+ List<Map<String, String>> selectOperationNumMap = behospitalInfoFacade.selectOperationNum(filterVO);
|
|
|
+ Set<String> outHospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> operationCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> operationPathologyCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> antibiosisCode = new CopyOnWriteArraySet<>();
|
|
|
+ List<String> adviceVerify = adviceVerify(filterVO);
|
|
|
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;
|
|
|
+ filterVO.setFlagStr("2");
|
|
|
+ List<MedManageParamsDTO> doctorAdviceMedManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
+ Map<String, Set<String>> adviceNum = getAdviceNum(filterVO, doctorAdviceMedManageParams);
|
|
|
+ if(ListUtil.isNotEmpty(selectOperationNumMap)) {
|
|
|
+ for (Map<String, String> stringStringMap : selectOperationNumMap) {
|
|
|
+ String behospitalCode = stringStringMap.get("behospitalCode");
|
|
|
+ //出院code
|
|
|
+ outHospitalCode.add(behospitalCode);
|
|
|
+ if (Double.parseDouble(stringStringMap.get("operationFee")) > 0) {
|
|
|
+ //手术code
|
|
|
+ operationCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ if (Double.parseDouble(stringStringMap.get("operationFee")) > 0 && Double.parseDouble(stringStringMap.get("pathologyFee")) > QualityContent.pathologyFee) {
|
|
|
+ //病理code
|
|
|
+ operationPathologyCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ if (Double.parseDouble(stringStringMap.get("antibiosisFee")) > 0) {
|
|
|
+ //抗菌code
|
|
|
+ antibiosisCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ListUtil.isNotEmpty(adviceVerify)){
|
|
|
+ for (String code : adviceVerify) {
|
|
|
+ outHospitalCode.add(code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Long startCount = Long.valueOf(outHospitalCode.size());
|
|
|
+ //手术人
|
|
|
+ Set<String> operationList = adviceNum.get("operation");
|
|
|
+ if(operationList!=null&&operationList.size()>0){
|
|
|
+ for (String s : operationList) {
|
|
|
+ operationCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(operationCode.size()>0&&operationCode!=null) {
|
|
|
+ operationFeeNum = Long.valueOf(operationCode.size());
|
|
|
+ }
|
|
|
//CT人数
|
|
|
- Long CTNum = adviceNum.get("CT");
|
|
|
+ Set<String> ctList = adviceNum.get("CT");
|
|
|
+ Long CTNum=0L;
|
|
|
+ if(ctList!=null&&ctList.size()>0) {
|
|
|
+ CTNum = Long.valueOf(ctList.size());
|
|
|
+ }
|
|
|
//MR人数
|
|
|
- Long MRNum = adviceNum.get("MR");
|
|
|
+ Set<String> mrList = adviceNum.get("MR");
|
|
|
+ Long MRNum=0L;
|
|
|
+ if(mrList!=null&&mrList.size()>0) {
|
|
|
+ MRNum = Long.valueOf(mrList.size());
|
|
|
+ }
|
|
|
//手术病理人数
|
|
|
- Long operationPathologyFeeNum = selectOperationNumMap.get("operationPathologyFee");
|
|
|
- Long operationPathology = adviceNum.get("operationPathology");
|
|
|
- operationPathologyFeeNum = operationPathologyFeeNum + operationPathology;
|
|
|
+ Long operationPathologyFeeNum=0L;
|
|
|
+ Set<String> operationPathologyList = adviceNum.get("operationPathology");
|
|
|
+ if(operationPathologyList!=null&&operationPathologyList.size()>0){
|
|
|
+ for (String s : operationPathologyList) {
|
|
|
+ operationPathologyCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(operationPathologyCode.size()>0&&operationPathologyCode!=null) {
|
|
|
+ operationPathologyFeeNum = Long.valueOf(operationPathologyCode.size());
|
|
|
+ }
|
|
|
+ //细菌培养人数
|
|
|
+ Set<String> bacterialCultureList = adviceNum.get("bacterialCulture");
|
|
|
+ Long bacterialCultureNum=0L;
|
|
|
+ if(bacterialCultureList!=null&&bacterialCultureList.size()>0) {
|
|
|
+ bacterialCultureNum = Long.valueOf(bacterialCultureList.size());
|
|
|
+ }
|
|
|
//抗菌药物人数
|
|
|
- Long antibiosisFeeNum = selectOperationNumMap.get("antibiosisFee");
|
|
|
- Long antibiosisNum = adviceNum.get("antibiosis");
|
|
|
- antibiosisFeeNum = antibiosisFeeNum + antibiosisNum;
|
|
|
+ Set<String> antibiosisList = adviceNum.get("antibiosis");
|
|
|
+ if(antibiosisList!=null&&antibiosisList.size()>0) {
|
|
|
+ for (String s : antibiosisList) {
|
|
|
+ antibiosisCode.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Long antibiosisFeeNum =0L;
|
|
|
+ if(antibiosisCode.size()>0&&antibiosisCode!=null) {
|
|
|
+ antibiosisFeeNum = Long.valueOf(antibiosisCode.size());
|
|
|
+ }
|
|
|
//恶性肿瘤化学治疗人数
|
|
|
- Long chemotherapyMalignantTumorsNum = adviceNum.get("chemotherapyMalignantTumors");
|
|
|
+ Set<String> chemotherapyMalignantTumorsList = adviceNum.get("chemotherapyMalignantTumors");
|
|
|
+ Long chemotherapyMalignantTumorsNum =0L;
|
|
|
+ if(chemotherapyMalignantTumorsList!=null&&chemotherapyMalignantTumorsList.size()>0) {
|
|
|
+ chemotherapyMalignantTumorsNum=Long.valueOf(chemotherapyMalignantTumorsList.size());
|
|
|
+ }
|
|
|
//出院人数
|
|
|
if(startCount!=null){
|
|
|
medIndexResult.setAdmissionResult(Double.valueOf(startCount));
|
|
@@ -641,6 +727,10 @@ public class ConsoleFacade {
|
|
|
if (operationPathologyFeeNum != null) {
|
|
|
medIndexResult.setPathologyResult(Double.valueOf(operationPathologyFeeNum));
|
|
|
}
|
|
|
+ //细菌培养人数
|
|
|
+ if (bacterialCultureNum != null) {
|
|
|
+ medIndexResult.setGermResult(Double.valueOf(bacterialCultureNum));
|
|
|
+ }
|
|
|
//抗菌人数
|
|
|
if (antibiosisFeeNum != null ) {
|
|
|
medIndexResult.setAntibiosisResult(Double.valueOf(antibiosisFeeNum));
|
|
@@ -656,28 +746,127 @@ public class ConsoleFacade {
|
|
|
MedIndexFilterVO timeVo = new MedIndexFilterVO();
|
|
|
BeanUtils.copyProperties(filterVO,timeVo);
|
|
|
timeTrans(timeVo);
|
|
|
- Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(timeVo);
|
|
|
+ Set<String> rescueCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> bloodCode = new CopyOnWriteArraySet<>();
|
|
|
//指标二十七
|
|
|
|
|
|
- //指标十七 医师查房记录
|
|
|
+ //指标18 医师查房记录 查询直接返回 -code需要加载
|
|
|
|
|
|
- //指标十八 抢救记录
|
|
|
- rescueMethods(doctorAdviceMedManageParams,medIndexResult);
|
|
|
- //指标十九 出院患者病历2日归档
|
|
|
- getfileSecAmounts(filterVO,baseIndex,medIndexResult);
|
|
|
- //指标十四 手术记录
|
|
|
+ //指标19 抢救记录
|
|
|
+ rescueMethods(doctorAdviceMedManageParams,medIndexResult,rescueCode);
|
|
|
+ //指标20 出院患者病历2日归档
|
|
|
+ getfileSecAmounts(filterVO,medIndexResult);
|
|
|
+ //指标15 手术记录
|
|
|
medIndexResult.setOperationCompleteResult(Double.parseDouble(operationFeeNum+""));
|
|
|
- //指标十六 临床用血相关记录符合率
|
|
|
- filterVO.setFlagStr("1");
|
|
|
- List<MedManageParamsDTO> medManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
- bloodMethods(doctorAdviceMedManageParams, medManageParams,medIndexResult);
|
|
|
+ //指标17 临床用血相关记录符合率
|
|
|
+ bloodMethods(doctorAdviceMedManageParams, filterVO,medIndexResult,bloodCode);
|
|
|
medIndexResult.setHospitalId(filterVO.getHospitalId());
|
|
|
medIndexResult.setStartDate(filterVO.getStartDate());
|
|
|
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(outHospitalCode.size()>0&&outHospitalCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(4);
|
|
|
+ for (String Code : outHospitalCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ medIndexRelevance.setRelevanceType(6);
|
|
|
+ for (String Code : outHospitalCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ medIndexRelevance.setRelevanceType(7);
|
|
|
+ for (String Code : outHospitalCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(operationCode.size()>0&&operationCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(5);
|
|
|
+ for (String Code : operationCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ctList!=null&&ctList.size()>0) {
|
|
|
+ medIndexRelevance.setRelevanceType(8);
|
|
|
+ for (String CTCode : ctList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(CTCode);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(mrList!=null&&mrList.size()>0) {
|
|
|
+ medIndexRelevance.setRelevanceType(9);
|
|
|
+ for (String MrCode : mrList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(MrCode);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(operationPathologyCode.size()>0&&operationPathologyCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(10);
|
|
|
+ for (String Code : operationPathologyCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(bacterialCultureList!=null&&bacterialCultureList.size()>0) {
|
|
|
+ medIndexRelevance.setRelevanceType(11);
|
|
|
+ for (String Code : bacterialCultureList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(antibiosisCode.size()>0&&antibiosisCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(12);
|
|
|
+ for (String Code : antibiosisCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(chemotherapyMalignantTumorsList!=null&&chemotherapyMalignantTumorsList.size()>0) {
|
|
|
+ medIndexRelevance.setRelevanceType(13);
|
|
|
+ for (String Code : chemotherapyMalignantTumorsList) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(operationCode.size()>0&&operationCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(15);
|
|
|
+ for (String Code : operationCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(bloodCode.size()>0&&bloodCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(17);
|
|
|
+ for (String Code : bloodCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(outHospitalCode.size()>0&&outHospitalCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(18);
|
|
|
+ for (String Code : outHospitalCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(rescueCode.size()>0&&rescueCode!=null) {
|
|
|
+ medIndexRelevance.setRelevanceType(19);
|
|
|
+ for (String Code : rescueCode) {
|
|
|
+ medIndexRelevance.setBehospitalCode(Code);
|
|
|
+ medIndexRelevanceFacade.save(medIndexRelevance);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
/**
|
|
|
* 两数据相除得到百分比
|
|
|
* @param i
|
|
@@ -757,17 +946,18 @@ public class ConsoleFacade {
|
|
|
/**
|
|
|
* 遍历医嘱信息存入相关数据
|
|
|
*/
|
|
|
- public Map<String,Long> getAdviceNum(FilterVO filterVO,List<MedManageParamsDTO> doctorAdviceMedManageParamsList) {
|
|
|
+ public Map<String,Set<String>> getAdviceNum(FilterVO filterVO, List<MedManageParamsDTO> doctorAdviceMedManageParamsList) {
|
|
|
CopyOnWriteArrayList<MedManageParamsDTO> doctorAdviceMedManageParams = new CopyOnWriteArrayList<>(doctorAdviceMedManageParamsList);
|
|
|
String indexName = filterVO.getIndexName();
|
|
|
- Map map = new HashMap<String,Integer>();
|
|
|
- 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> antibiosisBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
- List<String> chemotherapyMalignantTumorsBehospitalCode = new CopyOnWriteArrayList<>();
|
|
|
+ Map mapCode = new HashMap<String,List<String>>();
|
|
|
+ Set<String> CTBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> operationPathologyBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> MRBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> operationBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> pathologyBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> bacterialCultureCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> antibiosisBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
+ Set<String> chemotherapyMalignantTumorsBehospitalCode = new CopyOnWriteArraySet<>();
|
|
|
//无首页code
|
|
|
List<String> behospitalCodeList = adviceVerify(filterVO);
|
|
|
//首页为肿瘤code
|
|
@@ -859,6 +1049,14 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //细菌培养
|
|
|
+ if (indexName.equals(QualityContent.XJPY_JCJL_FHL) || indexName.equals(QualityContent.QB)) {
|
|
|
+ if(!bacterialCultureCode.contains(behospitalCode)){
|
|
|
+ if(daItemName.contains(QualityContent.BACTERIAL_CULTURE)){
|
|
|
+ bacterialCultureCode.add(behospitalCode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//获取为长期医嘱或临时医嘱的医嘱
|
|
@@ -891,43 +1089,48 @@ public class ConsoleFacade {
|
|
|
}finally {
|
|
|
myPool.shutdown();
|
|
|
|
|
|
- if(ListUtil.isEmpty(CTBehospitalCode)){
|
|
|
- map.put("CT",Long.valueOf(0));
|
|
|
+ if(CTBehospitalCode !=null && CTBehospitalCode.size()>0){
|
|
|
+ mapCode.put("CT",CTBehospitalCode);
|
|
|
}else {
|
|
|
- map.put("CT",Long.valueOf(CTBehospitalCode.size()));
|
|
|
+ mapCode.put("CT",null);
|
|
|
}
|
|
|
- if(ListUtil.isEmpty(MRBehospitalCode)){
|
|
|
- map.put("MR",Long.valueOf(0));
|
|
|
+ if(MRBehospitalCode!=null && MRBehospitalCode.size()>0){
|
|
|
+ mapCode.put("MR",MRBehospitalCode);
|
|
|
}else {
|
|
|
- map.put("MR",Long.valueOf(MRBehospitalCode.size()));
|
|
|
+ mapCode.put("MR",null);
|
|
|
}
|
|
|
- if(ListUtil.isEmpty(operationBehospitalCode)){
|
|
|
- map.put("operation",Long.valueOf(0));
|
|
|
+ if(operationBehospitalCode!=null && operationBehospitalCode.size()>0){
|
|
|
+ mapCode.put("operation",operationBehospitalCode);
|
|
|
}else {
|
|
|
- map.put("operation",Long.valueOf(operationBehospitalCode.size()));
|
|
|
+ mapCode.put("operation",null);
|
|
|
}
|
|
|
- if(ListUtil.isEmpty(operationBehospitalCode)||ListUtil.isEmpty(operationPathologyBehospitalCode)){
|
|
|
- map.put("operationPathology",Long.valueOf(0));
|
|
|
- }else {
|
|
|
+ if((operationBehospitalCode!=null)&&(pathologyBehospitalCode!=null&&pathologyBehospitalCode.size()>0)){
|
|
|
for (String operation : operationBehospitalCode) {
|
|
|
if(pathologyBehospitalCode.contains(operation)){
|
|
|
operationPathologyBehospitalCode.add(operation);
|
|
|
}
|
|
|
}
|
|
|
- map.put("operationPathology",Long.valueOf(operationPathologyBehospitalCode.size()));
|
|
|
+ mapCode.put("operationPathology",operationPathologyBehospitalCode);
|
|
|
+ }else {
|
|
|
+ mapCode.put("operationPathology",null);
|
|
|
}
|
|
|
- if(ListUtil.isEmpty(antibiosisBehospitalCode)){
|
|
|
- map.put("antibiosis",Long.valueOf(0));
|
|
|
+ if(bacterialCultureCode!=null && bacterialCultureCode.size()>0){
|
|
|
+ mapCode.put("bacterialCulture",bacterialCultureCode);
|
|
|
+
|
|
|
}else {
|
|
|
- map.put("antibiosis",Long.valueOf(antibiosisBehospitalCode.size()));
|
|
|
+ mapCode.put("bacterialCulture",null);
|
|
|
}
|
|
|
- if(ListUtil.isEmpty(chemotherapyMalignantTumorsBehospitalCode)){
|
|
|
- map.put("chemotherapyMalignantTumors",Long.valueOf(0));
|
|
|
+ if(antibiosisBehospitalCode!=null && antibiosisBehospitalCode.size()>0){
|
|
|
+ mapCode.put("antibiosis",antibiosisBehospitalCode);
|
|
|
}else {
|
|
|
- map.put("chemotherapyMalignantTumors",Long.valueOf(chemotherapyMalignantTumorsBehospitalCode.size()));
|
|
|
+ mapCode.put("antibiosis",null);
|
|
|
}
|
|
|
-
|
|
|
- return map;
|
|
|
+ if(antibiosisBehospitalCode!=null && antibiosisBehospitalCode.size()>0){
|
|
|
+ mapCode.put("chemotherapyMalignantTumors",antibiosisBehospitalCode);
|
|
|
+ }else {
|
|
|
+ mapCode.put("chemotherapyMalignantTumors",null);
|
|
|
+ }
|
|
|
+ return mapCode;
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
@@ -2772,14 +2975,19 @@ public class ConsoleFacade {
|
|
|
|
|
|
//指标十八 抢救记录
|
|
|
private List<Map<String, String>> rescueMethod( Map<String, Double> medManageParams, List<Map<String, String>> retList,Map<String, Long> triggeringRulesMap){
|
|
|
+ LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
//接受抢救的质控病历总数
|
|
|
double count = medManageParams.get("rescue_result");
|
|
|
String num = null;
|
|
|
if(StringUtils.isNotEmpty(String.valueOf(count)) && count != 0d){
|
|
|
double rescueDo = currencyCal(count, triggeringRulesMap.get("rescueNum"));
|
|
|
num = String.valueOf(rescueDo);
|
|
|
+ if(rescueDo<0d){
|
|
|
+ num = null;
|
|
|
+ }
|
|
|
+ firMap.put("num",String.valueOf(count));
|
|
|
};
|
|
|
- LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
+
|
|
|
firMap.put("name","患者抢救记录及时完成率");
|
|
|
firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
|
|
|
retList.add(firMap);
|
|
@@ -2788,12 +2996,16 @@ public class ConsoleFacade {
|
|
|
|
|
|
//指标十七 医师查房记录
|
|
|
private List<Map<String, String>> WardRoundMethod( List<Map<String, String>> retList, Map<String, Object> baseIndex, Map<String, Long> triggeringRulesMap){
|
|
|
+ LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
String num = null;
|
|
|
if( triggeringRulesMap.containsKey("WardRoundNum") && baseIndex.containsKey("forWorkNum") && !baseIndex.get("forWorkNum").toString().equals("0")){
|
|
|
double wardRoundDo = currencyCal(baseIndex.get("forWorkNum"), triggeringRulesMap.get("WardRoundNum"));
|
|
|
num = String.valueOf(wardRoundDo);
|
|
|
+ if(wardRoundDo<0d){
|
|
|
+ num = null;
|
|
|
+ }
|
|
|
+ firMap.put("num",baseIndex.get("forWorkNum").toString());
|
|
|
};
|
|
|
- LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
firMap.put("name","医师查房记录完成率");
|
|
|
firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
|
|
|
retList.add(firMap);
|
|
@@ -2802,30 +3014,42 @@ public class ConsoleFacade {
|
|
|
|
|
|
//指标十四 手术记录
|
|
|
private List<Map<String, String>> operationMethod(Map<String, Double> medManageParams, List<Map<String, String>>retList, Map<String, Long> triggeringRulesMap){
|
|
|
+ LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
String operationFeeNum = medManageParams.get("operationFeeNum")+"";
|
|
|
String num = null;
|
|
|
if( triggeringRulesMap.containsKey("operationRecordNum") && StringUtils.isNotEmpty(operationFeeNum) && ! operationFeeNum.equals("0")){
|
|
|
double operationRecordDo = currencyCal(operationFeeNum, triggeringRulesMap.get("operationRecordNum"));
|
|
|
num = String.valueOf(operationRecordDo);
|
|
|
+ if(operationRecordDo<0d){
|
|
|
+ num = null;
|
|
|
+ }
|
|
|
+ firMap.put("num",operationFeeNum);
|
|
|
};
|
|
|
- LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
firMap.put("name","手术相关记录完成率");
|
|
|
+ if("0.0".equals(num)){
|
|
|
+ num = "0.00";
|
|
|
+ }
|
|
|
firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
|
|
|
+
|
|
|
retList.add(firMap);
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
//指标十六 临床用血相关记录符合率
|
|
|
private List<Map<String, String>> bloodMethod( List<Map<String, String>>retList,Map<String, Double> bloodRes,Map<String, Long> triggeringRulesMap){
|
|
|
-
|
|
|
+ LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
double count = bloodRes.get("blood_result");
|
|
|
String num = null;
|
|
|
if(StringUtils.isNotEmpty(String.valueOf(count)) && count != 0d){
|
|
|
//指标十七
|
|
|
- double rescueDo = currencyCal(count, triggeringRulesMap.get("bloodNum"));
|
|
|
- num = String.valueOf(rescueDo);
|
|
|
+ double bloodDo = currencyCal(count, triggeringRulesMap.get("bloodNum"));
|
|
|
+ num = String.valueOf(bloodDo);
|
|
|
+ if(bloodDo<0d){
|
|
|
+ num = null;
|
|
|
+ }
|
|
|
+ firMap.put("num",String.valueOf(count));
|
|
|
}
|
|
|
- LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
+
|
|
|
firMap.put("name","临床用血相关记录符合率");
|
|
|
firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
|
|
|
retList.add(firMap);
|
|
@@ -2845,15 +3069,17 @@ public class ConsoleFacade {
|
|
|
|
|
|
//指标十九 出院患者病历2日归档
|
|
|
private List<Map<String, String>> getfileSecAmount(Map<String, Double> medManageParams, List<Map<String, String>>retList, Map<String, Object> baseIndex){
|
|
|
+ LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
double count = medManageParams.get("sec_file_result");
|
|
|
String num = null;
|
|
|
- if(StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString()) && ! baseIndex.get("firWorkNum").toString().equals("0") ){
|
|
|
- double retNum =count* 100/Double.parseDouble(baseIndex.get("firWorkNum").toString());
|
|
|
+ if(StringUtils.isNotEmpty( baseIndex.get("sevenWorkNum").toString()) && ! baseIndex.get("sevenWorkNum").toString().equals("0") ){
|
|
|
+ double retNum =count* 100/Double.parseDouble(baseIndex.get("sevenWorkNum").toString());
|
|
|
double firGradeStr = Double.parseDouble(df.format(retNum));
|
|
|
num = String.valueOf(firGradeStr);
|
|
|
+ firMap.put("num",baseIndex.get("sevenWorkNum").toString());
|
|
|
}
|
|
|
- LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
+
|
|
|
firMap.put("name","出院患者病历2日归档率");
|
|
|
firMap.put("notCopiedStr",StringUtils.isEmpty(num) ? "0.00%":(num+"%"));
|
|
|
retList.add(firMap);
|
|
@@ -2880,10 +3106,13 @@ public class ConsoleFacade {
|
|
|
if(secOp.isPresent()){
|
|
|
secMouth = secOp.get();
|
|
|
}
|
|
|
+ if(secMouth == 0d){
|
|
|
+ secMouth = 5d;
|
|
|
+ }
|
|
|
//指标一
|
|
|
String num1 = "0";
|
|
|
if(secMouth != 0d && secMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
|
|
|
- num1 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString()) / secMouth));
|
|
|
+ num1 = String.valueOf(Math.round(Double.parseDouble(baseIndex.get("firWorkNum").toString()) / secMouth));
|
|
|
}
|
|
|
LinkedHashMap<String, String> firMap = new LinkedHashMap<>();
|
|
|
firMap.put("name","住院病案管理人员月均负担出院患者病历数");
|
|
@@ -2898,10 +3127,13 @@ public class ConsoleFacade {
|
|
|
if(firOp.isPresent()){
|
|
|
firMouth = firOp.get();
|
|
|
}
|
|
|
+ if(firMouth == 0d){
|
|
|
+ firMouth = 5d;
|
|
|
+ }
|
|
|
String num3 = "0";
|
|
|
if(firMouth != 0d && firMouth != null && StringUtils.isNotEmpty( baseIndex.get("secWorkNum").toString())){
|
|
|
//指标二
|
|
|
- num3 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("secWorkNum").toString())/firMouth));
|
|
|
+ num3 = String.valueOf(Math.round(Double.parseDouble(baseIndex.get("secWorkNum").toString())/firMouth));
|
|
|
}
|
|
|
LinkedHashMap<String, String> thrMap = new LinkedHashMap<>();
|
|
|
thrMap.put("name","门诊病案管理人员月均负担门诊患者病历数");
|
|
@@ -2916,11 +3148,13 @@ public class ConsoleFacade {
|
|
|
if(thrOp.isPresent()){
|
|
|
thrMouth = thrOp.get();
|
|
|
}
|
|
|
-
|
|
|
+ if(thrMouth == 0d){
|
|
|
+ thrMouth = 5d;
|
|
|
+ }
|
|
|
//指标三
|
|
|
String num2 = "0";
|
|
|
if(thrMouth != 0d && thrMouth != null && StringUtils.isNotEmpty( baseIndex.get("firWorkNum").toString())){
|
|
|
- num2 = String.valueOf(Math.ceil(Double.parseDouble(baseIndex.get("firWorkNum").toString())/thrMouth));
|
|
|
+ num2 = String.valueOf(Math.round(Double.parseDouble(baseIndex.get("firWorkNum").toString())/thrMouth));
|
|
|
|
|
|
}
|
|
|
LinkedHashMap<String, String> secMap = new LinkedHashMap<>();
|
|
@@ -2936,6 +3170,7 @@ public class ConsoleFacade {
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
if(indexName.equals(QualityContent.JJBLL)||indexName.equals(QualityContent.QB)) {
|
|
|
//指标二十七 -甲级病历率
|
|
|
+ LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
|
|
|
Double firRecord = 0d;
|
|
|
String num4= null;
|
|
|
if(StringUtils.isNotEmpty( baseIndex.get("forWorkNum").toString())){
|
|
@@ -2944,9 +3179,9 @@ public class ConsoleFacade {
|
|
|
if( firRecord != 0d && StringUtils.isNotEmpty( baseIndex.get("sixWorkNum").toString()) ){
|
|
|
double retNum = Double.parseDouble(baseIndex.get("sixWorkNum").toString()) * 100 / firRecord;
|
|
|
double firGradeStr = Double.parseDouble(df.format(retNum));
|
|
|
- num4 = String.valueOf(Math.ceil(firGradeStr));
|
|
|
+ num4 = String.valueOf(firGradeStr);
|
|
|
+ fouMap.put("num",String.valueOf(firRecord));
|
|
|
}
|
|
|
- LinkedHashMap<String, String> fouMap = new LinkedHashMap<>();
|
|
|
fouMap.put("name","甲级病历率");
|
|
|
fouMap.put("notCopiedStr",StringUtils.isEmpty(num4) ? "0.00%":(num4+"%"));
|
|
|
retList.add(fouMap);
|
|
@@ -2958,8 +3193,8 @@ public class ConsoleFacade {
|
|
|
/**
|
|
|
* ==============================后台维护===============================
|
|
|
*/
|
|
|
- //指标十八 抢救记录
|
|
|
- private void rescueMethods(List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult){
|
|
|
+ //指标19 抢救记录
|
|
|
+ private void rescueMethods(List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult, Set<String> rescueCode){
|
|
|
List<MedManageParamsDTO> manageList= new ArrayList<>();
|
|
|
List<String> rescueDrugList = QualityContent.RESCUEDRUGLIST;
|
|
|
for (int i = 0; i < medManageParams.size(); i++) {
|
|
@@ -2967,12 +3202,12 @@ public class ConsoleFacade {
|
|
|
String doctorAdviceType = medManageParams.get(i).getDoctorAdviceType();
|
|
|
String da_status = medManageParams.get(i).getDaStatus();
|
|
|
for (String str : rescueDrugList) {
|
|
|
- if(StringUtils.isNotEmpty(daItemName) && daItemName.contains(str) && StringUtils.isNotEmpty(doctorAdviceType) && doctorAdviceType.equals(QualityContent.STAT_ORDER) && (StringUtils.isEmpty(da_status) || (StringUtils.isNotEmpty(da_status) && ! doctorAdviceType.equals(QualityContent.CANCELLATION_ORDER)))){
|
|
|
+ if(StringUtils.isNotEmpty(daItemName) && daItemName.contains(str) && StringUtils.isNotEmpty(doctorAdviceType) && doctorAdviceType.equals(QualityContent.STAT_ORDER) && (StringUtils.isEmpty(da_status) || (StringUtils.isNotEmpty(da_status) && ! da_status.equals(QualityContent.CANCELLATION_ORDER)))){
|
|
|
manageList.add(medManageParams.get(i));
|
|
|
+ rescueCode.add(medManageParams.get(i).getBehospitalCode());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
//接受抢救的质控病历总数
|
|
|
double count = manageList.stream().map(MedManageParamsDTO::getBehospitalCode).distinct().count();
|
|
|
if(StringUtils.isNotEmpty(String.valueOf(count)) && count != 0d){
|
|
@@ -2980,8 +3215,10 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //指标十六 临床用血相关记录符合率
|
|
|
- private void bloodMethods(List<MedManageParamsDTO> doctorAdviceList, List<MedManageParamsDTO> medManageParams,MedIndexResult medIndexResult){
|
|
|
+ //指标17 临床用血相关记录符合率
|
|
|
+ private void bloodMethods(List<MedManageParamsDTO> doctorAdviceList,FilterVO filterVO,MedIndexResult medIndexResult, Set<String> bloodCode){
|
|
|
+ filterVO.setFlagStr("1");
|
|
|
+ List<MedManageParamsDTO> medManageParams = behospitalInfoFacade.getMedManageParams(filterVO);
|
|
|
Set<String> manageList= new CopyOnWriteArraySet<>();
|
|
|
List<String> blood_list = QualityContent.BLOODLIST;
|
|
|
//lis项目存在用血住院病历号
|
|
@@ -2996,10 +3233,10 @@ public class ConsoleFacade {
|
|
|
doctorAdviceList.parallelStream()
|
|
|
.filter(obj -> beCode.contains(obj.getBehospitalCode()) && obj.getDoctorAdviceType()
|
|
|
.equals(QualityContent.STAT_ORDER) && blood_list.contains(obj.getDaItemName()) &&
|
|
|
- (StringUtils.isEmpty(obj.getDaStatus())) || (StringUtils.isNotEmpty(obj.getDaStatus()) && ! obj.getDaStatus()
|
|
|
- .equals(QualityContent.CANCELLATION_ORDER)))
|
|
|
+ (StringUtils.isEmpty(obj.getDaStatus()) || (StringUtils.isNotEmpty(obj.getDaStatus()) && ! obj.getDaStatus()
|
|
|
+ .equals(QualityContent.CANCELLATION_ORDER))))
|
|
|
.distinct()
|
|
|
- .map(obj -> manageList.add(obj.getBehospitalCode()))
|
|
|
+ .map(obj -> {manageList.add(obj.getBehospitalCode());return bloodCode.add(obj.getBehospitalCode());})
|
|
|
.collect(Collectors.toList());
|
|
|
long xx3= System.currentTimeMillis();
|
|
|
System.out.println("advice体现lis项目存在用血的住院病历号 = " + (xx3-xx2));
|
|
@@ -3013,8 +3250,8 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
|
|
|
|
|
|
- //指标十九 出院患者病历2日归档
|
|
|
- private void getfileSecAmounts(FilterVO filterVO,Map<String, Object> baseIndex,MedIndexResult medIndexResult){
|
|
|
+ //指标20 出院患者病历2日归档
|
|
|
+ private void getfileSecAmounts(FilterVO filterVO,MedIndexResult medIndexResult){
|
|
|
QueryWrapper<BehospitalInfo> query = new QueryWrapper<>();
|
|
|
DecimalFormat df = new DecimalFormat("#0.00");
|
|
|
query.eq("hospital_id", filterVO.getHospitalId())
|
|
@@ -3029,7 +3266,7 @@ public class ConsoleFacade {
|
|
|
Iterator<BehospitalInfo> iterator = list.iterator();
|
|
|
while (iterator.hasNext()){
|
|
|
BehospitalInfo beh = iterator.next();
|
|
|
- Boolean flag = getTrueSecFile(beh.getLeaveHospitalDate(), beh.getPlacefileDate(), TimeContent.getHolidaysTimeList());
|
|
|
+ Boolean flag = getTrueSecFile(beh.getLeaveHospitalDate(), beh.getPlacefileDate(), TimeContent.HolidaysTimeList);
|
|
|
//时间截止则删除元素
|
|
|
if(!flag){
|
|
|
iterator.remove();
|
|
@@ -3043,6 +3280,9 @@ public class ConsoleFacade {
|
|
|
}
|
|
|
|
|
|
private Boolean getTrueSecFile(Date date1,Date date2, List<String> holidaysTimeList){
|
|
|
+ if(date1.after(date2)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
Date date = date1;
|
|
|
Date dateSec = date2;
|
|
|
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
@@ -3077,19 +3317,6 @@ public class ConsoleFacade {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- private void firMethods(String indexName, Map<String, Object> baseIndex, MedIndexResult medIndexResult){
|
|
|
- DecimalFormat df = new DecimalFormat("0.00");
|
|
|
- //指标二十七 -甲级病历率
|
|
|
- Double firRecord = 0d;
|
|
|
- if(StringUtils.isNotEmpty( baseIndex.get("forWorkNum").toString())){
|
|
|
- firRecord =Double.parseDouble(baseIndex.get("forWorkNum").toString());
|
|
|
- }
|
|
|
- if( firRecord != 0d && StringUtils.isNotEmpty( baseIndex.get("sixWorkNum").toString()) ){
|
|
|
- double retNum = Double.parseDouble(baseIndex.get("sixWorkNum").toString()) * 100 / firRecord;
|
|
|
- double firGradeStr = Double.parseDouble(df.format(retNum));
|
|
|
- medIndexResult.setFirRecordResult(firGradeStr);
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
private void timeTrans( MedIndexFilterVO filterVO){
|
|
|
SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd");
|