Browse Source

结算单中诊断和手术取医保编码。

DESKTOP-MINPJAU\Administrator 3 years ago
parent
commit
ba01821cee

+ 3 - 1
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -124,7 +124,9 @@ public interface PublicDao {
             " dept_name = (select rtrim(name) from zd_unit_code where zd_unit_code.code = dept_code)," +
             " emp_tit_name  = (select rtrim(name) from zd_emp_title where zd_emp_title.code = emp_tit_code)," +
             " rtrim(yb_code) as  yb_code " +
-            "from a_employee_mi where (name like #{code} or code_rs like #{code} or py_code like #{code}) and isnull(del_flag,0) = 0")
+            "from a_employee_mi where " +
+            "(code like #{code} or name like #{code} or code_rs like #{code} or py_code like #{code}) " +
+            "and isnull(del_flag,0) = 0 ")
     List<GetDropdownBox> getRenYuan(String code);
 
     /**

+ 40 - 30
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/UpIdCollectionDao.java

@@ -52,8 +52,7 @@ public interface UpIdCollectionDao {
             "       a.insutype as hi_type," + // -- 险种类型
             "       (select rytj from batj_ba1 where zyh = #{patNo} and zycs = #{times})  as admWay,  " +  // 入院途径
             "       a.setl_time as  setl_end_date, " +  //结算时间
-            "       a.ipt_med_type, a.hi_paymtd " +
-            "from t_si_setlinfo a, t_si_pat_info b " + "where a.pat_no=b.pat_no and a.times=b.times " + "and a.ledger_sn = b.ledger_sn  " + "and a.pat_no = #{patNo} and a.times = #{times} " + "and a.ledger_sn = #{ledgerSn} " + "and a.revoked = 0 ")
+            "       a.ipt_med_type, a.hi_paymtd " + "from t_si_setlinfo a, t_si_pat_info b " + "where a.pat_no=b.pat_no and a.times=b.times " + "and a.ledger_sn = b.ledger_sn  " + "and a.pat_no = #{patNo} and a.times = #{times} " + "and a.ledger_sn = #{ledgerSn} " + "and a.revoked = 0 ")
     SetlinfoUpld setlinfo1(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
 
 
@@ -88,8 +87,7 @@ public interface UpIdCollectionDao {
     SiPatInfo huoQuZhiFuFangShi(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
 
     @Update("update t_si_setlinfo set hi_paymtd = #{hiPaymtd} where pat_no = #{patNo} and times = #{times} and ledger_sn = #{ledgerSn}")
-    void genXingYiBaoZhiFuFangShi(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn,
-                                  @Param("hiPaymtd") Integer hiPaymtd);
+    void genXingYiBaoZhiFuFangShi(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn, @Param("hiPaymtd") Integer hiPaymtd);
 
     @Select("select receipt_no from zy_receipt where inpatient_no=#{patNo} and admiss_times=#{times} and ledger_sn=#{ledgerSn} and receipt_no<>'0000000'" + "and receipt_sn = 1")
     String billNo(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
@@ -131,11 +129,31 @@ public interface UpIdCollectionDao {
     long huoQuJieSuanRenYuanTotal(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("setlType") String setlTyle, @Param("patNo") String patNo, @Param("insutypes") List<String> insutypes, @Param("outDepts") List<String> outDepts, @Param("medTypes") List<String> medTypes, @Param("psnTypes") List<String> psnTypes, @Param("clrOptins") List<String> clrOptins, @Param("decTypes") List<Integer> decTypes, @Param("flag") Integer flag, @Param("referPhysician") String referPhysician, @Param("auditFlag") Integer auditFlag, @Param("hiPaymtd") Integer hiPaymtd);
 
 
-    @Select("select opName = (select top(1) rtrim(name) from a_employee_mi where code = op_id_code)," + "rtrim(inpatient_no) inpatient_no, admiss_times, dis_diag_no, dis_diag_type,rtrim(dis_diag) dis_diag," + "rtrim(dis_diag_comment) dis_diag_comment," + "op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, operation, si_diag_type,admiss_cond  " + "from ${tableName} where inpatient_no = #{patNo} and admiss_times = #{times} " + "order by  dis_diag_no ")
+    @Select("select opName = (select top(1) rtrim(name) from a_employee_mi where code = op_id_code),"+
+            "rtrim(inpatient_no) inpatient_no, admiss_times, dis_diag_no, dis_diag_type," +
+            "case  when yb_code is null then rtrim(dis_diag) else rtrim(yb_code) end dis_diag,"+
+            "case  when yb_name is null then rtrim(dis_diag_comment) else rtrim(yb_name) end dis_diag_comment,"+
+            "op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, operation, si_diag_type,admiss_cond  "+
+             "from ${tableName} left join zd_icd_code_new on (dis_diag = code) " +
+            "where inpatient_no = #{patNo} and admiss_times = #{times} "+
+            "order by  dis_diag_no ")
     List<YbZyDisDiag> zhenDuanXinXi(@Param("patNo") String patNo, @Param("times") Integer times, @Param("tableName") String tableName);
 
 
-    @Select("select ssys_name = (select top(1) rtrim(name) from a_employee_mi where code = ssys), " + "       sszsName1 = (select top(1) rtrim(name) from a_employee_mi where code = sszs1), " + "       sszsName2 = (select top(1) rtrim(name) from a_employee_mi where code = sszs2), " + "       mzys_name = (select top(1) rtrim(name) from a_employee_mi where code = mzys)," + "       bah, zyh, zycs, ssxh, ssrq, sstj, " + "       ssys , sszs1, sszs2, mzys ," + " ssbm, ssmc, rtrim(mzff) mzff, rtrim(qkjb) qkjb," + "rtrim(yhqk) yhqk, ssbfz, fhqk, ssjb, cut_heal," + "(select top(1) yb_code from a_employee_mi where code = ssys) as oper_dr_code, " + "(select top(1) yb_code from a_employee_mi where code = mzys) as anst_dr_code " + "from ${tableName} where zyh = #{patNo} and zycs = #{times} " + "order by ssxh")
+    @Select("select ssys_name = (select top(1) rtrim(name) from a_employee_mi where code = ssys), " +
+            "       sszsName1 = (select top(1) rtrim(name) from a_employee_mi where code = sszs1), " +
+            "       sszsName2 = (select top(1) rtrim(name) from a_employee_mi where code = sszs2), " +
+            "       mzys_name = (select top(1) rtrim(name) from a_employee_mi where code = mzys)," +
+            "       bah, zyh, zycs, ssxh, ssrq, sstj, " +
+            "       ssys , sszs1, sszs2, mzys ," +
+            " case when yb_code is null then rtrim(ssbm) else rtrim(yb_code) end  ssbm ," +
+            " case when yb_name is null then rtrim(ssmc) else rtrim(yb_name) end  ssmc," +
+            " rtrim(mzff) mzff, rtrim(qkjb) qkjb," +
+            "rtrim(yhqk) yhqk, ssbfz, fhqk, ssjb, cut_heal," +
+            "(select top(1) yb_code from a_employee_mi where code = ssys) as oper_dr_code, " +
+            "(select top(1) yb_code from a_employee_mi where code = mzys) as anst_dr_code " +
+            "from ${tableName} left join zd_icd9_cm3 on (ssbm = zd_icd9_cm3.code)  " +
+            "where zyh = #{patNo} and zycs = #{times} " + "order by ssxh")
     List<BatjBa4> shouShuXinXi(@Param("patNo") String patNo, @Param("times") Integer times, @Param("tableName") String tableName);
 
 
@@ -153,15 +171,16 @@ public interface UpIdCollectionDao {
     List<SiSetlinfoTemp> zhuanKeKeShi(@Param("patNos") Set<String> patNos);
 
 
-    @Select("select top 10 rtrim(code) as code,rtrim(name) as name from " +
+    @Select("select top 10 rtrim(yb_code) as code,rtrim(name) as name," +
+            "rtrim(yb_code) as yb_code" +
+            " from " +
             "(SELECT ROW_NUMBER() OVER(ORDER BY code) AS Number,  * " +
             "from zd_icd9_cm3 where (code like #{content} or name like #{content} or py_code like #{content})) a " +
             "where Number > (${page}-1) * 10 ")
     List<GetDropdownBox> searchSurgeryByAlpha(@Param("content") String content, @Param("page") long page);
 
 
-    @Select("select count(1) from zd_icd9_cm3 where (code like #{content} or name" +
-            " like #{content} or py_code like #{content})")
+    @Select("select count(1) from zd_icd9_cm3 where (code like #{content} or name" + " like #{content} or py_code like #{content})")
     long searchSurgeryTotal(@Param("content") String content);
 
 
@@ -175,7 +194,14 @@ public interface UpIdCollectionDao {
     @Insert("<script>" + "insert into ${tableName} (inpatient_no, admiss_times, dis_diag_no, dis_diag_type, dis_diag, dis_diag_comment, " + "op_id_code, op_diag_date, dis_diag_bzfx, dis_diag_status, operation, si_diag_type,admiss_cond) " + "values " + "<foreach collection='list' item='param' separator=','>" + "(#{param.inpatientNo},#{param.admissTimes},#{param.disDiagNo},'13',#{param.disDiag},#{param.disDiagComment}, " + "        #{param.opIdCode},#{param.opDiagDate},'001',#{param.disDiagStatus},null,#{param.siDiagType},#{param.admissCond})" + "</foreach>" + "</script>")
     void setlModDis(@Param("list") List<YbZyDisDiag> param, @Param("tableName") String tableName);
 
-    @Insert("<script>" + "insert into ${tableName} (bah, zyh, zycs, ssxh, ssrq, sstj, ssys, sszs1, sszs2, " + "mzys, ssbm, ssmc, mzff, qkjb, yhqk, ssbfz, fhqk, ssjb, cut_heal) " + "values " + "<foreach collection='list' item='param' separator=','>" + "(#{param.zyh},#{param.zyh},#{param.zycs},#{param.ssxh},#{param.ssrq},null,#{param.ssys},#{param.sszs1}," + "#{param.sszs2},#{param.mzys},#{param.ssbm},#{param.ssmc},#{param.mzff},#{param.qkjb},#{param.yhqk},null,null,#{param.ssjb},null)" + "</foreach>" + "</script>")
+    @Insert("<script>" + "insert into ${tableName} (bah, zyh, zycs, ssxh, ssrq, sstj, ssys, sszs1, sszs2, "
+            + "mzys, ssbm, ssmc, mzff, qkjb, yhqk, ssbfz, fhqk, ssjb, cut_heal) "
+            + "values "
+            + "<foreach collection='list' item='param' separator=','>"
+            + "(#{param.zyh},#{param.zyh},#{param.zycs},#{param.ssxh},#{param.ssrq},null,#{param.ssys},#{param.sszs1},"
+            + "#{param.sszs2},#{param.mzys},#{param.ssbm},#{param.ssmc},#{param.mzff},#{param.qkjb},#{param.yhqk},null,null,#{param.ssjb},null)"
+            + "</foreach>"
+            + "</script>")
     void setlModBat(@Param("list") List<BatjBa4> batjBa4s, @Param("tableName") String tableName);
 
 
@@ -248,29 +274,13 @@ public interface UpIdCollectionDao {
     @Select("select dise_code as dise_code, dise_name as dise_name from t_si_pat_info " + "where pat_no = #{patNo} and times = #{times} " + "and ledger_sn = #{ledgerSn}")
     List<OpspdiseinfoUpld> diagnosisOfMenterSDisease(@Param("patNo") String patNo, @Param("times") Integer times, @Param("ledgerSn") Integer ledgerSn);
 
-    @Select("select name as psnName, " +
-            "       sex as sex, " +
-            "       birth_day as brdy, " +
-            "       age as age, " +
-            "       social_no as certno, " +
-            "       response_type, " +
-            "       phone_no as conerTel, " +
-            "       adress as currAddr, " +
-            "       rel_name as conerName, " +
-            "       contract_name as conerTel, " +
-            "       certificate_type as patnCertType " +
-            "from mz_patient_mi where patient_id = #{patNo}")
+    @Select("select name as psnName, " + "       sex as sex, " + "       birth_day as brdy, " + "       age as age, " + "       social_no as certno, " + "       response_type, " + "       phone_no as conerTel, " + "       adress as currAddr, " + "       rel_name as conerName, " + "       contract_name as conerTel, " + "       certificate_type as patnCertType " + "from mz_patient_mi where patient_id = #{patNo}")
     SetlinfoUpld mzPatInfo(String patNo);
 
-    @Select("select setl_id,mdtrt_id,insuplc_admdvs " +
-            "from t_si_setlinfo " +
-            "where pat_no =  #{patNo} " +
-            "  and times = #{times}")
-    SetlinfoUpld mzJieSuanXinXi(@Param("patNo") String patNo,
-                                @Param("times") Integer times);
+    @Select("select setl_id,mdtrt_id,insuplc_admdvs " + "from t_si_setlinfo " + "where pat_no =  #{patNo} " + "  and times = #{times}")
+    SetlinfoUpld mzJieSuanXinXi(@Param("patNo") String patNo, @Param("times") Integer times);
 
     @Update("update t_si_setlinfo set ipt_med_type = #{iptMenType} where setl_id = #{setlId}")
-    void modifyMedicalCategory(@Param("iptMenType") String iptMenType,
-                               @Param("setlId") String setlId);
+    void modifyMedicalCategory(@Param("iptMenType") String iptMenType, @Param("setlId") String setlId);
 
 }

+ 2 - 0
src/main/java/thyyxxk/webserver/entity/datamodify/GetDropdownBox.java

@@ -8,6 +8,8 @@ public class GetDropdownBox {
     private String code;
     private String name;
 
+    @JsonInclude(JsonInclude.Include.NON_NULL)
+    private String ybCode;
 
     @JsonInclude(JsonInclude.Include.NON_NULL)
     private String deptName;

+ 17 - 0
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -85,6 +85,23 @@ public class PublicServer {
     }
 
 
+    /**
+     * @param jueSeBianMa 不需要限制的角色id
+     * @return Boolean
+     */
+    public Boolean needRule(int... jueSeBianMa) {
+        return !getaBoolean(jueSeBianMa, getRoleCode().getData());
+    }
+
+    /**
+     * @param jueSeBianMa 不需要限制的角色id
+     * @return Boolean
+     */
+    public Boolean needRule(List<Integer> role, int... jueSeBianMa) {
+        return !getaBoolean(jueSeBianMa, role);
+    }
+
+
     public Boolean getaBoolean(int[] jueSeBianMa, List<Integer> roleCode) {
         if (ListUtil.isBlank(roleCode)) {
             return true;