Ver Fonte

关联医嘱操作。

DESKTOP-0GD05B0\Administrator há 2 anos atrás
pai
commit
0660d12c42

+ 5 - 0
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/YizhuLuRuController.java

@@ -238,4 +238,9 @@ public class YizhuLuRuController {
         return server.saveTheThirdLevelDoctor(param);
     }
 
+    @PostMapping("/associateOrders")
+    public ResultVo<String> associateOrders(@RequestBody XinZhenYiZhu param) {
+        return server.associateOrders(param);
+    }
+
 }

+ 27 - 18
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/EmrPatientDao.java

@@ -57,7 +57,7 @@ public interface EmrPatientDao {
     void updateCreatedTemplate(EmrPatientData param);
 
 
-    @Select("select emr_category_code,pat_no,times from emr_patient_data where emr_document_id = #{id} ")
+    @Select("select emr_category_code,pat_no,times,create_id from emr_patient_data where emr_document_id = #{id} ")
     EmrPatientData getCategoryCodeByDocumentId(String id);
 
     @Update("update emr_patient_data " +
@@ -126,24 +126,33 @@ public interface EmrPatientDao {
     List<String> getDocumentIdByPatietn(String patNo, int times, String categoryCode);
 
 
-    @Select("select rtrim(name) as xm,dis_date as cysj,sex as xb," +
-            "       (select DATEDIFF(yy, birth_date, GETDATE()) from a_patient_mi b where b.inpatient_no = a.inpatient_no)    as nl, " +
+    @Select("select rtrim(a.name)                                                                                          as xm, " +
+            "       dis_date                                                                                               as cysj, " +
+            "       a.sex                                                                                                  as xb, " +
+            "       (select DATEDIFF(yy, birth_date, GETDATE()) from a_patient_mi b where b.inpatient_no = a.inpatient_no) as nl, " +
             "       (select sum(charge_fee) " +
-            "        from zy_detail_charge c " +
-            "        where c.inpatient_no = a.inpatient_no " +
-            "          and c.admiss_times = a.admiss_times " +
-            "          and ledger_sn = #{ledgerSn}) as zfy, " +
-            "       datediff(day, admiss_date, isnull(dis_date, getdate())) as sjzyts, " +
-            "       ''                                                                                        as rybq, " +
-            "       ''                                                                                        as rytj, " +
-            "       ''                                                                                        as lyfs, " +
-            "       (select insutype from t_si_setlinfo where inpatient_no = pat_no and admiss_times = times) as insur_type_id, " +
-            "       ''                                                                                        as xsecstz, " +
-            "       ''                                                                                        as xserytz, " +
-            "       ''                                                                                        as bzyzsnl " +
-            "from zy_actpatient a " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times}")
+            "        from zy_detail_charge " +
+            "        where zy_detail_charge.inpatient_no = a.inpatient_no " +
+            "          and zy_detail_charge.admiss_times = a.admiss_times " +
+            "          and ledger_sn = #{ledgerSn})                                                                                  as zfy, " +
+            "       datediff(day, admiss_date, isnull(dis_date, getdate()))                                                as sjzyts, " +
+            "       condition_code                                                                                         as rybq, " +
+            "       route_of_admission                                                                                     as rytj, " +
+            "       ''                                                                                                     as lyfs, " +
+            "       (select insutype " +
+            "        from t_si_setlinfo " +
+            "        where a.inpatient_no = pat_no " +
+            "          and admiss_times = times)                                                                           as insur_type_id, " +
+            "       ''                                                                                                     as xsecstz, " +
+            "       ''                                                                                                     as xserytz, " +
+            "       ''                                                                                                     as bzyzsnl " +
+            "from zy_actpatient a, " +
+            "     a_patient_mi b, " +
+            "     mz_zy_req c " +
+            "where a.inpatient_no = #{patNo} " +
+            "  and admiss_times = #{times} " +
+            "  and a.inpatient_no = b.inpatient_no " +
+            "  and b.mz_no = c.patient_id")
     Map<String, String> drgPatientInfo(String patNo, int times, int ledgerSn);
 
 

+ 12 - 4
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -329,7 +329,8 @@ public interface YiZhuLuRuDao {
             "order_time," +
             "rtrim(serial) as serial," +
             "start_time," +
-            "ward_code " +
+            "ward_code," +
+            "parent_no " +
             "from yz_act_order " +
             "where act_order_no = #{orderNo} ")
     XinZhenYzActOrder getActOrderNoOne(String orderNo);
@@ -785,9 +786,6 @@ public interface YiZhuLuRuDao {
     List<GetDropdownBox> getCostFreeDosing(String code);
 
 
-
-
-
     @Select("SELECT a.code code, " +
             "       a.name name " +
             "FROM zd_unit_code a with (NOLOCK), " +
@@ -1563,4 +1561,14 @@ public interface YiZhuLuRuDao {
             "</script>")
     void insertDetailedMedicineList(Integer pageNo, XinZhenYiZhu patInfo, String userCode, String groupNo, List<XinZhenYzActOrder> list);
 
+
+    @Update("<script>" +
+            "update yz_act_order set parent_no = #{actOrderNo} where act_order_no in " +
+            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
+            "#{item}" +
+            "</foreach>" +
+            " and group_no &lt;&gt; '00' and status_flag = '1' " +
+            "</script>")
+    void associateOrders(List<BigDecimal> list, String actOrderNo);
+
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/yizhuluru/XinZhenYiZhu.java

@@ -4,6 +4,7 @@ import lombok.Data;
 import thyyxxk.webserver.service.PublicServer;
 
 import javax.validation.constraints.NotNull;
+import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 
@@ -108,6 +109,11 @@ public class XinZhenYiZhu {
      */
     private String groupNo;
 
+    /**
+     * 医嘱关联数组
+     */
+    private List<BigDecimal> associatedGroup;
+
 
     @NotNull(message = "上传数据不能为空")
     private List<XinZhenYzActOrder> list;

+ 1 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/EmrServer.java

@@ -260,6 +260,7 @@ public class EmrServer {
      * @return 返回数据
      */
     public JSONArray getEmrData(String panNo, Integer times, EmrType etType) {
+        // 查询这个病历的 唯一 id
         List<String> idList = dao.getDocumentIdByPatietn(panNo, times, etType.getName());
         JSONArray returnArray = new JSONArray();
         if (ListUtil.isBlank(idList)) {
@@ -276,7 +277,6 @@ public class EmrServer {
                 surgicalSequencing.put(key, jsonObject);
             }
         }
-
         if (!surgicalSequencing.isEmpty()) {
             for (Map.Entry<String, JSONObject> item : surgicalSequencing.entrySet()) {
                 returnArray.add(item.getValue());

+ 10 - 0
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/YiZhuLuRuServer.java

@@ -1607,5 +1607,15 @@ public class YiZhuLuRuServer {
         return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION);
     }
 
+    public ResultVo<String> associateOrders(XinZhenYiZhu param) {
+        log.info("数据:{}", JSON.toJSONString(param));
+        XinZhenYzActOrder order = dao.getActOrderNoOne(param.getActOrderNo());
+        if (order.getParentNo() != null) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "操作失败,父医嘱不能为子医嘱。");
+        }
+        dao.associateOrders(param.getAssociatedGroup(), param.getActOrderNo());
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "关联成功。");
+    }
+
 
 }