Browse Source

1、优化门诊医生处方编辑计算总数量错误。
2、门诊统筹医生选择不适用门诊统筹,窗口不能进行报销

hurugang 3 years ago
parent
commit
ebdc691c1c

+ 10 - 9
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1880,13 +1880,14 @@ public class MzChargeDetailController {
                 List<String> selfPayList = new ArrayList<>();
                 results.put("selfPayList", selfPayList);
                 StringBuilder stringBuilder = new StringBuilder();
-                int patientDuringSiSettle = tsmzService.isPatientDuringSiSettle(mzChargeDetail.getPatientId());
-                while (patientDuringSiSettle != 0) {
-                    Thread.sleep(1000);
-                    patientDuringSiSettle = tsmzService.isPatientDuringSiSettle(mzChargeDetail.getPatientId());
-                }
-                int countYbZf = mzPatientMiService.queryCountYbZf(mzChargeDetail.getPatientId(), mzChargeDetail.getTimes());
-                if (countYbZf > 0) {
+//                int patientDuringSiSettle = tsmzService.isPatientDuringSiSettle(mzChargeDetail.getPatientId());
+//                while (patientDuringSiSettle != 0) {
+//                    Thread.sleep(1000);
+//                    patientDuringSiSettle = tsmzService.isPatientDuringSiSettle(mzChargeDetail.getPatientId());
+//                }
+                Clinic clinic= clinicService.queryByPatientIdAndTimesAndReceiptNo(patientId,times,0);
+                Integer countYbZf = clinic==null?YesNoEnum.NO.code:clinic.getZgmztczf();
+                if (YesNoEnum.YES.code.equals(countYbZf)) {
                     MzVisitTable mzVisitTable = mzVisitTableService.queryByPatientIdAndTimes(patientId, times);
                     if (mzVisitTable == null) {
                         throw new MzException("病人就诊记录不存在!");
@@ -1997,8 +1998,8 @@ public class MzChargeDetailController {
      * @param mz
      * @return
      */
-    private boolean setPaySelfListForUnpaid(Map<String, Object> results, List<String> selfPayList, StringBuilder stringBuilder, int countYbZf, MzChargeDetail mz) {
-        if (countYbZf > 0) {
+    private boolean setPaySelfListForUnpaid(Map<String, Object> results, List<String> selfPayList, StringBuilder stringBuilder, Integer countYbZf, MzChargeDetail mz) {
+        if (YesNoEnum.YES.code.equals(countYbZf)) {
             if (Constants.YJ_GROUP_NO.equals(mz.getGroupNo())) {
                 ZdChargeItem zdChargeItem = zdChargeItemService.queryZdChargeItemByCode(mz.getChargeItemCode());
                 if (zdChargeItem == null) {

+ 4 - 0
src/main/java/cn/hnthyy/thmz/entity/thmz/Clinic.java

@@ -120,4 +120,8 @@ public class Clinic extends PageParams implements Serializable {
 	 * 年龄
 	 */
 	private String age;
+	/**
+	 * 是否使用职工统筹支付 1是 0否
+	 */
+	private Integer zgmztczf;
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/zd/ZdIcdCodeMapper.java

@@ -65,7 +65,7 @@ public interface ZdIcdCodeMapper {
      * @return
      */
     @Select({"<script>",
-            "SELECT rtrim(yb_code) code,rtrim(yb_name) name ",
+            "SELECT DISTINCT rtrim(yb_code) code,rtrim(yb_name) name ",
             " from dbo.zd_icd_code_new WITH(NOLOCK)  where  yb_code is not null and yb_name is not null ",
             "<when test='codes!=null'>",
             " and yb_code in ",

+ 6 - 6
src/main/java/cn/hnthyy/thmz/mapper/thmz/ClinicMapper.java

@@ -14,8 +14,8 @@ public interface ClinicMapper {
      * @param clinic
      * @return
      */
-    @Insert("INSERT IGNORE INTO t_clinic(patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag) VALUES " +
-            "(#{patientId}, #{patientName}, #{times}, #{receiptNo},#{deptCode},#{doctorCode},#{icdCode},#{icdText},#{opId},#{opDay},#{firstOrNot},#{clinicStatus},#{jzFlag})")
+    @Insert("INSERT IGNORE INTO t_clinic(patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag,zgmztczf) VALUES " +
+            "(#{patientId}, #{patientName}, #{times}, #{receiptNo},#{deptCode},#{doctorCode},#{icdCode},#{icdText},#{opId},#{opDay},#{firstOrNot},#{clinicStatus},#{jzFlag},#{zgmztczf})")
     @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
     int insertClinic(Clinic clinic);
 
@@ -28,9 +28,9 @@ public interface ClinicMapper {
      */
     @Insert({
             "<script>",
-            "INSERT INTO  t_clinic(patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag) VALUES ",
+            "INSERT INTO  t_clinic(patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag,zgmztczf) VALUES ",
             "<foreach collection='clinicList' item='item' index='index' separator=','>",
-            " (#{item.patientId}, #{item.patientName}, #{item.times}, #{item.receiptNo},#{item.deptCode},#{item.doctorCode},#{item.icdCode},#{item.icdText},#{item.opId},#{item.opDay},#{item.firstOrNot},#{item.clinicStatus},#{item.jzFlag}) ",
+            " (#{item.patientId}, #{item.patientName}, #{item.times}, #{item.receiptNo},#{item.deptCode},#{item.doctorCode},#{item.icdCode},#{item.icdText},#{item.opId},#{item.opDay},#{item.firstOrNot},#{item.clinicStatus},#{item.jzFlag},#{item.zgmztczf}) ",
             "</foreach>",
             "</script>"
     })
@@ -43,7 +43,7 @@ public interface ClinicMapper {
      * @param id
      * @return
      */
-    @Select("select id,patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag from t_clinic where id=#{id,jdbcType=BIGINT}")
+    @Select("select id,patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag,zgmztczf from t_clinic where id=#{id,jdbcType=BIGINT}")
     Clinic selectById(@Param("id") Long id);
 
 
@@ -54,7 +54,7 @@ public interface ClinicMapper {
      * @return
      */
     @Select({"<script>" +
-            "select a.id,patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag from t_clinic a join  (" +
+            "select a.id,patient_id, patient_name, times, receipt_no,dept_code,doctor_code,icd_code,icd_text,op_id,op_day,first_or_not,clinic_status,jz_flag,zgmztczf from t_clinic a join  (" +
             "select id from t_clinic where 1=1" +
             "<when test='beginDate!=null'>" +
             " and op_day  <![CDATA[>=]]>#{beginDate} " +

+ 9 - 7
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -301,13 +301,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             returnMzChargeDetail.setNotDiscountAmount(returnMzChargeDetail.getNotDiscountAmount().add((md.getOrigPrice() == null ? BigDecimal.ZERO : md.getOrigPrice()).multiply(BigDecimal.valueOf(md.getQuantity() == null ? 1D : md.getQuantity())).multiply(BigDecimal.valueOf(md.getDrugWin() == null ? 1D : md.getDrugWin()))));
         }
         returnMzChargeDetail.setDiscountAmount(returnMzChargeDetail.getNotDiscountAmount().subtract(returnMzChargeDetail.getAmount()).setScale(1, BigDecimal.ROUND_HALF_UP));
-        Map<String, Object> insuinfoMap = tsmzService.queryInsuinfo(Constants.BRZZJF_CODE, mzChargeDetail.getPatientId());
-        if (insuinfoMap != null && insuinfoMap.size() > 0) {
-            if (Integer.valueOf(0).equals(insuinfoMap.get("code"))) {
-                returnMzChargeDetail.setCountYbZf(1);
-            }
-        }
-
+        Clinic clinic=clinicMapper.selectByPatientIdAndTimesAndReceiptNo(mzChargeDetail.getPatientId(),mzChargeDetail.getTimes(),0);
+        returnMzChargeDetail.setCountYbZf(clinic==null?0:clinic.getZgmztczf());
+//        Map<String, Object> insuinfoMap = tsmzService.queryInsuinfo(Constants.BRZZJF_CODE, mzChargeDetail.getPatientId());
+//        if (insuinfoMap != null && insuinfoMap.size() > 0) {
+//            if (Integer.valueOf(0).equals(insuinfoMap.get("code"))) {
+//                returnMzChargeDetail.setCountYbZf(1);
+//            }
+//        }
         return returnMzChargeDetail;
     }
 
@@ -1149,6 +1150,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         clinic.setIcdText(realIcdText != null ? mzPrescriptionVo.getIcdText() : mzPrescriptionVo.getMzBlRecord().getTentativeDiagnosis());
         clinic.setClinicStatus(ClinicStatusEnum.HAD_CLINIC.code);
         clinic.setJzFlag(JzFlag);
+        clinic.setZgmztczf(mzPrescriptionVo.getZgmztczf());
         clinicMapper.insertClinic(clinic);
         if (mzPrescriptionVo.getZgmztczf() != null && YesNoEnum.YES.code.equals(mzPrescriptionVo.getZgmztczf())) {
             tsmzService.directRegistrationAsync(opId, mzPatientMi.getPatientId(), times, mzPrescriptionVo.getReadCardResult(), mzPrescriptionVo.getGrzhzf(), mzPrescriptionVo.getReadCardType());

+ 1 - 0
src/main/resources/otherSource/thyy_mz_system.sql

@@ -350,6 +350,7 @@ CREATE TABLE `t_clinic`  (
   `first_or_not` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '初诊或者复诊 0-初诊  1-复诊',
   `clinic_status` int(11) NULL DEFAULT 0 COMMENT '就诊状态  0 已挂号 1-挂号已接诊  2 -已退号  3-候诊 4-接诊中 5-已接诊未缴费 6-已缴费 7-已退费',
   `jz_flag` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '0' COMMENT '急诊标记 1 急诊 0非急诊',
+   `zgmztczf` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否使用职工统筹支付 1是 0否',
   PRIMARY KEY (`id`) USING BTREE,
   UNIQUE INDEX `_t_clinic_first_index`(`patient_id`, `times`, `receipt_no`) USING BTREE,
   INDEX `t_clinic_op_date_index`(`op_day`) USING BTREE COMMENT '操作时间索引',

+ 1 - 0
src/main/resources/static/js/mz/clinic.js

@@ -4154,6 +4154,7 @@ function editWesternMedicine(obj) {
                             $('#tryResult').selectpicker('refresh');
                         }
                     }
+                    $("#packSize").val(res.data.packSize);
                     //厂家名称
                     $("#manufactoryName").val(res.data.manufactoryName);
                     //规格

+ 1 - 1
src/main/resources/static/js/mz/toll_administration.js

@@ -407,7 +407,7 @@ function initFeeTable() {
                     str += '<button type="button" class="registration-no-color-foot-button" title="诊断查询" onclick="diagnoseQuery(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-search-minus"></i></button>';
                     var payMarkGroup = getIndex("pay_mark_group");
                     if (payMarkGroup == 0) {
-                        if (row.countYbZf > 0) {
+                        if (row.countYbZf!=null && row.countYbZf==1) {
                             str += '<button type="button" class="registration-no-color-foot-button"title="医保读卡" onclick="mztczfSiReadCardTypeModel()"><i class="fa fa-newspaper-o"></i></button>';
                             str += '<button type="button" class="registration-no-color-foot-button"title="医保结算" onclick="directRegistration(\'' + row.patientId + '\',' + row.times + ')"><i class="fa fa-credit-card"></i></button>';
                         }