Sfoglia il codice sorgente

踢出时处理医嘱表

lighter 5 mesi fa
parent
commit
6cbd59e316

+ 19 - 4
src/main/java/thyyxxk/webserver/dao/his/inpatient/charge/ForceInAndOutDao.java

@@ -79,15 +79,15 @@ public interface ForceInAndOutDao {
     void transferToYzActOrder(SimplePatient patient);
 
     @Insert("insert into yz_act_order select *from yz_inact_order " +
-            "where inpatient_no=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
+            "where inpatient_no>=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
     void transferToYzActOrderBaby(SimplePatient patient);
 
     @Delete("delete from yz_inact_order where inpatient_no=#{patNo} and admiss_times=#{times}")
-    void deleteYzActOrder(SimplePatient patient);
+    void deleteYzInactOrder(SimplePatient patient);
 
-    @Delete("delete from yz_inact_order where inpatient_no=#{babyNoBegin} " +
+    @Delete("delete from yz_inact_order where inpatient_no>=#{babyNoBegin} " +
             "and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
-    void deleteYzActOrderBaby(SimplePatient patient);
+    void deleteYzInactOrderBaby(SimplePatient patient);
 
     @Select("select count(1) from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times} " +
             "and status_flag>'2' and isnull(group_no,'00')='00' and order_code in " +
@@ -116,6 +116,21 @@ public interface ForceInAndOutDao {
             "where inpatient_no>=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
     void transferToZyInactpatientBaby(SimplePatient patient);
 
+    @Insert("insert into yz_inact_order select * from yz_act_order " +
+            "where inpatient_no=#{patNo} and admiss_times=#{times}")
+    void transferToYzInactOrder(SimplePatient patient);
+
+    @Insert("insert into yz_inact_order select *from yz_act_order " +
+            "where inpatient_no>=#{babyNoBegin} and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
+    void transferToYzInactOrderBaby(SimplePatient patient);
+
+    @Delete("delete from yz_act_order where inpatient_no=#{patNo} and admiss_times=#{times}")
+    void deleteYzActOrder(SimplePatient patient);
+
+    @Delete("delete from yz_act_order where inpatient_no>=#{babyNoBegin} " +
+            "and inpatient_no<=#{babyNoEnd} and admiss_times=#{times}")
+    void deleteYzActOrderBaby(SimplePatient patient);
+
     @Update("update zy_adt set dis_date=#{disDate},orig_ward=#{dept},orig_dept=#{ward},orig_bed=#{bedNo} " +
             "where inpatient_no=#{patNo} and admiss_times=#{times} and trans_times=0")
     void updateZyAdt(SimplePatient patient);

+ 6 - 2
src/main/java/thyyxxk/webserver/service/inpatient/charge/ForceInAndOutService.java

@@ -92,8 +92,8 @@ public class ForceInAndOutService {
         dao.deleteZyInactpatientBaby(patient);
         dao.transferToYzActOrder(patient);
         dao.transferToYzActOrderBaby(patient);
-        dao.deleteYzActOrder(patient);
-        dao.deleteYzActOrderBaby(patient);
+        dao.deleteYzInactOrder(patient);
+        dao.deleteYzInactOrderBaby(patient);
         dao.insertZyWorkLog(patient);
 
         return "患者召回成功。";
@@ -125,6 +125,10 @@ public class ForceInAndOutService {
         dao.deleteZyInactpatient(patient);
         dao.transferToZyInactpatient(patient);
         dao.transferToZyInactpatientBaby(patient);
+        dao.transferToYzInactOrder(patient);
+        dao.transferToYzInactOrderBaby(patient);
+        dao.deleteYzActOrder(patient);
+        dao.deleteYzActOrderBaby(patient);
         dao.updateZyAdt(patient);
         dao.freeZyBedMi(patient);
         dao.deleteZyActpatient(patient);