Browse Source

精麻身份效验

lihong 1 year ago
parent
commit
bfce3f39cb

+ 37 - 7
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -18,9 +18,19 @@ import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
 import cn.hnthyy.thmz.entity.his.zd.ZdChequeType;
 import cn.hnthyy.thmz.entity.his.zd.ZdUnitCode;
 import cn.hnthyy.thmz.entity.his.zy.ZyZdAuditItem;
-import cn.hnthyy.thmz.entity.thmz.*;
-import cn.hnthyy.thmz.enums.*;
+import cn.hnthyy.thmz.entity.thmz.Clinic;
+import cn.hnthyy.thmz.entity.thmz.HybirdTest;
+import cn.hnthyy.thmz.entity.thmz.PayInfo;
+import cn.hnthyy.thmz.entity.thmz.TurnToConsultation;
+import cn.hnthyy.thmz.entity.thmz.User;
+import cn.hnthyy.thmz.entity.thmz.Windows;
+import cn.hnthyy.thmz.enums.ClinicStatusEnum;
+import cn.hnthyy.thmz.enums.GenderEnum;
+import cn.hnthyy.thmz.enums.MzfzStatusEnum;
+import cn.hnthyy.thmz.enums.PayMarkEnum;
+import cn.hnthyy.thmz.enums.YesNoEnum;
 import cn.hnthyy.thmz.pageDto.MzChargeDetailPageDto;
+import cn.hnthyy.thmz.service.his.ResponceTypeService;
 import cn.hnthyy.thmz.service.his.mz.*;
 import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
 import cn.hnthyy.thmz.service.his.yp.YpZdDrugKindService;
@@ -28,10 +38,21 @@ import cn.hnthyy.thmz.service.his.zd.JcJyItemChargeService;
 import cn.hnthyy.thmz.service.his.zd.ZdChargeItemService;
 import cn.hnthyy.thmz.service.his.zd.ZdChequeTypeService;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
-import cn.hnthyy.thmz.service.his.zy.ZyActpatientService;
 import cn.hnthyy.thmz.service.his.zy.ZyZdAuditItemService;
