Browse Source

开出诊疗项目校验年龄和性别

‘chenzhilei’ 1 month ago
parent
commit
7f4e4490de

+ 6 - 0
src/main/java/cn/hnthyy/thmz/entity/his/zd/ZdChargeItem.java

@@ -150,4 +150,10 @@ public class ZdChargeItem {
     private String zdChargeBaClass;
     // 重点监测项目 0:否 1:是
     private String focusMonitorFlag;
+    // 最小适用年龄
+    private String minAgeRestriction;
+    // 最大适用年龄
+    private String maxAgeRestriction;
+    // 适用性别(1男2女)
+    private String genderRestriction;
 }

+ 16 - 5
src/main/java/cn/hnthyy/thmz/mapper/his/zd/ZdChargeItemMapper.java

@@ -105,7 +105,7 @@ public interface ZdChargeItemMapper {
             "charge_unit,percent_group_zy,percent_group_mz,rtrim(case  when in_out_flag ='' then null else in_out_flag end) in_out_flag,n_code yn_code,class_code,s_code bz_code,discription,rtrim(del_flag) del_flag, " +
             "rtrim(yp_flag) yp_flag,bill_item_code,rtrim(xnh_flag) xnh_flag,add_date,hnsyb_code,hnsyb_name,xnh_code,xnh_name,xnh_ratio,xnh_quotamoney,rtrim(xnh_status) xnh_status," +
             "yb_flag_new,yb_comment_new,charge_amount_lwg,percent_group_1  percent_group1,yb_name,yb_comment,yb_bl_new,e_code yb_code,cl_code,co,xl_code,effective_time,effective_price,update_id," +
-            "update_time,national_code,national_name,descriptions,exclude_content,connotation,approval_number,selfpay_prop,group_no,zd_charge_ba_class,focus_monitor_flag " +
+            "update_time,national_code,national_name,descriptions,exclude_content,connotation,approval_number,selfpay_prop,group_no,zd_charge_ba_class,focus_monitor_flag,min_age_restriction,max_age_restriction,gender_restriction " +
             " from zd_charge_item  WITH(NOLOCK)  where  code = #{code,jdbcType=VARCHAR} ")
     //     " and (del_flag != 1 or del_flag is null) " )
     ZdChargeItem selectZdChargeItemByCode(@Param("code") String code);
@@ -153,10 +153,12 @@ public interface ZdChargeItemMapper {
      */
     @Insert("INSERT INTO zd_charge_item ( code, name, charge_amount, percentag1, percentag2, percentag3, percentag4, percentag5, self_flag, separate_flag," +
             " suppress_flag, py_code, d_code, del_flag, charge_unit, percent_group_mz, class_code, e_code, s_code, add_date, xnh_code, xnh_name,audit_code," +
-            "bill_item_mz,bill_item_zy,exec_unit,discription,cl_code,co,oper_id,xl_code,yb_comment,national_code,national_name,descriptions,exclude_content,connotation,approval_number,group_no,zd_charge_ba_class,focus_monitor_flag,hnsyb_code ) VALUES (" +
+            "bill_item_mz,bill_item_zy,exec_unit,discription,cl_code,co,oper_id,xl_code,yb_comment,national_code,national_name,descriptions,exclude_content," +
+            "connotation,approval_number,group_no,zd_charge_ba_class,focus_monitor_flag,min_age_restriction,max_age_restriction,gender_restriction,hnsyb_code ) VALUES (" +
             " #{code}, #{name}, #{chargeAmount}, #{percentag1}, #{percentag2}, #{percentag3}, #{percentag4}, #{percentag5}, #{selfFlag}, #{separateFlag}, " +
             "#{suppressFlag}, #{pyCode}, #{wbCode}, #{delFlag}, #{chargeUnit}, #{percentGroupMz}, #{classCode}, #{ybCode}, #{bzCode}, #{addDate}, #{xnhCode}, #{xnhName}" +
-            ",#{auditCode},#{billItemMz},#{billItemZy},#{execUnit} ,#{discription}, #{clCode},#{co},#{operId},#{xlCode},#{ybComment},#{nationalCode},#{nationalName},#{descriptions},#{excludeContent},#{connotation},#{approvalNumber},#{groupNo},#{zdChargeBaClass},#{focusMonitorFlag},#{hnsybCode} )")
+            ",#{auditCode},#{billItemMz},#{billItemZy},#{execUnit} ,#{discription}, #{clCode},#{co},#{operId},#{xlCode},#{ybComment},#{nationalCode},#{nationalName}," +
+            "#{descriptions},#{excludeContent},#{connotation},#{approvalNumber},#{groupNo},#{zdChargeBaClass},#{focusMonitorFlag},#{minAgeRestriction},#{maxAgeRestriction},#{genderRestriction},#{hnsybCode} )")
     int insertZdChargeItem(ZdChargeItem zdChargeItem);
 
 
