Browse Source

门诊诊断支持不超过6个

hurugang 3 years ago
parent
commit
8859648bca

+ 8 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzVisitTable.java

@@ -60,4 +60,12 @@ public class MzVisitTable {
     private String dwmc;
     //症状
     private Integer ghSerialNo;
+    /**
+     * 新的诊断编码,老的诊断编码太短了长度
+     */
+    private String 	icdCodeNew;
+    /**
+     * 新的诊断名称,老的诊断编码太短了长度
+     */
+    private String 	icdTextNew;
 }

+ 10 - 9
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzVisitTableMapper.java

@@ -20,9 +20,9 @@ public interface MzVisitTableMapper {
      * @param patientId 病人编号
      * @return
      */
-    @Select("select top 1rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
+    @Select("select top 1rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
             "receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
-            "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
+            "first_or_not,receive_flag,sick_date,icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
             "patient_id= #{patientId,jdbcType=VARCHAR} order by times desc")
     MzVisitTable selectLastMzVisitTableByPatientId(@Param("patientId") String patientId,@Param("tableName") String tableName);
 
@@ -32,11 +32,12 @@ public interface MzVisitTableMapper {
      * @return
      */
     @Insert("INSERT INTO mz_visit_table(patient_id,times,visit_dept_code,doctor_code,visit_date,icd_code,receipt_no,order_no,req_fee,cancel_mark,error_mark,op_id,op_day,req_dept_code,req_doctor," +
-            "windows_no,first_or_not,receive_flag,sick_date,icd_text,symptom,jz_flag,responce_type,dwmc,gh_serial_no)" +
+            "windows_no,first_or_not,receive_flag,sick_date,icd_text,symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new)" +
             " VALUES (#{patientId,jdbcType=CHAR},#{times,jdbcType=INTEGER},#{visitDeptCode,jdbcType=CHAR},#{doctorCode,jdbcType=CHAR},#{visitDate,jdbcType=TIMESTAMP},#{icdCode,jdbcType=CHAR}," +
             "#{receiptNo,jdbcType=TINYINT},#{orderNo,jdbcType=TINYINT},#{reqFee,jdbcType=DOUBLE},#{cancelMark,jdbcType=INTEGER},#{errorMark,jdbcType=INTEGER},#{opId,jdbcType=VARCHAR}," +
             "#{opDay,jdbcType=TIMESTAMP},#{reqDeptCode,jdbcType=INTEGER},#{reqDoctor,jdbcType=INTEGER},#{windowsNo,jdbcType=TINYINT},#{firstOrNot,jdbcType=CHAR}," +
-            "#{receiveFlag,jdbcType=CHAR},#{sickDate,jdbcType=TIMESTAMP},#{icdText,jdbcType=CHAR},#{symptom,jdbcType=VARCHAR},#{jzFlag,jdbcType=CHAR},#{responceType,jdbcType=VARCHAR},#{dwmc,jdbcType=VARCHAR},#{ghSerialNo,jdbcType=INTEGER})")
+            "#{receiveFlag,jdbcType=CHAR},#{sickDate,jdbcType=TIMESTAMP},#{icdText,jdbcType=CHAR},#{symptom,jdbcType=VARCHAR},#{jzFlag,jdbcType=CHAR}" +
+            ",#{responceType,jdbcType=VARCHAR},#{dwmc,jdbcType=VARCHAR},#{ghSerialNo,jdbcType=INTEGER},#{icdCodeNew}, #{icdTextNew})")
     int insertMzVisitTable(MzVisitTable mzVisitTable);
 
 
@@ -73,9 +74,9 @@ public interface MzVisitTableMapper {
      *
      * @return
      */
-    @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
+    @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
             "receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
-            "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
+            "first_or_not,receive_flag,sick_date,icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
             "patient_id= #{patientId,jdbcType=VARCHAR} and times = #{times}")
     MzVisitTable selectByPatientIdAndTimes(@Param("patientId") String patientId,@Param("times") Integer times,@Param("tableName") String tableName);
 
@@ -88,9 +89,9 @@ public interface MzVisitTableMapper {
      * @param tableName
      * @return
      */
-    @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,rtrim(icd_code) icd_code," +
+    @Select("select rtrim(patient_id) patient_id,times,rtrim(visit_dept_code) visit_dept_code,rtrim(doctor_code) doctor_code,visit_date,icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code))," +
             "receipt_no,order_no,req_fee,cancel_mark,error_mark,rtrim(op_id) op_id,op_day,rtrim(req_dept_code) req_dept_code,rtrim(req_doctor) req_doctor,windows_no," +
-            "first_or_not,receive_flag,sick_date,rtrim(icd_text) icd_text,rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no from ${tableName} WITH(NOLOCK) where " +
+            "first_or_not,receive_flag,sick_date, icd_text=isnull(nullif(icd_text_new,''), rtrim(icd_text)),rtrim(symptom) symptom,jz_flag,responce_type,dwmc,gh_serial_no,icd_code_new,icd_text_new from ${tableName} WITH(NOLOCK) where " +
             "op_day>= #{beginTime} and op_day < #{endTime}")
     List<MzVisitTable> selectByDateRages(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("tableName") String tableName);
 
@@ -99,7 +100,7 @@ public interface MzVisitTableMapper {
      * @param tableName
      * @return
      */
-    @Select("select rtrim(icd_code) icd_code,count(1) num from ${tableName} WITH(NOLOCK) GROUP BY icd_code")
+    @Select("select icd_code=isnull(nullif(icd_code_new,''), rtrim(icd_code)),count(1) num from ${tableName} WITH(NOLOCK) GROUP BY icd_code")
     List<Map<String,Object>> selectIcdNum(@Param("tableName") String tableName);
 
 }

+ 8 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpBaseYfMapper.java

@@ -85,10 +85,15 @@ public interface YpBaseYfMapper {
      * @param groupNo
      * @return
      */
-    @Select("select charge_code,serial,stock_amount,stock_value,group_no,location,visible_flag_mz,visible_flag_zy," +
+    @Select({"<script>",
+            "select charge_code,serial,stock_amount,stock_value,group_no,location,visible_flag_mz,visible_flag_zy," +
             "       visible_flag_stop,stock_amount_virtual,stock_amount_virtual2,open_virtual2 " +
-            "from yp_base_yf WITH(NOLOCK) where charge_code=#{chargeCode} and serial=#{serial} and group_no=#{groupNo} and visible_flag_mz= 0 ")
-    YpBaseYf selectYpBaseYf(@Param("chargeCode") String chargeCode, @Param("serial") String serial,@Param("groupNo") String groupNo);
+            "from yp_base_yf WITH(NOLOCK) where charge_code=#{chargeCode} and serial=#{serial} and group_no=#{groupNo} ",
+            "<when test='visibleFlagMz!=null'>",
+            " and visible_flag_mz =#{visibleFlagMz}",
+            "</when>",
+            "</script>"})
+    YpBaseYf selectYpBaseYf(@Param("chargeCode") String chargeCode, @Param("serial") String serial,@Param("groupNo") String groupNo,@Param("visibleFlagMz") String visibleFlagMz);
 
     /**
      * 查询药品药房最大拆零比例

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

@@ -1011,11 +1011,11 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 realIcdText = null;
             }
         }
-        if (mzPrescriptionVo.getMzZyReq() != null && mzPrescriptionVo.getMzZyReq().getReqDept() != null && StringUtils.isNotBlank(mzPrescriptionVo.getMzZyReq().getReqDept())) {
-            if (mzPrescriptionVo.getIcdCode() != null && mzPrescriptionVo.getIcdCode().indexOf(",") > 0) {
-                //因为住院申请系统不支持超过10个长度的诊断编码
-                throw new MzException("住院证不允许同时出现两个及以上标准诊断,您可以在初步诊断继续填其他写诊断!");
-            }
+        if (mzPrescriptionVo.getIcdCode() != null && mzPrescriptionVo.getIcdCode().length() > 8000) {
+            throw new MzException("标准诊断长度超过最大值,请删除部分诊断,您可以在初步诊断继续填其他写诊断!");
+        }
+        if (mzPrescriptionVo.getIcdText() != null && mzPrescriptionVo.getIcdText().length() > 2000) {
+            throw new MzException("标准诊断长度超过最大值,请删除部分诊断,您可以在初步诊断继续填其他写诊断!");
         }
         if (realIcdText == null && (mzPrescriptionVo.getMzBlRecord().getTentativeDiagnosis() == null || StringUtils.isBlank(mzPrescriptionVo.getMzBlRecord().getTentativeDiagnosis()))) {
             throw new MzException("诊断和初步诊断不能同时为空!");
@@ -1930,7 +1930,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                             throw new MzException("保存处方失败,第" + itemNo + "行药品频率不能为空");
                         }
                         if (needVerify) {
-                            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), Constants.XY_ZCY_GROUP_NO);
+                            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), Constants.XY_ZCY_GROUP_NO,YesNoEnum.NO.code.toString());
                             if (ypBaseYf == null) {
                                 throw new MzException("无药品【" + ypZdDict.getName() + "】编码【" + ypZdDict.getCode() + "】的库存信息!");
                             }
@@ -1939,7 +1939,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                             }
                         }
                         if (Constants.CLF.equals(ypZdDict.getBillItemMz())) {
-                            YpBaseYf ycBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), Constants.YC_GROUP_NO);
+                            YpBaseYf ycBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), Constants.YC_GROUP_NO,YesNoEnum.NO.code.toString());
                             if (ycBaseYf != null) {
                                 mzChargeDetail.setGroupNo(Constants.YC_GROUP_NO);
                                 mzChargeDetail.setExecDept(Constants.YC_EXEC_CODE);
@@ -3280,6 +3280,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
             if (dbMzVisitTable != null) {
                 newMzVisitTable.setIcdCode(dbMzVisitTable.getIcdCode());
                 newMzVisitTable.setIcdText(dbMzVisitTable.getIcdText());
+                newMzVisitTable.setIcdCodeNew(dbMzVisitTable.getIcdCodeNew());
+                newMzVisitTable.setIcdTextNew(dbMzVisitTable.getIcdTextNew());
             }
             mzVisitTableMapper.insertMzVisitTable(newMzVisitTable);
         }
@@ -3517,8 +3519,14 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         newMzVisitTable.setFirstOrNot(mzPrescriptionVo.getFirstOrNot());
         newMzVisitTable.setReceiveFlag(YesNoEnum.NO.code);
         newMzVisitTable.setResponceType(responseType);
-        newMzVisitTable.setIcdCode(mzPrescriptionVo.getIcdCode());
-        newMzVisitTable.setIcdText(mzPrescriptionVo.getIcdText());
+        newMzVisitTable.setIcdCodeNew(mzPrescriptionVo.getIcdCode());
+        newMzVisitTable.setIcdTextNew(mzPrescriptionVo.getIcdText());
+        if (newMzVisitTable.getIcdCodeNew() != null && newMzVisitTable.getIcdCodeNew().length() > 20) {
+            newMzVisitTable.setIcdCode(newMzVisitTable.getIcdCodeNew().substring(0, 19));
+        }
+        if (newMzVisitTable.getIcdTextNew() != null && newMzVisitTable.getIcdTextNew().length() > 25) {
+            newMzVisitTable.setIcdText(newMzVisitTable.getIcdTextNew().substring(0, 20));
+        }
         return newMzVisitTable;
     }
 

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzPharmacyServiceImpl.java

@@ -261,7 +261,7 @@ public class MzPharmacyServiceImpl implements MzPharmacyService {
             Map map = list.get(i);
             String manuName = ypZdManufactoryMapper.selectYpZdManufactoryByCode((String)map.get("manu_code"));
             map.put("manuName", manuName);
-            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf((String) map.get("code"), (String) map.get("serial"), "71");
+            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf((String) map.get("code"), (String) map.get("serial"), "71",null);
             map.put("location", ypBaseYf.getLocation());
             map.put("stockAmount", ypBaseYf.getStockAmount());
         }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfDivideServiceImpl.java

@@ -47,8 +47,8 @@ public class YfDivideServiceImpl implements YfDivideService {
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     public int saveYfDivide(List<YpBaseYfVo> ypBaseYfVos,String userIdCode) throws MzException {
         for (YpBaseYfVo ypBaseYfVo : ypBaseYfVos) {
-            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypBaseYfVo.getChargeCode(), ypBaseYfVo.getSerial(), ypBaseYfVo.getGroupNo());
-            YpBaseYf ypBaseYfOld = ypBaseYfMapper.selectYpBaseYf(ypBaseYfVo.getChargeCode(), ypBaseYfVo.getOldSerial(), ypBaseYfVo.getGroupNo());
+            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypBaseYfVo.getChargeCode(), ypBaseYfVo.getSerial(), ypBaseYfVo.getGroupNo(),null);
+            YpBaseYf ypBaseYfOld = ypBaseYfMapper.selectYpBaseYf(ypBaseYfVo.getChargeCode(), ypBaseYfVo.getOldSerial(), ypBaseYfVo.getGroupNo(),null);
             if(ypBaseYfOld.getStockAmount() < ypBaseYfVo.getOldAmount()){
                 throw new MzException("药品编码【"+ypBaseYfOld.getChargeCode()+"】药房实际库存小于原包装分装库存!");
             }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfSpecialMarkServiceImpl.java

@@ -52,7 +52,7 @@ public class YfSpecialMarkServiceImpl implements YfSpecialMarkService {
         List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpBySearchText(searchText);
         ypZdDicts.forEach(ypZdDict -> {
             YpZdBaseYfSpecialVo ypZdBaseYfSpecialVo = new YpZdBaseYfSpecialVo();
-            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), groupNo);
+            YpBaseYf ypBaseYf = ypBaseYfMapper.selectYpBaseYf(ypZdDict.getCode(), ypZdDict.getSerial(), groupNo,null);
             if(ypBaseYf != null){
                 ypZdBaseYfSpecialVo.setGroupNo(groupNo);
                 ypZdBaseYfSpecialVo.setChargeCode(ypBaseYf.getChargeCode());

+ 3 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseYfServiceImpl.java

@@ -60,7 +60,7 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
 
     @Override
     public YpBaseYf queryYpBaseYf(String chargeCode, String serial, String groupNo) {
-        return ypBaseYfMapper.selectYpBaseYf(chargeCode,serial,groupNo);
+        return ypBaseYfMapper.selectYpBaseYf(chargeCode,serial,groupNo,null);
     }
 
     @Override
@@ -93,7 +93,7 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
                 if(ypZdDict == null){
                     throw new MzException("入库失败,未查到药品字典含有该拆零规格的药品");
                 }
-                yp = ypBaseYfMapper.selectYpBaseYf(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut());//查询当前药品在药房的最小规格信息
+                yp = ypBaseYfMapper.selectYpBaseYf(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut(),null);//查询当前药品在药房的最小规格信息
                 packRetprice = ypZdDict.getRetprice();
                 fixPrice = ypZdDict.getFixPrice();
                 buyPrice = ypZdDict.getBuyPrice();
@@ -104,7 +104,7 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
                 packRetprice = ypOutDetlVo.getPackRetprice();
                 fixPrice = ypOutDetlVo.getFixPrice();
                 buyPrice = ypOutDetlVo.getBuyPrice();
-                yp = ypBaseYfMapper.selectYpBaseYf(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut());
+                yp = ypBaseYfMapper.selectYpBaseYf(ypOutDetlVo.getChargeCode(), serial, ypOutDetlVo.getGroupNoOut(),null);
             }else{
                 throw new MzException("拆零比例只允许0%和100%");
             }

+ 6 - 3
src/main/resources/static/js/mz/clinic.js

@@ -4231,8 +4231,8 @@ function fitDiagnoseValue(value, code) {
     }
     var html = '';
     var childrenNum = $("#diagnoseTags").children().length;
-    if (childrenNum == 2) {
-        errorMesageSimaple("最多填写个诊断!");
+    if (childrenNum == 6) {
+        errorMesageSimaple("最多填写个诊断!");
         return;
     }
     var diagnoseValue = $("#diagnoseValue").val();
@@ -4253,6 +4253,9 @@ function fitDiagnoseValue(value, code) {
     }
     html += ' title="' + value + '(' + code + ')" id="' + code + '"><span class="el-select__tags-text">' + value + '</span><i class="fa fa-remove .el-icon-close" style="margin-left: 10px;height: 16px;width: 16px;cursor: pointer;" onclick="removeDiagnoseValue(\'' + code + '\')"></i><span style="clear: both"></span></span>';
     $("#diagnoseTags").append(html);
+    $("#diagnoseTags").parent().parent().css("height",$("#diagnoseTags").height());
+
+
 }
 
 
@@ -4275,7 +4278,7 @@ function removeDiagnoseValue(code) {
     }
     var diagnoseValue = $("#diagnoseValue").val();
     $("#diagnoseValue").val(diagnoseValue.replace(code, ""));
-
+    $("#diagnoseTags").parent().parent().css("height",$("#diagnoseTags").height());
 }
 
 

+ 3 - 3
src/main/resources/templates/mz/clinic.html

@@ -432,9 +432,9 @@
                     <div class="item form-group">
                         <label class="my_label">诊断:</label>
                         <div class="form-group has-feedback" style="float: right;width: calc(100% - 65px);">
-                            <div class="el-select__tags"><span id="diagnoseTags"></span></div>
+                            <div class="el-select__tags" style="width: 90%;"><span id="diagnoseTags"></span></div>
                             <input type="text" class="form-control has-feedback-left" id="diagnose"
-                                   placeholder="请输入" style="padding-left: 10px;" readonly>
+                                      placeholder="请输入" style="padding-left: 10px;" readonly/>
                             <input id="diagnoseValue" type="hidden"/>
                             <span class="fa fa-search form-control-feedback right" aria-hidden="true"
                                   style="right: 0px;"></span>
@@ -1689,7 +1689,7 @@
                 <td id="cfTime" colspan="3"></td>
             </tr>
             <tr>
-                <td style="text-align: right">身份证号码:</td>
+                <td style="text-align: right" width="18%">身份证号码:</td>
                 <td id="socialNo" colspan="5"></td>
             </tr>
             <tr>