-import cn.hnthyy.thmz.service.thmz.*;
-import cn.hnthyy.thmz.vo.*;
+import cn.hnthyy.thmz.service.thmz.ClinicService;
+import cn.hnthyy.thmz.service.thmz.HaiCiAdapterService;
+import cn.hnthyy.thmz.service.thmz.HybirdTestService;
+import cn.hnthyy.thmz.service.thmz.RationalUseService;
+import cn.hnthyy.thmz.service.thmz.TransactionService;
+import cn.hnthyy.thmz.service.thmz.TsmzService;
+import cn.hnthyy.thmz.service.thmz.TurnToConsultationService;
+import cn.hnthyy.thmz.service.thmz.UserDeptRelationService;
+import cn.hnthyy.thmz.service.thmz.WindowsService;
+import cn.hnthyy.thmz.vo.ChargeFeeParamsVo;
+import cn.hnthyy.thmz.vo.MzDepositFileVo;
+import cn.hnthyy.thmz.vo.MzPrescriptionVo;
+import cn.hnthyy.thmz.vo.PageViewVo;
+import cn.hnthyy.thmz.vo.ThmzmxsrParamsVo;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
@@ -42,12 +63,16 @@ import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.dao.DataIntegrityViolationException;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -110,6 +135,8 @@ public class MzChargeDetailController {
     private ZdChequeTypeService zdChequeTypeService;
     @Value("${healthEducationUrl}")
     private String healthEducationUrl;
+    @Resource
+    private ResponceTypeService responceTypeService;
 
 
     /**
@@ -1921,6 +1948,9 @@ public class MzChargeDetailController {
             resultMap.put("code", 0);
             resultMap.put("data", mzChargeDetailService.getMzPrescriptionVo(patientId, times, MzBlRecordFlag, payMark));
             MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+            if(mzPatientMi !=null && StrUtil.isNotBlank(mzPatientMi.getResponseType())){
+                mzPatientMi.setResponseTypeName(responceTypeService.queryMzNameByCode(mzPatientMi.getResponseType()));
+            }
             if (PayMarkEnum.CHARGED.code.equals(payMark)) {
                 mzPatientMi.setGender(GenderEnum.getGenderByCode(mzPatientMi.getSex()).name);
             }

+ 27 - 1
src/main/java/cn/hnthyy/thmz/controller/mz/MzZdYpYshController.java

@@ -4,14 +4,19 @@ import cn.hnthyy.thmz.Utils.AssertUtil;
 import cn.hnthyy.thmz.Utils.R;
 import cn.hnthyy.thmz.Utils.TokenUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
 import cn.hnthyy.thmz.entity.his.zd.JyZdItem;
 import cn.hnthyy.thmz.entity.his.zd.MzZdYpYsh;
 import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
+import cn.hnthyy.thmz.enums.CertificateTypeEnum;
+import cn.hnthyy.thmz.enums.NumberEnum;
+import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
 import cn.hnthyy.thmz.service.his.zd.JcJyItemChargeService;
 import cn.hnthyy.thmz.service.his.zd.MzZdYpYshService;
 import cn.hnthyy.thmz.service.his.zd.ZdChargeItemService;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.convert.Convert;
+import cn.hutool.core.util.IdcardUtil;
 import cn.hutool.core.util.StrUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -23,8 +28,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
 import java.math.BigDecimal;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +43,8 @@ public class MzZdYpYshController {
     private JcJyItemChargeService jcJyItemChargeService;
     @Autowired
     private ZdChargeItemService zdChargeItemService;
+    @Resource
+    private MzPatientMiService mzPatientMiService;
 
     /**
      * 查询药品成功
@@ -95,6 +102,25 @@ public class MzZdYpYshController {
         if (!mzZdYpYshService.checkKssByUserCode(TokenUtil.getUser().getUserIdCode(), code,serial)) {
            return R.error(-2,"检查抗生素错误消息");
         }
+        String patientId = Convert.toStr(param.get("patientId"));
+        String ypType = Convert.toStr(param.get("ypType"));
+        String ypName = Convert.toStr(param.get("ypName"));
+        //判断精一 二
+        if(StrUtil.isNotBlank(patientId) && ("111".equals(ypType) || "131".equals(ypType))){
+            //检查身份证合法性
+            MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+            //三无和绿色通道的病人不检查身份证合法性
+            if(!"17".equals(mzPatientMi.getResponseType()) && !"18".equals(mzPatientMi.getResponseType())){
+                if(StrUtil.isBlank(mzPatientMi.getSocialNo())){
+                    return R.error(-3, StrUtil.format("非三无和绿色通道的病人,开具药品【{}】为精一或精二处方时证件号码不能为空",ypName));
+                }
+                if(CertificateTypeEnum.JMSFZ.code.equals(mzPatientMi.getCertificateType()) || NumberEnum.ONE.getCode().equals(mzPatientMi.getCertificateType())){
+                   if(!IdcardUtil.isValidCard18(mzPatientMi.getSocialNo()) && !IdcardUtil.isValidCard15(mzPatientMi.getSocialNo())){
+                       return R.error(-3, StrUtil.format("非三无和绿色通道的病人,开具药品【{}】为精一或精二处方时证件号码不合法,请修改身份证件号码!", ypName));
+                   }
+                }
+            }
+        }
         return R.ok();
     }
 

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

@@ -1428,7 +1428,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         if (retractInfo == null) {
             log.info("删除处方失败,医保撤销失败门诊号:{}就诊次数:{}", clinic.getPatientId(), clinic.getTimes());
         }
-        if (retractInfo.getCode() != 0) {
+        if (retractInfo != null && retractInfo.getCode() != 0) {
             log.info("删除处方失败,医保撤销失败门诊号:{}就诊次数:{}[错误信息:{}]", clinic.getPatientId(), clinic.getTimes(), retractInfo.getErrorMessage());
         }
         int num = clinicMapper.deleteById(clnicId);

+ 5 - 2
src/main/resources/static/js/mz/clinic.js

@@ -7319,7 +7319,7 @@ function loadYpList(index, event) {
             };
         },
         onClickRow: function (row, $element) {
-            postAjaxJsonHttpRequst("/thmz/checkKssByUserCode",{code:row.code,serial:row.serial},true,function (cres) {
+            postAjaxJsonHttpRequst("/thmz/checkKssByUserCode",{code:row.code,ypName:row.name,serial:row.serial,patientId:$("#patientId").text(),ypType:row.ypType},true,function (cres) {
                 if(cres.code == 0){
                     $('#' + MedicineName).webuiPopover('hide');
                     if (index == 0) {
@@ -7331,7 +7331,9 @@ function loadYpList(index, event) {
                     }
                 }else if(cres.code == -2) {
                     errorMesageSimaple(`没有${row.code}/${row.name}的抗生素使用级别权限,不能开具此药品`)
-                }else {
+                }else if(cres.code == -3) {
+                    errorMesageSimaple(cres.message)
+                } else {
                     errorMesage(cres)
                 }
             })
@@ -10717,6 +10719,7 @@ function printPrescription(patientId, times, clnicId, payMark, printType) {
                     $("#doctorPrescription").text(res.doctorName);
                     $("#cfTime").text(res.opDate);
                     $("#socialNo").text(mzPatientMi.socialNo);
+                    $("#sfTypeId").text(mzPatientMi.responseTypeName);
                     $("#zdPrescription").text(res.data.icdText);
                     $("#patientIdGuideCard").text(mzPatientMi.patientId);
                     $("#patientNameGuideCard").text(mzPatientMi.name);

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

@@ -2601,7 +2601,9 @@
             </tr>
             <tr>
                 <td style="text-align: right" width="18%">身份证号码:</td>
-                <td id="socialNo" colspan="5"></td>
+                <td id="socialNo" colspan="2"></td>
+                <td style="text-align: right">病人类别:</td>
+                <td id="sfTypeId" colspan="2" ></td>
             </tr>
             <tr>
                 <td style="text-align: right">诊断:</td>