Browse Source

修复病案首页填生育诊断的问题。

lighter 3 years ago
parent
commit
b8eef9dc83

+ 3 - 1
src/main/java/thyyxxk/webserver/constants/sidicts/MdtrtCertType.java

@@ -13,7 +13,9 @@ public enum MdtrtCertType {
 
     RESIDENT_IDENTITY_CARD("02", "居民身份证"),
 
-    SOCIAL_SECURITY_CARD("03", "社会保障卡");
+    SOCIAL_SECURITY_CARD("03", "社会保障卡"),
+
+    OTHER("99", "社会保障卡");
 
     private final String code;
     private final String name;

+ 9 - 1
src/main/java/thyyxxk/webserver/controller/yibao/DictionaryController.java

@@ -6,6 +6,7 @@ import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import thyyxxk.webserver.config.auth.PassToken;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
+import thyyxxk.webserver.constants.sidicts.MedType;
 import thyyxxk.webserver.entity.ResultVo;
 import thyyxxk.webserver.entity.dictionary.PureCodeName;
 import thyyxxk.webserver.entity.dictionary.SearchDataParam;
@@ -52,7 +53,14 @@ public class DictionaryController {
     @PassToken
     @PostMapping("/searchYbDiag")
     public ResultVo<List<PureCodeName>> searchYbDiag(@RequestBody SearchDataParam param) {
-        ResultVo<List<PureCodeName>> res = service.executeSearch(param);
+        ResultVo<List<PureCodeName>> res;
+        if (param.getMedType().equals(MedType.MATERNITY_HOSPITALIZATION.getCode())) {
+            res = service.getMaternDiagsForFrontSheet(param);
+        } else if (param.getMedType().equals(MedType.SINGLE_DISEASE_HOSPITALIZATION.getCode())) {
+            res = service.getSingleDssForFrontSheet(param);
+        } else {
+            res = service.executeSearch(param);
+        }
         if (res.getCode() != ExceptionEnum.SUCCESS.getCode()) {
             return res;
         }

+ 8 - 4
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiQueryDao.java

@@ -46,9 +46,9 @@ public interface SiQueryDao {
      * @param psnBaseinfo 个人基本信息
      */
     @Insert("insert into t_si_pat_info (pat_no, times, ledger_sn, psn_no, psn_cert_type, " +
-            "certno, psn_name, gend, naty, brdy, age, med_type, create_datetime) values " +
-            "(#{patNo},#{times},#{ledgerSn},#{psnNo},#{psnCertType},#{certno}," +
-            "#{psnName},#{gend},#{naty},#{brdy},#{age},#{medType},getdate())")
+            "certno, psn_name, gend, naty, brdy, age, med_type, psn_idet_type, create_datetime) " +
+            "values (#{patNo},#{times},#{ledgerSn},#{psnNo},#{psnCertType},#{certno}," +
+            "#{psnName},#{gend},#{naty},#{brdy},#{age},#{medType},#{psnIdetType},getdate())")
     void insertSiZyInfoPsnNo(PsnBaseInfo psnBaseinfo);
 
     /**
@@ -63,6 +63,10 @@ public interface SiQueryDao {
     @Update("update zy_actpatient set med_type=#{medType} where inpatient_no=#{patNo}")
     void updateZyActpatient(PsnBaseInfo psnBaseInfo);
 
+    @Update("update t_si_pat_info set psn_idet_type=#{psnIdetType} where psn_no=#{psnNo} ")
+    void updatePsnIdetType(@Param("psnIdetType") String psnIdetType,
+                           @Param("psnNo") String psnNo);
+
     /**
      * 获取患者的医保基本信息
      *
@@ -163,7 +167,7 @@ public interface SiQueryDao {
             "admDeptName=(select rtrim(name) from zd_unit_code where code=c.small_dept), " +
             "c.bed_no as admBed,c.admiss_date as begntime,c.dis_date as endtime, " +
             "inHospdays=datediff(day ,c.admiss_date,c.dis_date), " +
-            "a.certno,a.mdtrt_cert_type, " +
+            "a.certno,a.mdtrt_cert_type, b.psn_idet_type, " +
             "dscgMaindiagName=(select rtrim(dis_diag_comment) from zy_dis_diag_yb where zy_dis_diag_yb.inpatient_no=a.pat_no " +
             "and zy_dis_diag_yb.admiss_times=a.times and zy_dis_diag_yb.dis_diag_no=1), " +
             "a.med_type,a.setl_time, " +

+ 25 - 0
src/main/java/thyyxxk/webserver/dao/his/yibao/DictionaryDao.java

@@ -49,4 +49,29 @@ public interface DictionaryDao {
 
     @Select("select code,name from t_zd_injury_icd where py_code like #{content}")
     List<PureCodeName> selectInjurydiagByAlpha(@Param("content") String content);
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name from " +
+            "si_icd_employees_maternity_hospitalization where py_code like #{content}")
+    List<PureCodeName> selectMatnDiagForFrontSheetByPyCode(@Param("content") String content);
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name from " +
+            "si_icd_employees_maternity_hospitalization where new_code like #{content}")
+    List<PureCodeName> selectMatnDiagForFrontSheetByCode(@Param("content") String content);
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name from " +
+            "si_icd_employees_maternity_hospitalization where new_name like #{content}")
+    List<PureCodeName> selectMatnDiagForFrontSheetByName(@Param("content") String content);
+
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name " +
+            "from si_icd_single_diseases where py_code like #{content} ")
+    List<PureCodeName> selectSpcDssDiagForFrontSheetByPyCode(@Param("content") String content);
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name " +
+            "from si_icd_single_diseases where code like #{content} ")
+    List<PureCodeName> selectSpcDssDiagForFrontSheetByCode(@Param("content") String content);
+
+    @Select("select rtrim(new_code) as code, rtrim(new_name) as name " +
+            "from si_icd_single_diseases where name like #{content} ")
+    List<PureCodeName> selectSpcDssDiagForFrontSheetByName(@Param("content") String content);
 }

+ 5 - 3
src/main/java/thyyxxk/webserver/entity/dictionary/SearchDataParam.java

@@ -12,9 +12,11 @@ public class SearchDataParam {
     private String target;
     @NotBlank(message = "查询内容不能为空")
     private String content;
+    private String medType;
     private Integer page;
-    private String responceType;
-    private String ybType;
-    private String treatType;
     private boolean accurateSearch = false;
+
+    public String getMedType() {
+        return null == medType ? "" : medType;
+    }
 }

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/query/PsnBaseInfo.java

@@ -81,6 +81,11 @@ public class PsnBaseInfo {
      * */
     private String natyName;
 
+    /**
+     * 人员身份
+     * */
+    private String psnIdetType;
+
     /**
      * 参保信息
      * */

+ 5 - 0
src/main/java/thyyxxk/webserver/entity/medicalinsurance/setlinfo/SiSetlinfo.java

@@ -253,6 +253,11 @@ public class SiSetlinfo implements Serializable {
 	 * */
 	private String setlType;
 
+	/**
+	 * 上传流水号
+	 * */
+	private String setlListId;
+
 	@TableField(exist = false)
 	private String gendName;
 	@TableField(exist = false)

+ 27 - 14
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiQueryService.java

@@ -72,9 +72,14 @@ public class SiQueryService {
         }
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.OBTAIN_BASIC_PERSON_INFO, qryPsnBsInfo.getAdmdvs());
         JSONObject data = new JSONObject();
-        data.put("mdtrt_cert_type", MdtrtCertType.RESIDENT_IDENTITY_CARD.getCode());
+        if (qryPsnBsInfo.getSocialNo().length() < 15) {
+            data.put("mdtrt_cert_type", MdtrtCertType.OTHER.getCode());
+            data.put("psn_cert_type", PsnCertType.RESIDENCE_PERMIT_FOR_HMT.getCode());
+        } else {
+            data.put("mdtrt_cert_type", MdtrtCertType.RESIDENT_IDENTITY_CARD.getCode());
+            data.put("psn_cert_type", "01");
+        }
         data.put("mdtrt_cert_no", qryPsnBsInfo.getSocialNo());
-        data.put("psn_cert_type", "01");
         data.put("certno", qryPsnBsInfo.getSocialNo());
         if (StringUtil.notBlank(qryPsnBsInfo.getName())) {
             data.put("psn_name", qryPsnBsInfo.getName());
@@ -102,6 +107,22 @@ public class SiQueryService {
             if (null != naty) {
                 psnBaseinfo.setNatyName(naty.getName());
             }
+            List<IdetInfo> idetInfos = new ArrayList<>();
+            JSONArray idet = output.getJSONArray("idetinfo");
+            for (int i = 0; i < idet.size(); i++) {
+                JSONObject item = idet.getJSONObject(i);
+                IdetInfo info = JSONObject.parseObject(item.toJSONString(), IdetInfo.class);
+                PsnIdetType psnIdetType = PsnIdetType.get(info.getPsnIdetType());
+                if (null != psnIdetType) {
+                    psnBaseinfo.setPsnIdetType(psnIdetType.getCode());
+                    info.setPsnIdetTypeName(psnIdetType.getName());
+                }
+                idetInfos.add(info);
+            }
+            if (StringUtil.notBlank(psnBaseinfo.getPsnIdetType())) {
+                dao.updatePsnIdetType(psnBaseinfo.getPsnIdetType(), psnBaseinfo.getPsnNo());
+            }
+            psnBaseinfo.setIdetinfo(idetInfos);
             if (new Integer(1).equals(qryPsnBsInfo.getNeedSaving())) {
                 dao.updateZyActpatient(psnBaseinfo);
                 int saved = dao.selectSiZyInfoCount(qryPsnBsInfo.getPatNo(), qryPsnBsInfo.getTimes(), qryPsnBsInfo.getLedgerSn());
@@ -146,18 +167,6 @@ public class SiQueryService {
                 list.add(info);
             }
             psnBaseinfo.setInsuinfo(list);
-            List<IdetInfo> idetInfos = new ArrayList<>();
-            JSONArray idet = output.getJSONArray("idetinfo");
-            for (int i = 0; i < idet.size(); i++) {
-                JSONObject item = idet.getJSONObject(i);
-                IdetInfo info = JSONObject.parseObject(item.toJSONString(), IdetInfo.class);
-                PsnIdetType psnIdetType = PsnIdetType.get(info.getPsnIdetType());
-                if (null != psnIdetType) {
-                    info.setPsnIdetTypeName(psnIdetType.getName());
-                }
-                idetInfos.add(info);
-            }
-            psnBaseinfo.setIdetinfo(idetInfos);
             return ResultVoUtil.success(psnBaseinfo);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -715,6 +724,10 @@ public class SiQueryService {
             if (null == lst) {
                 return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到此患者的结算信息!");
             }
+            PsnIdetType psnIdetType = PsnIdetType.get(lst.getPsnIdetType());
+            if (null != psnIdetType) {
+                lst.setPsnIdetTypeName(psnIdetType.getName());
+            }
             Admdvs admdvs = Admdvs.get(lst.getInsuplcAdmdvs());
             if (null == admdvs) {
                 lst.setInsuplcAdmdvsName(dao.selectRegionName(lst.getInsuplcAdmdvs()));

+ 26 - 0
src/main/java/thyyxxk/webserver/service/yibao/DictionaryService.java

@@ -106,4 +106,30 @@ public class DictionaryService {
         }
         return ResultVoUtil.success(dao.selectAllSpecialDiags(tableName));
     }
+
+    public ResultVo<List<PureCodeName>> getMaternDiagsForFrontSheet(SearchDataParam param) {
+        String content = "%" + param.getContent().toUpperCase() + "%";
+        switch (param.getMethod()) {
+            case "alpha":
+                return ResultVoUtil.success(dao.selectMatnDiagForFrontSheetByPyCode(content));
+            case "code":
+                return ResultVoUtil.success(dao.selectMatnDiagForFrontSheetByCode(content));
+            case "name":
+                return ResultVoUtil.success(dao.selectMatnDiagForFrontSheetByName(content));
+        }
+        return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
+    }
+
+    public ResultVo<List<PureCodeName>> getSingleDssForFrontSheet(SearchDataParam param) {
+        String content = "%" + param.getContent().toUpperCase() + "%";
+        switch (param.getMethod()) {
+            case "alpha":
+                return ResultVoUtil.success(dao.selectSpcDssDiagForFrontSheetByPyCode(content));
+            case "code":
+                return ResultVoUtil.success(dao.selectSpcDssDiagForFrontSheetByCode(content));
+            case "name":
+                return ResultVoUtil.success(dao.selectSpcDssDiagForFrontSheetByName(content));
+        }
+        return ResultVoUtil.fail(ExceptionEnum.NULL_POINTER);
+    }
 }