浏览代码

入院登记和取消入院登记时修改responce_type

lighter 3 年之前
父节点
当前提交
37a7502c6e

+ 12 - 0
src/main/java/thyyxxk/webserver/dao/his/medicalinsurance/SiZyDao.java

@@ -220,6 +220,18 @@ public interface SiZyDao {
             "where pat_no=#{inpatientNo} and times=#{admissTimes} and ledger_sn=#{ledgerSn}")
     void afterAdmissRegister(ZyPatientInfo p);
 
+    @Update("update zy_actpatient set responce_type=#{restype},med_type=#{medtype} where inpatient_no=#{patNo} ;" +
+            "update zy_ledger_file set responce_type=#{restype} where inpatient_no=#{patNo} " +
+            "and admiss_times=#{times} and ledger_sn=#{sn}")
+    void updateResponceType(@Param("restype") String restype,
+                            @Param("medtype") String medtype,
+                            @Param("patNo") String patNo,
+                            @Param("times") int times,
+                            @Param("sn") int sn);
+
+    @Select("select code from zy_zd_responce_type where med_type=#{medtype} ")
+    String selectResponceType(@Param("medtype") String medtype);
+
     @Update("update t_si_setlinfo set revoked=1 where pat_no=#{patNo} and times=#{times} and ledger_sn=#{ledgerSn}")
     void deleteSetlInfo(@Param("patNo") String patNo, @Param("times") int times, @Param("ledgerSn") int ledgerSn);
 

+ 3 - 0
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -111,6 +111,8 @@ public class SiZyService {
             p.setMdtrtId(mdtrtId);
             p.setAdmRegMsgid(input.getString("msgid"));
             dao.afterAdmissRegister(p);
+            String restype = dao.selectResponceType(admMdtrtinfo.getMedType());
+            dao.updateResponceType(restype, admMdtrtinfo.getMedType(), p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             return ResultVoUtil.success("入院登记成功,就诊号为:" + mdtrtId);
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
@@ -171,6 +173,7 @@ public class SiZyService {
         }
         if (result.getIntValue(RESULT_CODE) == 0) {
             qrydao.clearMdtrtIdForZy(siPatInfo.getPatNo(), siPatInfo.getTimes(), siPatInfo.getLedgerSn(), null);
+            dao.updateResponceType(null, null, p.getInpatientNo(), p.getAdmissTimes(), p.getLedgerSn());
             return ResultVoUtil.success("取消入院登记成功。");
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));