@@ -295,9 +297,18 @@ public interface ZdChargeItemMapper {
             "<when test='focusMonitorFlag!=null'>",
             ",focus_monitor_flag =#{focusMonitorFlag}",
             "</when>",
+            "<when test='minAgeRestriction!=null'>",
+            ",min_age_restriction =#{minAgeRestriction}",
+            "</when>",
+            "<when test='maxAgeRestriction!=null'>",
+            ",max_age_restriction =#{maxAgeRestriction}",
+            "</when>",
+            "<when test='genderRestriction!=null'>",
+            ",gender_restriction =#{genderRestriction}",
+            "</when>",
             "</trim>",
             "</script>"})
-    int updateZdChargeItem(ZdChargeItem zdChargeItem);
+    int  updateZdChargeItem(ZdChargeItem zdChargeItem);
 
 
     /**
@@ -344,7 +355,7 @@ public interface ZdChargeItemMapper {
             "<when test='pageSize!=null'>",
             " top ${pageSize} ",
             "</when>",
-            "  code=rtrim(code),name,specification=charge_unit,chargeAmount=charge_amount,manufactory=yb_comment,execUnit=exec_unit,groupNo='00' ,type=3,descriptions,selfpayProp=selfpay_prop,connotation,nationalCode=national_code  ",
+            "  code=rtrim(code),name,specification=charge_unit,chargeAmount=charge_amount,manufactory=yb_comment,execUnit=exec_unit,groupNo='00' ,type=3,descriptions,selfpayProp=selfpay_prop,connotation,nationalCode=national_code,minAgeRestriction=min_age_restriction,maxAgeRestriction=max_age_restriction,genderRestriction=gender_restriction ",
             "    FROM zd_charge_item WITH(NOLOCK)   ",
             "where del_flag=0 and  class_code in ('B','C', 'E', 'G', 'F','I','J') and isnull(group_no,'00') <![CDATA[<>]]> '91' ",
             "<when test='commonParams!=null'>",

+ 7 - 1
src/main/resources/static/js/mz/charge_detail.js

@@ -74,7 +74,8 @@ $(function () {
                 "discription": $("#discriptionParams").val(),"clCode": $("#clCodeParams").val(),"co": $("#coParams").val(),"xlCode": $("#xlCodeParams").val(),
                 "code": $("#code").val(),"ybComment": $("#ybCommentParams").val(),"nationalCode": $("#nationalCodeParams").val(),"nationalName": $("#nationalNameParams").val(),"hnsybCode": $("#hnsybCodeParams").val(),
                 "descriptions": $("#descriptionsParams").val(),"excludeContent": $("#excludeContentParams").val(),"connotation": $("#connotationParams").val(),
-                "approvalNumber": $("#approvalNumberParams").val(),"groupNo":$("#groupNoParams").val(),"zdChargeBaClass":$("#zdChargeBaClassParams").val(),"focusMonitorFlag":$("#focusMonitorFlag").val()}),
+                "approvalNumber": $("#approvalNumberParams").val(),"groupNo":$("#groupNoParams").val(),"zdChargeBaClass":$("#zdChargeBaClassParams").val(),"focusMonitorFlag":$("#focusMonitorFlag").val()
+                ,"genderRestriction":$("#genderRestriction").val(),"minAgeRestriction":$("#minAgeRestriction").val(),"maxAgeRestriction":$("#maxAgeRestriction").val()}),
             success: function (res) {
                 if (res == '401' || res == 401) {
                     window.location.href = '/thmz/login/view'
@@ -802,6 +803,10 @@ function updateZdChargeItem(code) {
                 $("#excludeContentParams").val(res.data.excludeContent);
                 $("#connotationParams").val(res.data.connotation);
                 $("#approvalNumberParams").val(res.data.approvalNumber);
+                $("#maxAgeRestriction").val(res.data.maxAgeRestriction);
+                $("#minAgeRestriction").val(res.data.minAgeRestriction);
+                $("#genderRestriction").val(res.data.genderRestriction);
+                $('#genderRestriction').selectpicker('refresh');
                 $('#coParams').selectpicker('val', res.data.co);
                 if(res.data.co==null || res.data.co==""){
                     $('#coParams').selectpicker('val', 0);
@@ -818,6 +823,7 @@ function updateZdChargeItem(code) {
                 $('#zdChargeBaClassParams').selectpicker('refresh');
                 $("#focusMonitorFlag").val(!stringNotBlank(res.data.focusMonitorFlag)  ? '0' : res.data.focusMonitorFlag );
                 $('#focusMonitorFlag').selectpicker('refresh');
+
                 $("#chargeDetailModal").modal();
             } else {
                 errorMesage(res);

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

@@ -8486,6 +8486,32 @@ function checkYpInfo(code, serial, groupNo, needNotice, orderNo, type) {
     });
 }
 
+/**
+ * 项目限制提示
+ * @param res
+ * @param projectDesc
+ */
+function checkProjectSelfInfo(row) {
+//    console.log("checkProjectSelfInfo",row,ele)
+    var code = 0;
+    var age = currentPatientInfo.age;
+    var sex = currentPatientInfo.sex;
+    console.log("currentPatientInfo",currentPatientInfo)
+    if (row.genderRestriction && row.genderRestriction != 0 && sex != row.genderRestriction) {
+        warningMesageSimaple('项目'+row.name+'要求性别为'+row.genderRestriction == '1'?'男':'女'+'请重新选择!');
+        code = 1;
+    }
+    if (row.maxAgeRestriction && age > row.maxAgeRestriction) {
+        warningMesageSimaple('项目'+row.name+'要求年龄小于或等于'+row.maxAgeRestriction+'岁,请重新选择!');
+        code = 1;
+    }
+    if (row.minAgeRestriction && age < row.minAgeRestriction) {
+        warningMesageSimaple('项目'+row.name+'要求年龄大于或等于'+row.minAgeRestriction+'岁,请重新选择!');
+        code = 1;
+    }
+    return code;
+}
+
 /**
  * 药品与项目自费信息提示
  * @param res
@@ -8999,6 +9025,11 @@ function loadZlItemList(event) {
             };
         },
         onClickRow: function (row, $element) {
+            //判断是否验证失败,0通过1失败
+//            console.log("checkProjectSelfInfo(row)",checkProjectSelfInfo(row))
+            if(checkProjectSelfInfo(row) == 1){
+                return;
+            }
             hintProjectSelfPayInfo(row.selfpayProp, "诊疗");
             $('#zlItem').webuiPopover('hide');
             $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中

+ 28 - 0
src/main/resources/templates/mz/charge_detail.html

@@ -338,6 +338,34 @@
                                     </select>
                                 </div>
                             </div>
+                            <div class="item form-group">
+                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="genderRestriction">适用性别
+                                </label>
+                                <div class="col-md-6 col-sm-6 col-xs-12">
+                                    <select class="form-control selectpicker show-tick"
+                                            id="genderRestriction" title="请选择">
+                                        <option value="0"></option>
+                                        <option value="1">男</option>
+                                        <option value="2">女</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="item form-group">
+                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="minAgeRestriction">最小适用年龄
+                                </label>
+                                <div class="col-md-6 col-sm-6 col-xs-12">
+                                    <input type="text" id="minAgeRestriction"
+                                           class="form-control col-md-7 col-xs-12">
+                                </div>
+                            </div>
+                            <div class="item form-group">
+                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maxAgeRestriction">最大适用年龄
+                                </label>
+                                <div class="col-md-6 col-sm-6 col-xs-12">
+                                    <input type="text" id="maxAgeRestriction"
+                                           class="form-control col-md-7 col-xs-12">
+                                </div>
+                            </div>
                         </form>
                     </div>
                     <div class="modal-footer">