Browse Source

优化病案首页验证和质控分析

lighter 3 years ago
parent
commit
88e97dcc10

+ 19 - 9
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetAnalyzeService.java

@@ -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);

+ 1 - 1
src/main/java/thyyxxk/webserver/service/casefrontsheet/VerifyCaseFrontSheet.java

@@ -251,7 +251,7 @@ public class VerifyCaseFrontSheet {
         if (DateUtil.daysBetween(info.getQualityControlDate(), info.getDismissDate()) > 7) {
             array.add(new PureCodeName("qualityControlDate","质控日期不能大于出院7天!"));
         }
-        if (info.getHkPlaceName().length() > 10) {
+        if (StringUtil.notBlank(info.getHkPlaceName()) && info.getHkPlaceName().length() > 10) {
             array.add(new PureCodeName("hkPlaceName", "患者户口地址不能超过10个汉字!"));
         }
         if (StringUtil.notBlank(info.getUnitPlace()) && info.getUnitPlace().length() > 16) {