Procházet zdrojové kódy

异常接诊数据修复

hurugang před 2 roky
rodič
revize
9ca5d93168

+ 65 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -536,6 +536,67 @@ public class ClinicController {
         }
     }
 
+    /**
+     * 异常数据修复
+     * @param patientId
+     * @param times
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/initClinicForException", method = {RequestMethod.GET})
+    public Map<String, Object> initClinicForException(@RequestParam("patientId") String patientId, @RequestParam("times") Integer times) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "异常数据修复失败,患者ID为空");
+                return resultMap;
+            }
+            if (times==null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "异常数据修复失败,就诊次数为空");
+                return resultMap;
+            }
+            Clinic clinic = clinicService.queryByPatientIdAndTimesAndReceiptNo(patientId,times,0);
+            if(clinic!=null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "异常数据修复失败,本次就诊记录已存在,无需修复!");
+                return resultMap;
+
+            }
+            MzVisitTable mzVisitTable = mzVisitTableService.queryByPatientIdAndTimes(patientId,times);
+            clinic = new Clinic();
+            clinic.setPatientId(mzVisitTable.getPatientId());
+            MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(mzVisitTable.getPatientId());
+            if (mzPatientMi != null) {
+                clinic.setPatientName(mzPatientMi.getName());
+            } else {
+                clinic.setPatientName("");
+            }
+            clinic.setTimes(mzVisitTable.getTimes());
+            clinic.setReceiptNo(mzVisitTable.getReceiptNo());
+            clinic.setDeptCode(mzVisitTable.getVisitDeptCode());
+            clinic.setDoctorCode(mzVisitTable.getDoctorCode());
+            clinic.setIcdCode(StringUtils.isNotBlank(mzVisitTable.getIcdCode()) ? mzVisitTable.getIcdCode().trim() : null);
+            clinic.setIcdText(StringUtils.isNotBlank(mzVisitTable.getIcdText()) ? mzVisitTable.getIcdText().trim() : null);
+            clinic.setOpDay(mzVisitTable.getOpDay());
+            clinic.setFirstOrNot(mzVisitTable.getFirstOrNot());
+            clinic.setOpId(StringUtils.isNotBlank(mzVisitTable.getDoctorCode()) ? mzVisitTable.getDoctorCode() : mzVisitTable.getOpId());
+            clinic.setClinicStatus(ClinicStatusEnum.HAD_CLINIC.code);
+            clinicService.saveClinic(clinic);
+            log.info("=====>>>>>异常数据修复,患者ID{},就诊次数{},异常数据修复完成",patientId,times);
+            resultMap.put("code", 0);
+            resultMap.put("message", "异常数据修复成功");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("异常数据修复失败,错误信息{}", e);
+            resultMap.put("code", -1);
+            resultMap.put("message", "异常数据修复失败");
+            return resultMap;
+        }
+    }
+
 
     /**
      * 供定时任务调用的 初始化就诊记录表
@@ -549,10 +610,12 @@ public class ClinicController {
             if (StringUtils.isBlank(beginDate)) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "初始化就诊记录表失败,开始时间为空");
+                return resultMap;
             }
             if (StringUtils.isBlank(endDate)) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "初始化就诊记录表失败,结束时间为空");
+                return resultMap;
             }
             Date beginTime = DateUtil.pase(beginDate, "yyyy-MM-dd HH:mm:ss");
             Date endTime = DateUtil.pase(endDate, "yyyy-MM-dd HH:mm:ss");
@@ -577,6 +640,8 @@ public class ClinicController {
     }
 
 
+
+
     private void process(Date beginTime, Date endTime, Set<String> set) {
 //        List<MzVisitTable> mzVisitTableList = mzVisitTableService.queryByDateRages(beginTime, endTime, "mz_visit_table_b");
 //        setClinic(mzVisitTableList, set);

+ 461 - 0
src/main/java/cn/hnthyy/thmz/entity/his/mz/CrbMainCard.java

@@ -0,0 +1,461 @@
+package cn.hnthyy.thmz.entity.his.mz;
+
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * 传染病实体类
+ */
+@Data
+public class CrbMainCard implements Serializable {
+
+    private static final long serialVersionUID = 3405842528550214438L;
+
+    /**
+     * patientId
+     */
+    private String patientId;
+
+    /**
+     * times
+     */
+    private Integer times;
+
+    /**
+     * 卡片编码
+     */
+    private String cardNo;
+
+    /**
+     * 报卡类别
+     */
+    private String illType;
+
+    /**
+     * scopeFlag
+     */
+    private String scopeFlag;
+
+    /**
+     * name
+     */
+    private String name;
+
+    /**
+     * sex
+     */
+    private String sex;
+
+    /**
+     * age
+     */
+    private Double age;
+
+    /**
+     * ageUnit
+     */
+    private String ageUnit;
+
+    /**
+     * corporation
+     */
+    private String corporation;
+
+    /**
+     * relationTel
+     */
+    private String relationTel;
+
+    /**
+     * genearch
+     */
+    private String genearch;
+
+    /**
+     * currentDistrict
+     */
+    private String currentDistrict;
+
+    /**
+     * currentStreet
+     */
+    private String currentStreet;
+
+    /**
+     * homeDistrict
+     */
+    private String homeDistrict;
+
+    /**
+     * homeStreet
+     */
+    private String homeStreet;
+
+    /**
+     * occupationCode
+     */
+    private String occupationCode;
+
+    /**
+     * illStartDate
+     */
+    private Date illStartDate;
+
+    /**
+     * illFirstDate
+     */
+    private Date illFirstDate;
+
+    /**
+     * admissDate
+     */
+    private Date admissDate;
+
+    /**
+     * disDate
+     */
+    private Date disDate;
+
+    /**
+     * discharStatus
+     */
+    private String discharStatus;
+
+    /**
+     * disDiagType
+     */
+    private String disDiagType;
+
+    /**
+     * reportHospital
+     */
+    private String reportHospital;
+
+    /**
+     * reportDept
+     */
+    private String reportDept;
+
+    /**
+     * zyMzFlag
+     */
+    private String zyMzFlag;
+
+    /**
+     * reportOpera
+     */
+    private String reportOpera;
+
+    /**
+     * reportDate
+     */
+    private Date reportDate;
+
+    /**
+     * anamnesis
+     */
+    private String anamnesis;
+
+    /**
+     * contagion
+     */
+    private String contagion;
+
+    /**
+     * contagionText
+     */
+    private String contagionText;
+
+    /**
+     * socialNo
+     */
+    private String socialNo;
+
+    /**
+     * contagion2
+     */
+    private String contagion2;
+
+    /**
+     * contagion3
+     */
+    private String contagion3;
+
+    /**
+     * opId
+     */
+    private String opId;
+
+    /**
+     * inputDt
+     */
+    private Date inputDt;
+
+    /**
+     * deathDate
+     */
+    private Date deathDate;
+
+    /**
+     * caseType
+     */
+    private String caseType;
+
+    /**
+     * vaccinate
+     */
+    private String vaccinate;
+
+    /**
+     * dcFlag
+     */
+    private String dcFlag;
+
+    /**
+     * vaccinate2
+     */
+    private String vaccinate2;
+
+    /**
+     * contagionQt
+     */
+    private String contagionQt;
+
+    /**
+     * cardRet
+     */
+    private String cardRet;
+
+    /**
+     * reportTel
+     */
+    private String reportTel;
+
+    /**
+     * birthDate
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    private Date birthDate;
+
+    /**
+     * remark
+     */
+    private String remark;
+
+    /**
+     * statusFlag
+     */
+    private String statusFlag;
+
+    /**
+     * subCard
+     */
+    private String subCard;
+
+    /**
+     * icdCode
+     */
+    private String icdCode;
+
+    /**
+     * printFlag
+     */
+    private String printFlag;
+
+    /**
+     * modifyId
+     */
+    private String modifyId;
+
+    /**
+     * modifyDate
+     */
+    private Date modifyDate;
+
+    /**
+     * configFlag
+     */
+    private String configFlag;
+
+    /**
+     * configId
+     */
+    private String configId;
+
+    /**
+     * gyLcfx
+     */
+    private String gyLcfx;
+
+    /**
+     * gyByfx
+     */
+    private String gyByfx;
+
+    /**
+     * vAlt
+     */
+    private String vAlt;
+
+    /**
+     * vKHcv
+     */
+    private String vKHcv;
+
+    /**
+     * vZdhz
+     */
+    private String vZdhz;
+
+    /**
+     * vHcvRna
+     */
+    private String vHcvRna;
+
+    /**
+     * vKHavigm
+     */
+    private String vKHavigm;
+
+    /**
+     * vKHdvigm
+     */
+    private String vKHdvigm;
+
+    /**
+     * vHavRna
+     */
+    private String vHavRna;
+
+    /**
+     * vKHdv
+     */
+    private String vKHdv;
+
+    /**
+     * vHbsag
+     */
+    private String vHbsag;
+
+    /**
+     * vHdvRna
+     */
+    private String vHdvRna;
+
+    /**
+     * vKHbs
+     */
+    private String vKHbs;
+
+    /**
+     * vKHevigm
+     */
+    private String vKHevigm;
+
+    /**
+     * vHbeag
+     */
+    private String vHbeag;
+
+    /**
+     * vKHev
+     */
+    private String vKHev;
+
+    /**
+     * vKHbe
+     */
+    private String vKHbe;
+
+    /**
+     * vHevRna
+     */
+    private String vHevRna;
+
+    /**
+     * vKHbc
+     */
+    private String vKHbc;
+
+    /**
+     * vKHbcigm
+     */
+    private String vKHbcigm;
+
+    /**
+     * vHbvDna
+     */
+    private String vHbvDna;
+
+    /**
+     * gyDzbm
+     */
+    private String gyDzbm;
+
+    /**
+     * visitType
+     */
+    private String visitType;
+
+    /**
+     * cTrust
+     */
+    private String cTrust;
+
+    /**
+     * cRpr
+     */
+    private String cRpr;
+
+    /**
+     * cTppa
+     */
+    private String cTppa;
+
+    /**
+     * cTpha
+     */
+    private String cTpha;
+
+    /**
+     * mTrust
+     */
+    private String mTrust;
+
+    /**
+     * mRpr
+     */
+    private String mRpr;
+
+    /**
+     * mTppa
+     */
+    private String mTppa;
+
+    /**
+     * mOther
+     */
+    private String mOther;
+
+    /**
+     * configDate
+     */
+    private Date configDate;
+
+    /**
+     * yunDays
+     */
+    private String yunDays;
+
+    /**
+     * orderCode
+     */
+    private String orderCode;
+
+}

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

