Browse Source

解决挂号时没有更新数据库年龄的问题,优化核酸混检提交后自动复制混检主体的ID

hurugang 3 years ago
parent
commit
eaf24cf8b4

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -1967,6 +1967,7 @@ public class MzChargeDetailController {
             } else {
                 mzYjReq.setPatientName(null);
             }
+            mzYjReq.setOrderCode(Constants.HYBRID_TEST_CHARGE_CODE);
             Integer count = mzChargeDetailService.queryCountHybridTestListByPatientIdAndReqDate(mzYjReq);
             List<MzChargeDetail> data = mzChargeDetailService.queryHybridTestListByPatientIdAndReqDateWithPage(mzYjReq);
             if (data == null) {

+ 3 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -1071,7 +1071,7 @@ public interface MzChargeDetailMapper {
      * @param mzYjReq
      * @return
      */
-    @Select("select count(1) from mz_charge_detail where  charge_item_code ='019004' and pay_mark = '0' and cash_id <>'99997' and price_time >= #{beginTime} and price_time <=#{endTime} ")
+    @Select("select count(1) from mz_charge_detail where  charge_item_code =#{orderCode} and pay_mark = '0' and cash_id <>'99997' and price_time >= #{beginTime} and price_time <=#{endTime} ")
     int selectCountHybridTestListByPatientIdAndReqDate(MzYjReq mzYjReq);
 
 
@@ -1082,7 +1082,7 @@ public interface MzChargeDetailMapper {
      * @return
      */
     @Select({"<script>",
-            "select top ${pageSize} patient_id,name,tc_name,price_time,times,charge_date FROM (SELECT ROW_NUMBER() OVER (ORDER BY mz_charge_detail_page.price_time desc) AS RowNumber,* from mz_charge_detail mz_charge_detail_page WITH(NOLOCK) where charge_item_code ='019004' and pay_mark = '0' and cash_id <![CDATA[<>]]>'99997' ",
+            "select top ${pageSize} patient_id,name,tc_name,price_time,times,charge_date FROM (SELECT ROW_NUMBER() OVER (ORDER BY mz_charge_detail_page.price_time desc) AS RowNumber,* from mz_charge_detail mz_charge_detail_page WITH(NOLOCK) where charge_item_code =#{orderCode} and pay_mark = '0' and cash_id <![CDATA[<>]]>'99997' ",
             "<when test='patientId!=null'>",
             " and patient_id =#{patientId} ",
             "</when>",
@@ -1109,7 +1109,7 @@ public interface MzChargeDetailMapper {
      * 查询患者是否有已经缴费且未确认的检查记录的缴费次数
      * @return
      */
-    @Select("select times from mz_charge_detail where patient_id=#{patientId} and pay_mark =0 and confirm_flag=0 and charge_item_code=#{chargeItemCode} ")
+    @Select("select top 1 times from mz_charge_detail where patient_id=#{patientId} and pay_mark =0 and confirm_flag=0 and charge_item_code=#{chargeItemCode} ")
     Integer selectCountMzChargeDetailByPatientIdAndChargeItemCode(@Param("patientId") String patientId,  @Param("chargeItemCode") String chargeItemCode);
 
 

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

@@ -2129,6 +2129,16 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     public Clinic nucleicAcidApplication(String patientId) throws MzException {
+        MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
+        if (mzPatientMi == null) {
+            throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
+        }
+        //自助开核酸的时候更新病人年龄
+        if(mzPatientMi.getBirthDay()!=null){
+            int age = DateUtil.getAge(mzPatientMi.getBirthDay());
+            mzPatientMi.setAge(age);
+            mzPatientMiMapper.updateMzPatientMi(mzPatientMi);
+        }
         MzPrescriptionVo mzPrescriptionVo = new MzPrescriptionVo();
         mzPrescriptionVo.setPatientId(patientId);
         mzPrescriptionVo.setIcdCode("");
@@ -2168,6 +2178,16 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
 
     @Override
     public Clinic hybridTestApplication(String patientId) throws MzException {
+        MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(patientId);
+        if (mzPatientMi == null) {
+            throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
+        }
+        //自助开核酸的时候更新病人年龄
+        if(mzPatientMi.getBirthDay()!=null){
+            int age = DateUtil.getAge(mzPatientMi.getBirthDay());
+            mzPatientMi.setAge(age);
+            mzPatientMiMapper.updateMzPatientMi(mzPatientMi);
+        }
         MzPrescriptionVo mzPrescriptionVo = new MzPrescriptionVo();
         mzPrescriptionVo.setPatientId(patientId);
         mzPrescriptionVo.setIcdCode("");

+ 6 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzyReqrecServiceImpl.java

@@ -117,6 +117,12 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         if (mzPatientMi == null) {
             throw new MzException("当前挂号的病人信息不存在,请先保存病人信息!");
         }
+        //挂号的时候更新病人年龄
+        if(mzPatientMi.getBirthDay()!=null){
+            int age = DateUtil.getAge(mzPatientMi.getBirthDay());
+            mzPatientMi.setAge(age);
+            mzPatientMiMapper.updateMzPatientMi(mzPatientMi);
+        }
         Windows windows = windowsMapper.selectLastWindowsByIpAddress(ipAddress);
         if (windows == null) {
             throw new MzException("当前操作人未设置窗口号,请先设置!");

+ 21 - 18
src/main/resources/static/js/jBox/baseISSOnline.js

@@ -1,4 +1,6 @@
 //@ sourceURL=baseISSOnline.js
+//是否打印错误日志
+var flag=false;
 var Device = function()
 {
 	message : ""
@@ -247,26 +249,27 @@ function createISSonlineDevice(setting)
 				}
 				parent.dealDeviceInfo(result);
 			},
-			error : function(XMLHttpRequest, textStatus, errorThrown) 
+			error : function(XMLHttpRequest, textStatus, errorThrown)
 			{
-				 
-				console.info(errorThrown+"url:"+url);
-				if(textStatus == "timeout" && url != "/info")
-				{
-					setting.Methods.showMessage("warning","未读取到身份证,请重新刷卡!");
-				}
-				else if(typeof parent.installDrive == "function")
-				{
-					if(parent.installDrive())
-					{
-						//setting.Methods.showMessage("error","设备连接异常");
-					}
-				}
-				else
-				{
-					//setting.Methods.showMessage("error","设备连接异常");
+				if(flag){
+                    console.info(errorThrown+"url:"+url);
+                    if(textStatus == "timeout" && url != "/info")
+                    {
+                        setting.Methods.showMessage("warning","未读取到身份证,请重新刷卡!");
+                    }
+                    else if(typeof parent.installDrive == "function")
+                    {
+                        if(parent.installDrive())
+                        {
+                            //setting.Methods.showMessage("error","设备连接异常");
+                        }
+                    }
+                    else
+                    {
+                        //setting.Methods.showMessage("error","设备连接异常");
+                    }
 				}
-			}			
+			}
 		});
 	};
 	

+ 5 - 0
src/main/resources/static/js/menu.js

@@ -1,6 +1,8 @@
 var content_url = null;
 //发票计数器
 var countReceiot = 0;
+//复制内容对象,是全局的,因为会有切换页面的情况
+var clipboard = null;
 //跨页面传递患者id参数核酸检测
 var patientIdFullForNucleicAcid=null;
 $(function () {
@@ -319,6 +321,9 @@ function profileImage() {
  * 页面跳转
  */
 function changeContent(url) {
+    if (clipboard != null) {
+        clipboard.destroy();
+    }
     //如果门诊工作站的辅助框打开,关闭它
     if($('#box-arrow-left').length>0){
         if($("#smartAssistPopoverContent").parent().parent().hasClass("in")){

+ 22 - 1
src/main/resources/static/js/mz/hybrid_test.js

@@ -51,6 +51,7 @@ $(function () {
                     //$("#creatHybird").hide();
                     $("#hc_number").val(hybirdType);
                     $("#hybirdTypeModal").modal('hide');
+                    $("#messageButton").attr("data-clipboard-text",'');
                 } else {
                     errorMesage(res);
                 }
@@ -84,6 +85,9 @@ $(function () {
                         return;
                     }
                     if (res.code == 0) {
+                        //将混检主体的ID设置到复制区域
+                        $("#messageButton").attr("data-clipboard-text",$("#hybirdPatientId").text());
+                        copyParentPatient();
                         successMesage(res);
                         $("#hybirdList").empty();
                         $("#hybirdPatientId").text(null);
@@ -720,4 +724,21 @@ function deleteFromList(obj,patientId) {
     var fullPatientIds=$("#fullPatientIds").val();
     fullPatientIds= fullPatientIds.replace(patientId,"");
     $("#fullPatientIds").val(fullPatientIds);
-}
+}
+
+
+
+/**
+ * 复制混检主体的ID
+ */
+function copyParentPatient() {
+    if (clipboard != null) {
+        clipboard.destroy();
+    }
+    clipboard = new ClipboardJS('#messageButton', {
+        text: function (trigger) {
+            //alert("复制成功!");
+            return trigger.getAttribute('data-clipboard-text');
+        }
+    });
+}

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

@@ -7,7 +7,6 @@ var pageIndex = 0;
 var LODOP; //声明为全局变量
 //默认打印机下标
 var printIndex = -1;
-var clipboard = null;
 var TableInit = function () {
     var oTableInit = new Object();
     //初始化Table

+ 1 - 0
src/main/resources/templates/mz/hybrid_test.html

@@ -11,6 +11,7 @@
 <script src="/thmz/js/jBox/baseISSObject.js"></script>
 <script src="/thmz/js/jBox/baseISSOnline.js"></script>
 <script src="/thmz/js/jBox/common.js"></script>
+<script src="/thmz/js/dependent/clipboard.js"></script>
 <script src="/thmz/js/mz/hybrid_test.js"></script>
 <title>混检管理</title>
 <style>