Browse Source

门诊上传优化

lihong 2 years ago
parent
commit
c041e01634

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

@@ -593,7 +593,7 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
             "       isnull(nullif(rtrim(b.occupation_code), " +
             "                     ''), " +
             "              90)                                           as prfs, " +
-            "       (select si_code from zd_country_code where code = b.country)   as ntly, " +
+            "    case when   (select si_code from zd_country_code where code = b.country) is null then 'CHN' else (select si_code from zd_country_code where code = b.country) end    as ntly, " +
             "       a.sex                                                as gend, " +
             "       a.birth_day                                          as brdy, " +
             "       a.age                                                as age, " +
@@ -612,13 +612,13 @@ public interface UpIdCollectionDao extends BaseMapper<SetlinfoUpld> {
             "       isnull(work_unit,b.employer_name)                    as emp_name, " +
             "       isnull(work_address,employer_district)               as emp_addr, " +
             "       isnull(work_tel,employer_tel)                        as emp_tel, " +
-            "       employer_zipcode                                     as poscode, " +
-            "       relation_name                                        as coner_name, " +
-            "       relation_district                                    as coner_addr, " +
-            "       relation_tel                                         as coner_tel, " +
+            "     case when   employer_zipcode is null then '430000' else   employer_zipcode end     as poscode, " +
+            "      case when  relation_name is null then a.name  else   relation_name end      as coner_name, " +
+            "       isnull(relation_district,a.adress)                                    as coner_addr, " +
+            "       isnull(relation_tel,a.phone_no)                                         as coner_tel, " +
             "       c.insuplc_admdvs                                     as insuplc," +
             " (select wjw_code from zd_nation_code where code =  b.nation_code)   as naty/*民族*/,\n" +
-            "       '1'                                                 as patnRlts," +
+            "       '01'                                                 as patnRlts," +
             "       a.adress                                             as conerAddr," +
             "       '1'                                                  as hiPaymtd, " +
             "       cast(fund_pay_sumamt as decimal(16,2)) as  fund_pay_sumamt," +

+ 14 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SetlListUpldService.java

@@ -1897,6 +1897,10 @@ public class SetlListUpldService {
         EntityCopy.Copy(dao.mzJieSuanXinXi(patNo, times), mzPatient);
 
         upldCollection.setSetlinfo(mzPatient);
+        if(StringUtil.notBlank(mzPatient.getChfpdrCode())){
+            String ybCode = getYbCode(mzPatient.getChfpdrCode());
+            mzPatient.setChfpdrCode(ybCode);
+        }
         mzPatient.setMedcasno(patNo + "_" + times);
         // 门诊慢特病
         OpspdiseinfoUpld opspdiseinfoUpld = dao.outpatientDiagnosis1(patNo, times);
@@ -1960,11 +1964,21 @@ public class SetlListUpldService {
                 upldCollection.getSetlinfo().setPsnCashpay(upldCollection.getSetlinfo().getPsnSelfpay());
             }
         }
+        //联系人处理
+        if(StringUtil.isBlank(mzPatient.getConerAddr()) || StringUtil.isBlank(mzPatient.getConerTel())){
+            mzPatient.setConerName(null);
+            mzPatient.setConerAddr(null);
+            mzPatient.setConerTel(null);
+            mzPatient.setPatnRlts(null);
+        }
+
         List<String> urbanAndRuralMedicalInsurance = Arrays.asList("390", "392");
         // 城乡医保类型可不填这两项
         if (urbanAndRuralMedicalInsurance.contains(mzPatient.getHiType())) {
             mzPatient.setEmpTel(null);
             mzPatient.setPoscode(null);
+            mzPatient.setEmpName(null);
+            mzPatient.setEmpAddr(null);
         }
         return ResultVoUtil.success(upldCollection);
     }