Ver Fonte

完成ca的患者优化

xiaochan há 4 meses atrás
pai
commit
7b689ade99

+ 3 - 2
src/main/java/thyyxxk/webserver/dao/his/ca/PatientIdCardTypeDao.java

@@ -14,7 +14,8 @@ public interface PatientIdCardTypeDao extends BaseMapper<PatientIdCardType> {
     @Select("select * from patient_id_card_type where pat_no = #{patNo}")
     @Select("select * from patient_id_card_type where pat_no = #{patNo}")
     List<PatientIdCardType> getIdCardTypeList(String patNo);
     List<PatientIdCardType> getIdCardTypeList(String patNo);
 
 
-    @Select("select social_no from a_patient_mi where inpatient_no = #{patNo}")
-    String getPatientIdCard(String patNo);
+    @Select("select social_no as id_card, rtrim(name) as name " +
+            "from a_patient_mi where inpatient_no = #{patNo}")
+    PatientIdCardType getPatientIdCard(String patNo);
 
 
 }
 }

+ 0 - 111
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/YiZhuLuRuDao.java

@@ -359,117 +359,6 @@ public interface YiZhuLuRuDao {
     @Select("select frequ_code from yz_act_order where act_order_no = ${orderNo} ")
     @Select("select frequ_code from yz_act_order where act_order_no = ${orderNo} ")
     String selectParentNo(String orderNo);
     String selectParentNo(String orderNo);
 
 
-    @Select("select cast(cast(act_order_no as decimal) as varchar) " +
-            "from yz_act_order with (NOLOCK) " +
-            "where parent_no = #{orderNo}")
-    List<String> getParentChildOrders(String orderNo);
-
-    @Select("<script>" +
-            "select * " +
-            "from zy_detail_charge with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and ori_detail_sn is null" +
-            "  and charge_fee > 0 " +
-            "  and order_no in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item}" +
-            "</foreach>" +
-            "</script>")
-    List<ZyDetailCharge> getExpenseData(String patNo,
-                                        Integer times,
-                                        List<String> list);
-
-    @Update("<script>" +
-            "update zy_detail_charge " +
-            "set ori_detail_sn = -1 " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and ori_detail_sn is null " +
-            "  and charge_fee > 0 " +
-            "  and order_no in " +
-            "<foreach collection='list' item='item' index='index' open='(' close=')' separator=','>" +
-            " #{item}" +
-            "</foreach>" +
-            "</script>")
-    void updateItemFlag(String patNo,
-                        Integer times,
-                        List<String> list);
-
-    @Update("update yz_act_order " +
-            "set status_flag = '-1', " +
-            "    end_time    = getdate(), " +
-            "    modifier    = #{userCode}, " +
-            "    instruction = #{reasonForCancellation}," +
-            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +
-            "where act_order_no = #{orderNo}")
-    void updateVoidedOrders(String orderNo,
-                            String userCode,
-                            String reasonForCancellation);
-
-    @Update("update yz_yp_zy_order set status_flag = 2 where act_order_no = #{order} and status_flag = 1")
-    void refusalToDispenseMedication(String order);
-
-    @Update("update yz_act_order " +
-            "set status_flag = '-1', " +
-            "    end_time    = getdate(), " +
-            "    modifier    = #{userCode}, " +
-            "    instruction = #{reasonForCancellation}, " +
-            "    order_name = cast('(作废)' + yz_act_order.order_name as char(100))" +
-            "where parent_no = #{orderNo}")
-    void updateChildOrders(String orderNo,
-                           String userCode,
-                           String reasonForCancellation);
-
-    /**
-     * @param deptCode 科室编码
-     * @return 获取医生下面的病区
-     */
-    @Select("select dept " +
-            "from zd_dept_all with (NOLOCK) " +
-            "where small_dept = #{deptCode} " +
-            "  and dept is not null")
-    List<String> getTheDoctorSDepartment(String deptCode);
-
-    /**
-     * @param orderNo 医嘱号
-     * @return 获取已经确认收费的医嘱
-     */
-    @Select("select count(*) " +
-            "from yz_zy_patient_fee with (NOLOCK) " +
-            "where " +
-            "inpatient_no = #{patNo} and " +
-            "admiss_times = #{times} and " +
-            "act_order_no = #{orderNo} and " +
-            "charge_status = '3'")
-    Integer getADoctorSOrderWithADefiniteFee(String patNo,
-                                             Integer times,
-                                             String orderNo);
-
-    @Select("select count(*) " +
-            "from zy_detail_charge with (NOLOCK) " +
-            "where inpatient_no = #{patNo} " +
-            "  and admiss_times = #{times} " +
-            "  and order_no = #{orderNo} " +
-            "  and ori_detail_sn is null" +
-            "  and charge_fee > 0 ")
-    Integer getDetailChargeFee(String patNo,
-                               Integer times,
-                               String orderNo);
-
-    @Update("UPDATE " +
-            "    yz_zy_patient_fee " +
-            "SET charge_status = '2', " +
-            "    op_id         =  #{userid}, " +
-            "    op_date       = GETDATE() " +
-            "WHERE act_order_no = #{orderNo} " +
-            "  AND inpatient_no = #{patNo} " +
-            "  AND admiss_times = #{times} ")
-    void cancelMedicalTechnologyAssuranceFee(String userid,
-                                             String orderNo,
-                                             String patNo,
-                                             Integer times);
-
     /**
     /**
      * 获取,有未确认和未执行的医嘱
      * 获取,有未确认和未执行的医嘱
      *
      *

+ 9 - 11
src/main/java/thyyxxk/webserver/service/ca/CaServer.java

@@ -63,7 +63,6 @@ public class CaServer implements Assertion {
     private final static String TEMP = "temp";
     private final static String TEMP = "temp";
 
 
 
 
-
     RSA idCardRsa = new RSA(privateKey, publicKey);
     RSA idCardRsa = new RSA(privateKey, publicKey);
 
 
     private String getRedisKey(String documentId) {
     private String getRedisKey(String documentId) {
@@ -699,19 +698,19 @@ public class CaServer implements Assertion {
 
 
     public ResultVo<List<PatientIdCardType>> getIdCardTypeList(String patNo) {
     public ResultVo<List<PatientIdCardType>> getIdCardTypeList(String patNo) {
         List<PatientIdCardType> idCardTypeList = patientIdCardTypeDao.getIdCardTypeList(patNo);
         List<PatientIdCardType> idCardTypeList = patientIdCardTypeDao.getIdCardTypeList(patNo);
-        String idCard = patientIdCardTypeDao.getPatientIdCard(patNo);
+        PatientIdCardType patInfo = patientIdCardTypeDao.getPatientIdCard(patNo);
 
 
         if (idCardTypeList == null) {
         if (idCardTypeList == null) {
             idCardTypeList = new ArrayList<>();
             idCardTypeList = new ArrayList<>();
         }
         }
 
 
-        if (StrUtil.isNotBlank(idCard)) {
-            idCardTypeList.add(
+        if (StrUtil.isNotBlank(patInfo.getIdCard())) {
+            idCardTypeList.add(0,
                     PatientIdCardType.builder()
                     PatientIdCardType.builder()
                             .patNo(patNo)
                             .patNo(patNo)
-                            .idCard(idCard)
+                            .idCard(patInfo.getIdCard())
                             .id(TEMP)
                             .id(TEMP)
-                            .name("本人")
+                            .name(patInfo.getName())
                             .caType(1)
                             .caType(1)
                             .build()
                             .build()
             );
             );
@@ -733,14 +732,13 @@ public class CaServer implements Assertion {
             return ResultVoUtil.success();
             return ResultVoUtil.success();
         }
         }
 
 
-
         data.getInsert().forEach(item -> {
         data.getInsert().forEach(item -> {
             item.setId(IdUtil.fastSimpleUUID());
             item.setId(IdUtil.fastSimpleUUID());
             item.setPatNo(data.getPatNo());
             item.setPatNo(data.getPatNo());
-            if (StrUtil.isNotBlank(item.getIdCard())) {
+            if (StrUtil.isBlank(item.getIdCard())) {
                 throw new BizException(ExceptionEnum.NULL_POINTER, "身份证不能为空");
                 throw new BizException(ExceptionEnum.NULL_POINTER, "身份证不能为空");
             }
             }
-            if (StrUtil.isNotBlank(item.getName())) {
+            if (StrUtil.isBlank(item.getName())) {
                 throw new BizException(ExceptionEnum.NULL_POINTER, "名字不能为空");
                 throw new BizException(ExceptionEnum.NULL_POINTER, "名字不能为空");
             }
             }
 
 
@@ -751,10 +749,10 @@ public class CaServer implements Assertion {
             if (TEMP.equals(item.getId())) {
             if (TEMP.equals(item.getId())) {
                 return;
                 return;
             }
             }
-            if (StrUtil.isNotBlank(item.getIdCard())) {
+            if (StrUtil.isBlank(item.getIdCard())) {
                 throw new BizException(ExceptionEnum.NULL_POINTER, "身份证不能为空");
                 throw new BizException(ExceptionEnum.NULL_POINTER, "身份证不能为空");
             }
             }
-            if (StrUtil.isNotBlank(item.getName())) {
+            if (StrUtil.isBlank(item.getName())) {
                 throw new BizException(ExceptionEnum.NULL_POINTER, "名字不能为空");
                 throw new BizException(ExceptionEnum.NULL_POINTER, "名字不能为空");
             }
             }
             item.setPatNo(data.getPatNo());
             item.setPatNo(data.getPatNo());