|
@@ -12,7 +12,6 @@ import com.diagbot.entity.*;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
-import com.diagbot.service.MedManagementInfoService;
|
|
|
import com.diagbot.service.MedQcresultDetailService;
|
|
|
import com.diagbot.util.*;
|
|
|
import com.diagbot.vo.*;
|
|
@@ -26,11 +25,7 @@ import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
-import java.text.DateFormat;
|
|
|
import java.text.DecimalFormat;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.time.Duration;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
@@ -66,12 +61,6 @@ public class ConsoleFacade {
|
|
|
private QcCasesEntryFacade qcCasesEntryFacade;
|
|
|
@Autowired
|
|
|
private LeaveHosStatisticsAggregate leaveHosStatisticsAggregate;
|
|
|
- @Autowired
|
|
|
- @Qualifier("medManagementInfoServiceImpl")
|
|
|
- private MedManagementInfoService medManagementInfoService;
|
|
|
- @Autowired
|
|
|
- @Qualifier("medQcresultDetailServiceImpl")
|
|
|
- private MedQcresultDetailService medQcresultDetailService;
|
|
|
|
|
|
//region-----------------------聚合接口开始-------------------------------
|
|
|
|
|
@@ -380,124 +369,7 @@ public class ConsoleFacade {
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 住院编码病案管理人员月均负担出院患者病历
|
|
|
- *
|
|
|
- * @param filterVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public MedQualityControlDTO hospitalMonthly(FilterVO filterVO) {
|
|
|
- //获取出院总人数
|
|
|
- Integer totleCount = leaveHosStatisticsAggregate.getTotleCount(filterVO);
|
|
|
- MedQualityControlDTO medQualityControlDTO = new MedQualityControlDTO();
|
|
|
- //获取病案管理人员工作
|
|
|
- List<MedManagementInfo> list = medManagementInfoService.list();
|
|
|
- String startDate = filterVO.getStartDate();
|
|
|
- String endDate = filterVO.getEndDate();
|
|
|
- DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
- LocalDateTime sta = LocalDateTime.parse(startDate, df);
|
|
|
- LocalDateTime end = LocalDateTime.parse(endDate, df);
|
|
|
- /* HashMap<String, Long> longHashMap = getTimeCount(list, sta, end);
|
|
|
- Long timeCount = longHashMap.get("病案管理");
|
|
|
- Long codingCount = longHashMap.get("编码管理");
|
|
|
- double monthlyDou = 0;
|
|
|
- double monthlyCoding = 0;*/
|
|
|
- /* try {
|
|
|
- double timeMonth = timeCount / 30;
|
|
|
- // 住院病案管理人员月均负担出院患者病历
|
|
|
- monthlyDou = (totleCount.intValue() / timeMonth);
|
|
|
- long round = Math.round(monthlyDou);
|
|
|
- String monthlyInt = String.valueOf(round);
|
|
|
- medQualityControlDTO.setManagerMouthNum(monthlyInt);
|
|
|
- //编码
|
|
|
- monthlyCoding = totleCount.intValue() / codingCount;
|
|
|
- long roundCod = Math.round(monthlyCoding);
|
|
|
- String codingInt = String.valueOf(roundCod);
|
|
|
- medQualityControlDTO.setCoderMouthNum(codingInt);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- //throw new CommonException(CommonErrorCode.NOT_EXISTS, "该病历无关联的质控条目!");
|
|
|
- }*/
|
|
|
- //入院记录24小时完成率
|
|
|
- try {
|
|
|
- HashMap<String,Double> finishingRate = admissionStr(filterVO);
|
|
|
- String admissionStrString = String.valueOf(finishingRate.get("完成率"));
|
|
|
- double admissionNumString = finishingRate.get("完成量");
|
|
|
- medQualityControlDTO.setAdmissionStr(admissionStrString);
|
|
|
- medQualityControlDTO.setAdmissionNum(admissionNumString);
|
|
|
- } catch (ParseException e) {
|
|
|
- medQualityControlDTO.setAdmissionStr("0");
|
|
|
- medQualityControlDTO.setAdmissionNum(0.0);
|
|
|
- }
|
|
|
- return medQualityControlDTO;
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 入院记录24h完成率
|
|
|
- *
|
|
|
- * @param filterVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public HashMap<String, Double> admissionStr(FilterVO filterVO) throws ParseException {
|
|
|
- filterFacade.filterVOSet(filterVO);
|
|
|
- List<NumDTO> records = behospitalInfoFacade.beHosCount(filterVO);
|
|
|
- HashMap<String, Double> stringDoubleHashMap = new HashMap<>();
|
|
|
- String start = filterVO.getStartDate();
|
|
|
- String end = filterVO.getEndDate();
|
|
|
- DateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- Date startDate = sf.parse(start);
|
|
|
- Date endDate = sf.parse(end);
|
|
|
- Integer num=null;
|
|
|
- int number=0;
|
|
|
- //获得全员住院人数
|
|
|
- if (ListUtil.isNotEmpty(records)) {
|
|
|
- num = records.stream()
|
|
|
- .map(NumDTO::getNum)
|
|
|
- .reduce(0, Integer::sum);
|
|
|
- }
|
|
|
- //查到所有经过qc端病例中不符合情况的病例
|
|
|
- QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
- queryWrapper.eq("cases_entry_id", 2658);
|
|
|
- List<MedQcresultDetail> selectList = medQcresultDetailService.getBaseMapper().selectList(queryWrapper);
|
|
|
- ArrayList<String> behospitalCodeList = new ArrayList<>();
|
|
|
- //遍历病例得到所有病人id 去查看出院 入院记录
|
|
|
- if (ListUtil.isNotEmpty(selectList)) {
|
|
|
- for (MedQcresultDetail medQcresultDetail : selectList) {
|
|
|
- String behospitalCode = medQcresultDetail.getBehospitalCode();
|
|
|
- //存在集合中以备后用
|
|
|
- behospitalCodeList.add(behospitalCode);
|
|
|
- QueryWrapper queryWrapperTpw = new QueryWrapper();
|
|
|
- queryWrapperTpw.eq("behospital_code", behospitalCode);
|
|
|
- List<BehospitalInfo> behospitalList = behospitalInfoFacade.getBaseMapper().selectList(queryWrapperTpw);
|
|
|
- if (ListUtil.isNotEmpty(behospitalList))
|
|
|
- for (BehospitalInfo behospitalInfo : behospitalList) {
|
|
|
- //入院时间
|
|
|
- Date behospitalDate = behospitalInfo.getBehospitalDate();
|
|
|
- /* //出院时间
|
|
|
- Date leaveHospitalDate = behospitalInfo.getLeaveHospitalDate();*/
|
|
|
- if(behospitalCode!=null) {
|
|
|
- if (belongCalendar(behospitalDate, startDate, endDate)) {
|
|
|
- number++;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- Double numDou = Double.valueOf(num.intValue());
|
|
|
- Double numberDou = Double.valueOf(number);
|
|
|
- //完成率为
|
|
|
- Double finishingRate= null;
|
|
|
- try {
|
|
|
- finishingRate = numberDou/ numDou;
|
|
|
- } catch (Exception e) {
|
|
|
- stringDoubleHashMap.put("完成量",0.0);
|
|
|
- stringDoubleHashMap.put("完成率",0.0);
|
|
|
- }
|
|
|
- stringDoubleHashMap.put("完成量",numberDou);
|
|
|
- stringDoubleHashMap.put("完成率",finishingRate);
|
|
|
- return stringDoubleHashMap;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 病案指标
|
|
@@ -505,148 +377,10 @@ public class ConsoleFacade {
|
|
|
* @return 2170
|
|
|
*/
|
|
|
public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO){
|
|
|
- List<MedManagementInfo> list = medManagementInfoService.list();
|
|
|
- MedQualityControlDTO medQualityControlDTOS = medManagementInfoService.medicalRecordIndicator(filterRecordVO,list);
|
|
|
+ MedQualityControlDTO medQualityControlDTOS = behospitalInfoFacade.medicalRecordIndicator(filterRecordVO);
|
|
|
return medQualityControlDTOS;
|
|
|
}
|
|
|
|
|
|
- //判断时间是否在一个时间段内
|
|
|
- public static boolean belongCalendar(Date nowTime, Date beginTime, Date endTime) {
|
|
|
- //设置当前时间
|
|
|
- Calendar date = Calendar.getInstance();
|
|
|
- date.setTime(nowTime);
|
|
|
- //设置开始时间
|
|
|
- Calendar begin = Calendar.getInstance();
|
|
|
- begin.setTime(beginTime);
|
|
|
- //设置结束时间
|
|
|
- Calendar end = Calendar.getInstance();
|
|
|
- end.setTime(endTime);
|
|
|
- //处于开始时间之后,和结束时间之前的判断
|
|
|
- if (date.after(begin) && date.before(end)) {
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /* public HashMap<String, Long> getTimeCount(List<MedManagementInfo> list, LocalDateTime sta, LocalDateTime end) {
|
|
|
- HashMap<String, Long> longHashMap = new HashMap<>();
|
|
|
- long timeCount = 0;
|
|
|
- long codingCount = 0;
|
|
|
- if (ListUtil.isNotEmpty(list)) {
|
|
|
- for (MedManagementInfo managementInfo : list) {
|
|
|
- LocalDateTime hireDate = managementInfo.getHireDate();
|
|
|
- LocalDateTime resignationTime = managementInfo.getResignationTime();
|
|
|
- //开始工作时间和离职时间均不为空
|
|
|
- if (hireDate != null && resignationTime != null) {
|
|
|
- //单位时间内开始时间大于等于工作时间且结束时间大于等于离职时间
|
|
|
- if ((sta.isAfter(hireDate) || sta.equals(hireDate)) && (end.isAfter(resignationTime) || end.equals(resignationTime))) {
|
|
|
- // 开始时间---离职时间 相差的天数
|
|
|
- Duration duration = Duration.between(sta, resignationTime);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- //单位时间内开始时间大于等于工作时间且离职时间大于等于结束时间
|
|
|
- if ((sta.isAfter(hireDate) || sta.equals(hireDate)) && (resignationTime.isAfter(end) || end.equals(resignationTime))) {
|
|
|
- // 开始时间---结束时间
|
|
|
- Duration duration = Duration.between(sta, end);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- // 开始时间< =工作时间 离职时间<=结束时间
|
|
|
- if ((hireDate.isAfter(sta) || sta.equals(hireDate)) && (end.isAfter(resignationTime) || end.equals(resignationTime))) {
|
|
|
- // 结束时间 ---离职时间
|
|
|
- Duration duration = Duration.between(hireDate, resignationTime);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- // 开始时间<=工作时间 离职时间>=结束时间
|
|
|
- if ((hireDate.isAfter(sta) || sta.equals(hireDate)) && (resignationTime.isAfter(end) || end.equals(resignationTime))) {
|
|
|
- // 工作时间---结束时间
|
|
|
- Duration duration = Duration.between(hireDate, end);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- //离职时间为空
|
|
|
- if (hireDate != null && resignationTime == null) {
|
|
|
- //开始时间<=工作时间
|
|
|
- if (hireDate.isAfter(sta) || sta.equals(hireDate)) {
|
|
|
- Duration duration = Duration.between(hireDate, end);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- // 开始时间>=工作时间
|
|
|
- if (sta.isAfter(hireDate) || sta.equals(hireDate)) {
|
|
|
- Duration duration = Duration.between(sta, end);
|
|
|
- long days = duration.toDays();
|
|
|
- //病案管理人员
|
|
|
- if (1 == managementInfo.getPosition()) {
|
|
|
- timeCount = timeCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- //病案编码管理人员
|
|
|
- if (2 == managementInfo.getPosition()) {
|
|
|
- codingCount = codingCount + days;
|
|
|
- continue;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- longHashMap.put("病案管理", timeCount);
|
|
|
- longHashMap.put("编码管理", codingCount);
|
|
|
- }
|
|
|
- return longHashMap;
|
|
|
- }*/
|
|
|
-
|
|
|
|
|
|
/**
|
|
|
* 质控病历统计
|
|
@@ -2473,71 +2207,7 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
|
|
|
return behospitalInfoFacade.hmImproveMRPage(qcResultShortPageVO);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 病案管理指标(内页)
|
|
|
- *
|
|
|
- * @param filterVO
|
|
|
- * @return
|
|
|
- */
|
|
|
- public MedQualityControlDTO getMedManageIndex(FilterVO filterVO) {
|
|
|
- Map<String, Object> baseIndex = behospitalInfoFacade.getBaseIndex(filterVO);
|
|
|
- MedQualityControlDTO medQualityControlDTO = new MedQualityControlDTO();
|
|
|
- QueryWrapper<MedManagementInfo> query = new QueryWrapper<>();
|
|
|
- query.eq("hospital_id", filterVO.getHospitalId())
|
|
|
- .eq("is_deleted", IsDeleteEnum.N)
|
|
|
- //指标1、2、3与是否归档没有直接关系 出院时间在单位时间内即可
|
|
|
- // .eq("is_placefile", filterVO.getIsPlacefile())
|
|
|
- .isNotNull("start_date")
|
|
|
- .isNotNull("end_date")
|
|
|
- .eq("start_date",filterVO.getStartDate())
|
|
|
- .eq("end_date",filterVO.getEndDate());
|
|
|
-
|
|
|
- List<MedManagementInfo> list = medManagementInfoService.list(query);
|
|
|
- //单位时间同期门诊病案管理人员实际工作总月数
|
|
|
- Double firMouth = 0d;
|
|
|
- //单位时间同期住院病案管理人员实际工作总月数
|
|
|
- Double secMouth = 0d;
|
|
|
- //单位时间同期病案编码管理人员实际工作总月数
|
|
|
- Double thrMouth = 0d;
|
|
|
- for (MedManagementInfo medManagementInfo : list) {
|
|
|
- if(medManagementInfo.getDepartment()==0){
|
|
|
- firMouth += medManagementInfo.getWorkMouth();
|
|
|
- }
|
|
|
- if(medManagementInfo.getDepartment()==1){
|
|
|
- secMouth += medManagementInfo.getWorkMouth();
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
- thrMouth = list.stream().filter(obj -> obj.getPosition() == 2).map(MedManagementInfo::getWorkMouth).reduce(Double::sum).get();
|
|
|
- Double firRecord = 0d;
|
|
|
- for (String str : baseIndex.keySet()) {
|
|
|
- if(str.equals("firMouthNum")){
|
|
|
- //指标一
|
|
|
- if(secMouth != 0d){
|
|
|
- medQualityControlDTO.setManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/secMouth));
|
|
|
- }
|
|
|
- //指标三
|
|
|
- if(thrMouth != 0d){
|
|
|
- medQualityControlDTO.setCoderMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/thrMouth));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(str.equals("secMouthNum") && firMouth != 0d){
|
|
|
- //指标二
|
|
|
- medQualityControlDTO.setSecManagerMouthNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/firMouth));
|
|
|
- }
|
|
|
-
|
|
|
- //指标二十七 -甲级病历率
|
|
|
-
|
|
|
- if(str.equals("forMouthNum")){
|
|
|
- firRecord =Double.parseDouble(baseIndex.get(str).toString());
|
|
|
- }
|
|
|
- if(str.equals("sixMouthNum") && firRecord != 0d ){
|
|
|
- medQualityControlDTO.setFirGradeNum(Math.ceil(Double.parseDouble(baseIndex.get(str).toString())/ firRecord));
|
|
|
- }
|
|
|
- }
|
|
|
- return medQualityControlDTO;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 质控核查质控评分页(内页)
|
|
@@ -2550,8 +2220,6 @@ public MedQualityControlDTO medicalRecordIndicator(FilterRecordVO filterRecordVO
|
|
|
return behospitalInfoFacade.qcCheckMRPage(qcResultShortPageVO);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- */
|
|
|
|
|
|
/**
|
|
|
* 病历稽查表导出(首页)
|