瀏覽代碼

优化门诊参保信息查询

lighter 1 年之前
父節點
當前提交
e97016919a

+ 3 - 0
src/main/java/thyyxxk/webserver/entity/markmtfees/SiMzBusinessParams.java

@@ -17,6 +17,9 @@ public class SiMzBusinessParams {
     @NotNull(message = "就诊次数不能为空。")
     private Integer times;
 
+    private String admdvs;
+    private String socialNo;
+
     // 个人账户使用标志:1-使用,0-不使用
     private Integer acctUsedFlag;
     // 读卡类型:01-电子凭证,02-身份证,03-社保卡

+ 29 - 4
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiMzService.java

@@ -412,10 +412,15 @@ public class SiMzService {
         QryPsnBsInfo mzptnt = new QryPsnBsInfo();
         mzptnt.setStaffId(param.getStaffId());
         mzptnt.setPatNo(param.getPatientId());
-        mzptnt.setTimes(param.getTimes());
         mzptnt.setMedType(MedType.GENERAL_CLINIC.getCode());
         mzptnt.setOnlyQry(1);
         mzptnt.setTimes(-1);
+
+        if (StringUtil.notBlank(param.getAdmdvs())) {
+            mzptnt.setAdmdvs(param.getAdmdvs());
+            mzptnt.setSocialNo(param.getSocialNo());
+        }
+
         ResultVo<PsnBaseInfo> baseInfo = qryService.obtainBasicPersonInfo(mzptnt);
         if (null == baseInfo) {
             result.put("code", -2);
@@ -435,12 +440,14 @@ public class SiMzService {
             result.put("msg", "患者没有职工医保,如需报销请走医保科流程。");
             return result;
         }
+
         if (!isInsuplcAdmdvsEligible(insuInfo.getInsuplcAdmdvs())) {
             result.put("code", -1);
             result.put("msg", "患者参保地不满足门诊统筹要求。");
             return result;
         }
-        psninfo.setInsutype(Insutype.BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES.getCode());
+
+        psninfo.setInsutype(insuInfo.getInsutype());
         int count = dao.selectSiMzInfoCount(mzptnt.getPatNo(), mzptnt.getTimes());
         if (count == 0) {
             psninfo.setMedType(MedType.GENERAL_CLINIC.getCode());
@@ -454,13 +461,31 @@ public class SiMzService {
         }
         result.put("code", 0);
         result.put("expContentRequired", expContentRequired(insuInfo.getInsuplcAdmdvs()));
-        result.put("msg", "查询职工参保信息成功。");
+        result.put("msg", "查询参保信息成功。");
         return result;
     }
 
     private InsuInfo getEmployeeInsuInfo(List<InsuInfo> list) {
         for (InsuInfo info : list) {
-            if (info.getInsutype().equals("310")) {
+            Insutype insutype = Insutype.get(info.getInsutype());
+            if (null == insutype) {
+                continue;
+            }
+            if (insutype == Insutype.BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES) {
+                return info;
+            }
+        }
+        return null;
+    }
+
+    private InsuInfo getValidInsuInfo(List<InsuInfo> list) {
+        for (InsuInfo info : list) {
+            Insutype insutype = Insutype.get(info.getInsutype());
+            if (null == insutype) {
+                continue;
+            }
+            if (insutype == Insutype.BASIC_MEDICAL_INSURANCE_FOR_EMPLOYEES ||
+                insutype == Insutype.BASIC_MEDICAL_INSURANCE_FOR_RURAL_RESIDENTS) {
                 return info;
             }
         }