|
@@ -12,10 +12,10 @@ import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class CaseFrontSheetAnalyzeService {
|
|
|
- private final RedisLikeService redis;
|
|
|
- private final CaseFrontSheetAnalyzeDao dao;
|
|
|
private static final int TOTAL_BED_COUNT = 771;
|
|
|
private static final List<String> ABOVE_GRADE_FOUR = Arrays.asList("1", "2", "3");
|
|
|
+ private final RedisLikeService redis;
|
|
|
+ private final CaseFrontSheetAnalyzeDao dao;
|
|
|
|
|
|
@Autowired
|
|
|
public CaseFrontSheetAnalyzeService(RedisLikeService redis, CaseFrontSheetAnalyzeDao dao) {
|
|
@@ -133,19 +133,25 @@ public class CaseFrontSheetAnalyzeService {
|
|
|
if (null == bednum || bednum <= 0) {
|
|
|
sheetQuality.setBedTurnoverTimes("未维护科室床位数,无法计算。");
|
|
|
} else {
|
|
|
- sheetQuality.setBedTurnoverTimes(String.valueOf(sourceSize/TOTAL_BED_COUNT));
|
|
|
+ sheetQuality.setBedTurnoverTimes(String.valueOf(sourceSize / TOTAL_BED_COUNT));
|
|
|
}
|
|
|
- int diagConformInAdmAndDischarge = 0, diagConformInPreAndAfterOperation = 0, diagConformInMainDiagAndPathology = 0,
|
|
|
- rescueTimes=0, rescueSuccessTimes = 0, medicalRecordAboveGradeFour = 0, levelFiveMedicalRecordCount = 0,
|
|
|
- inhospDays = 0;
|
|
|
+ int diagConformInAdmAndDischarge = 0, diagConformInPreAndAfterOperation = 0, diagConformInPreAndAfterOperationTotal = 0,
|
|
|
+ diagConformInMainDiagAndPathology = 0, diagConformInMainDiagAndPathologyTotal = 0, rescueTimes = 0,
|
|
|
+ rescueSuccessTimes = 0, medicalRecordAboveGradeFour = 0, levelFiveMedicalRecordCount = 0, inhospDays = 0;
|
|
|
for (SheetQualitySources tempSource : tempSources) {
|
|
|
inhospDays += tempSource.getAdmissDays();
|
|
|
if (Objects.equals(tempSource.getDiagConform2(), "1")) {
|
|
|
diagConformInAdmAndDischarge += 1;
|
|
|
}
|
|
|
+ if (StringUtil.notBlank(tempSource.getDiagConform3()) && !tempSource.getDiagConform3().equals("0")) {
|
|
|
+ diagConformInPreAndAfterOperationTotal += 1;
|
|
|
+ }
|
|
|
if (Objects.equals(tempSource.getDiagConform3(), "1")) {
|
|
|
diagConformInPreAndAfterOperation += 1;
|
|
|
}
|
|
|
+ if (StringUtil.notBlank(tempSource.getDiagConform4()) && !tempSource.getDiagConform4().equals("0")) {
|
|
|
+ diagConformInMainDiagAndPathologyTotal += 1;
|
|
|
+ }
|
|
|
if (Objects.equals(tempSource.getDiagConform4(), "1")) {
|
|
|
diagConformInMainDiagAndPathology += 1;
|
|
|
}
|
|
@@ -160,15 +166,19 @@ public class CaseFrontSheetAnalyzeService {
|
|
|
}
|
|
|
}
|
|
|
sheetQuality.setDiagConformInAdmAndDischarge(DecimalUtil.getPercent(diagConformInAdmAndDischarge, sourceSize));
|
|
|
- sheetQuality.setDiagConformInPreAndAfterOperation(DecimalUtil.getPercent(diagConformInPreAndAfterOperation, sourceSize));
|
|
|
- sheetQuality.setDiagConformInMainDiagAndPathology(DecimalUtil.getPercent(diagConformInMainDiagAndPathology, sourceSize));
|
|
|
+ if (diagConformInPreAndAfterOperationTotal > 0) {
|
|
|
+ sheetQuality.setDiagConformInPreAndAfterOperation(DecimalUtil.getPercent(diagConformInPreAndAfterOperation, diagConformInPreAndAfterOperationTotal));
|
|
|
+ }
|
|
|
+ if (diagConformInMainDiagAndPathologyTotal > 0) {
|
|
|
+ sheetQuality.setDiagConformInMainDiagAndPathology(DecimalUtil.getPercent(diagConformInMainDiagAndPathology, diagConformInMainDiagAndPathologyTotal));
|
|
|
+ }
|
|
|
if (rescueTimes > 0) {
|
|
|
sheetQuality.setRescueSuccessRate(DecimalUtil.getPercent(rescueSuccessTimes, rescueTimes));
|
|
|
}
|
|
|
sheetQuality.setMedicalRecordRateAboveGradeFour(DecimalUtil.getPercent(medicalRecordAboveGradeFour, sourceSize));
|
|
|
sheetQuality.setLevelFiveMedicalRecordRate(DecimalUtil.getPercent(levelFiveMedicalRecordCount, sourceSize));
|
|
|
sheetQuality.setLevelFiveMedicalCount(levelFiveMedicalRecordCount);
|
|
|
- sheetQuality.setAverageLengthOfStay(inhospDays/sourceSize);
|
|
|
+ sheetQuality.setAverageLengthOfStay(inhospDays / sourceSize);
|
|
|
sheetQualities.add(sheetQuality);
|
|
|
}
|
|
|
return ResultVoUtil.success(sheetQualities);
|