Browse Source

修复病案质控的部分问题。

lighter 2 years ago
parent
commit
1d2fa7236a

+ 2 - 2
src/main/java/thyyxxk/webserver/entity/api/forpowersi/drgdip/frontsheetqualitycheck/QualityCheckBaseInfo.java

@@ -682,14 +682,14 @@ public class QualityCheckBaseInfo {
      * 说明 数值型
      */
     @JSONField(name = "newborn_weight")
-    private String newbornWeight;
+    private Integer newbornWeight;
 
     /**
      * 新生儿入院体重
      * 说明 数值型
      */
     @JSONField(name = "newborn_hsptzd_weight")
-    private String newbornHsptzdWeight;
+    private Integer newbornHsptzdWeight;
 
     /**
      * 入院途径编号

+ 2 - 2
src/main/java/thyyxxk/webserver/entity/api/forpowersi/drgdip/frontsheetqualitycheck/QualityCheckDiseInfo.java

@@ -9,7 +9,7 @@ public class QualityCheckDiseInfo {
      * 排序
      */
     @JSONField(name = "order")
-    private Integer order;
+    private String order;
 
     /**
      * 诊断类型
@@ -33,7 +33,7 @@ public class QualityCheckDiseInfo {
      * 入院病情编号
      */
     @JSONField(name = "dagns_condi_id")
-    private Integer dagnsCondiId;
+    private String dagnsCondiId;
 
     /**
      * 入院病情名称

+ 6 - 10
src/main/java/thyyxxk/webserver/service/casefrontsheet/CaseFrontSheetMainService.java

@@ -768,10 +768,8 @@ public class CaseFrontSheetMainService {
 
     public ResultVo<String> frontsheetQualityCheck(CaseFrontsheetMain sheet) {
 
-        JSONArray diagList = emrService.getEmrData(sheet.getBah(), sheet.getAdmissTimes(), EmrType.DIAGNOSIS);
-        JSONArray oprtList = emrService.getEmrData(sheet.getBah(), sheet.getAdmissTimes(), EmrType.OPERATION);
-
-        log.info("diagList: {}\n================================\noprtList: {}", diagList, oprtList);
+//        JSONArray diagList = emrService.getEmrData(sheet.getBah(), sheet.getAdmissTimes(), EmrType.DIAGNOSIS);
+//        JSONArray oprtList = emrService.getEmrData(sheet.getBah(), sheet.getAdmissTimes(), EmrType.OPERATION);
 
         List<CodeName> anstWays = dao.selectZdAnstWays();
         Map<String, CodeName> anstWaysMap = new HashMap<>();
@@ -795,13 +793,11 @@ public class CaseFrontSheetMainService {
         params.setBaseInfo(FrontSheetUtil.fillBaseInfoFromSheet(sheet, countriesMap, nationsMap));
         params.setDiseInfoList(FrontSheetUtil.fillDiseInfoFromSheet(sheet.getDisdiagList()));
         params.setOprtInfoList(FrontSheetUtil.fillOprtInfoFromSheet(sheet.getSurgeryList(), anstWaysMap));
-
-
+        JSONObject jsonParams = JSONObject.parseObject(JSON.toJSONString(params, SerializerFeature.WriteNullStringAsEmpty));
         String url = "http://172.16.32.126:8080/drg_web/drgGroupThird/V2/groupAndQuality.action";
         RestTemplate template = new RestTemplate();
-        String res = template.postForObject(url, JSONObject.parseObject(
-                JSON.toJSONString(params, SerializerFeature.WriteNullStringAsEmpty)), String.class);
-        log.info(res);
-        return ResultVoUtil.success("http://172.16.32.126:8080"+res);
+        String result = template.postForObject(url, jsonParams, String.class);
+        log.info("病案质控:\n参数:{}\n结果:{}", jsonParams, result);
+        return ResultVoUtil.success("http://172.16.32.126:8080" + result);
     }
 }

+ 112 - 3
src/main/java/thyyxxk/webserver/utils/FrontSheetUtil.java

@@ -38,6 +38,10 @@ public class FrontSheetUtil {
             baseInfo.setNation(nation.getName());
         }
         // TODO: 2022/12/9 映射职业代码
+        baseInfo.setNewbornWeight(sheet.getNewBornWeight());
+        baseInfo.setNewbornHsptzdWeight(sheet.getNewBornAdmissWeight());
+        baseInfo.setHsptzdWaysId(sheet.getZyAdmissWay());
+        baseInfo.setHsptzdWays(filterAdmissWayName(sheet.getZyAdmissWay()));
         baseInfo.setMarriageStatusId(reflectMarriage(sheet.getMarriage()));
         baseInfo.setMarriageStatus(filterMarriageName(sheet.getMarriage()));
         baseInfo.setCompanyName(sheet.getUnitName());
@@ -65,6 +69,8 @@ public class FrontSheetUtil {
         baseInfo.setAllergicDrugs(sheet.getAllergicMedicine());
         baseInfo.setRescueNum(sheet.getRescueTimes());
         baseInfo.setRescueSuccNum(sheet.getRescueSuccessTimes());
+        baseInfo.setFeeModeId(reflectPayMethod(sheet.getPayMethod()));
+        baseInfo.setFeeMode(filterPayMethodName(sheet.getPayMethod()));
         baseInfo.setQualityDate(DateUtil.formatDatetime(sheet.getQualityControlDate(), DateUtil.DATE));
         baseInfo.setTotalFee(sheet.getTotalCost());
         baseInfo.setOutHospId(reflectDismissWay(sheet.getZyDismissWay()));
@@ -106,11 +112,11 @@ public class FrontSheetUtil {
                 break;
             }
             QualityCheckDiseInfo diseInfo = new QualityCheckDiseInfo();
-            diseInfo.setOrder(diag.getNo());
+            diseInfo.setOrder(String.valueOf(diag.getNo()));
             diseInfo.setDagnsType(diag.getNo() == 1 ? "1" : "2");
             diseInfo.setDiseaseName(diag.getName());
             diseInfo.setIcdCode(diag.getCode());
-            diseInfo.setDagnsCondiId(diag.getAdmissStatus());
+            diseInfo.setDagnsCondiId(String.valueOf(diag.getAdmissStatus()));
             diseInfo.setDagnsCondi(filterDiagnoseCondition(diag.getAdmissStatus()));
             list.add(diseInfo);
         }
@@ -157,7 +163,89 @@ public class FrontSheetUtil {
         return list;
     }
 
+//    1 	急诊
+//2 	门诊
+//3 	其他医疗机构转入
+//9 	其他
+
+    public static String filterAdmissWayName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
+        switch (code) {
+            case "1":
+                return "急诊";
+            case "2":
+                return "门诊";
+            case "3":
+                return "其他医疗机构转入";
+            case "9":
+                return "其他";
+            default:
+                return "";
+        }
+    }
+
+    public static String reflectPayMethod(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
+        switch (code) {
+            case "1":
+                return "01";
+            case "2":
+                return "02";
+            case "3":
+                return "03";
+            case "4":
+                return "04";
+            case "5":
+                return "05";
+            case "6":
+                return "06";
+            case "7":
+                return "07";
+            case "8":
+                return "08";
+            case "9":
+                return "99";
+            default:
+                return "";
+        }
+    }
+
+    public static String filterPayMethodName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
+        switch (code) {
+            case "1":
+                return "城镇职工基本医疗保险";
+            case "2":
+                return "城镇居民基本医疗保险";
+            case "3":
+                return "新型农村合作医疗";
+            case "4":
+                return "贫困救助";
+            case "5":
+                return "商业医疗保险";
+            case "6":
+                return "全公费";
+            case "7":
+                return "全自费";
+            case "8":
+                return "其他社会保险";
+            case "9":
+                return "其他";
+            default:
+                return "";
+        }
+    }
+
     public static String reflectDismissWay(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
         switch (code) {
             case "0":
                 return "1";
@@ -177,6 +265,9 @@ public class FrontSheetUtil {
     }
 
     public static String filterDismissWayName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
         switch (code) {
             case "0":
                 return "医嘱离院";
@@ -196,6 +287,9 @@ public class FrontSheetUtil {
     }
 
     public static String reflectMarriage(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
         switch (code) {
             case "1":
                 return "10";
@@ -213,6 +307,9 @@ public class FrontSheetUtil {
     }
 
     public static String filterMarriageName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return "";
+        }
         switch (code) {
             case "1":
                 return "未婚";
@@ -230,6 +327,9 @@ public class FrontSheetUtil {
     }
 
     public static String filterOprtLevelName(String level) {
+        if (StringUtil.isBlank(level)) {
+            return "";
+        }
         switch (level) {
             case "1":
                 return "一级手术";
@@ -252,6 +352,9 @@ public class FrontSheetUtil {
     }
 
     public static String filterHealName(String healId) {
+        if (StringUtil.isBlank(healId)) {
+            return "";
+        }
         switch (healId) {
             case "1":
                 return "甲";
@@ -273,6 +376,9 @@ public class FrontSheetUtil {
     }
 
     public static String filterCutName(String cutId) {
+        if (StringUtil.isBlank(cutId)) {
+            return "";
+        }
         switch (cutId) {
             case "1":
                 return "0";
@@ -286,7 +392,10 @@ public class FrontSheetUtil {
         return "";
     }
 
-    public static String filterDiagnoseCondition(int condition) {
+    public static String filterDiagnoseCondition(Integer condition) {
+        if (null == condition) {
+            return "";
+        }
         switch (condition) {
             case 1:
                 return "有";