@@ -416,6 +416,7 @@ function initFeeTable() {
                 valign: 'middle',
                 // sortable: true,
                 formatter: function (value, row, index) {
+                    var buttonCodes = localStorage.getItem("buttonCodes");
                     var str = '<button type="button" class="registration-no-color-foot-button" title="费用明细" onclick="chargeDetailModal(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-plus"></i></button>';
                     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");
@@ -425,6 +426,11 @@ function initFeeTable() {
                             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>';
                         }
                         str += '<button type="button" class="registration-no-color-foot-button"title="确认收费" onclick="tipHaveTally(' + row.amount + ',\'' + row.patientId + '\',' + row.times + ',\'' + row.name + '\',' + row.receiptNo + ')"><i class="fa fa-rmb"></i></button>';
+                        if (buttonCodes != null) {
+                            if (isInArrayStr("init_clinic_for_exception", buttonCodes)) {
+                                str += '<button type="button" class="registration-no-color-foot-button" title="就诊记录修复" onclick="initClinicForException(\'' + row.patientId + '\','+row.times+');"><i class="fa fa-wrench"></i></button>';
+                            }
+                        }
                         return str;
                     }
                     if (payMarkGroup == 1) {
@@ -438,7 +444,6 @@ function initFeeTable() {
                         }
                         str += '<button type="button" class="registration-no-color-foot-button"title="支付明细" onclick="depositFileList(\'' + row.patientId + '\',' + row.times + ',' + row.receiptNo + ')"><i class="fa fa-th-list"></i></button>';
                         //是否有权限设置合同编号
-                        var buttonCodes = localStorage.getItem("buttonCodes");
                         if (buttonCodes != null) {
                             if (isInArrayStr("contract_match", buttonCodes)) {
                                 str += '<button type="button" class="registration-no-color-foot-button" title="合作项目维护" onclick="matchProject(\'' + row.realNo + '\');"><i class="fa fa-plug"></i></button>';
@@ -1170,6 +1175,32 @@ function checkFee(flag) {
     return true;
 }
 
+/**
+ * 异常接诊数据修复
+ * @param patientId
+ * @param times
+ */
+function initClinicForException(patientId, times) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/initClinicForException?patientId=' + patientId + '&times=' + times,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                successMesage(res);
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
+}
+
 
 /**
  * 提示有记账记录