Forráskód Böngészése

入院功能改造

hurugang 5 éve
szülő
commit
62b6369b96

+ 1 - 1
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -867,7 +867,7 @@ public class MedicalViewApiController {
             return resultMap;
         }
         try {
-            //mzyReqrecService.covidManageForHaici(patientId,unitCode);
+            mzyReqrecService.covidManageForHaici(patientId,unitCode);
             resultMap.put("code", 0);
             resultMap.put("message", "当前病人已经通过流调");
             return resultMap;

+ 1 - 1
src/main/java/cn/hnthyy/thmz/entity/his/ZyAdt.java

@@ -84,7 +84,7 @@ public class ZyAdt {
     private String currBed;
 
     /**
-     * 3转科病区4转科5转区6费用变7费用不变
+     * 3转科病区 4转科 5转区 6费用变 7费用不变
      */
     private String mark;
 

+ 174 - 0
src/main/java/cn/hnthyy/thmz/entity/his/ZyBedMi.java

@@ -0,0 +1,174 @@
+package cn.hnthyy.thmz.entity.his;
+
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 床位映象表
+ *
+ * @author 大狼狗 2020-11-27
+ */
+@Data
+public class ZyBedMi {
+    /**
+     * 床铺状态空闲
+     */
+    public static String BED_STATUS_FREE="1";
+    /**
+     * 床铺状态有人
+     */
+    public static String BED_STATUS_HOLD_UP="2";
+    /**
+     * 床铺状态号床
+     */
+    public static String BED_STATUS_OTHER="3";
+
+    /**
+     * 病区
+     */
+    private String wardCode;
+
+    /**
+     * 床位
+     */
+    private String bedNo;
+
+    /**
+     * 房间
+     */
+    private String roomNo;
+
+    /**
+     * 科室
+     */
+    private String deptCode;
+
+    /**
+     * 1 空闲 2 有人 3 号床
+     */
+    private String bedStatus;
+
+    /**
+     * 床位费
+     */
+    private Float roomRate1;
+
+    /**
+     * 床位费
+     */
+    private Float roomRate2;
+
+    /**
+     * 生效日期
+     */
+    private Date effDate1;
+
+    /**
+     * [eff_date2]
+     */
+    private Date effDate2;
+
+    /**
+     * 取暖费
+     */
+    private Float heatingFee;
+
+    /**
+     * 空调费
+     */
+    private Float airconditionFee;
+
+    /**
+     * 1 停止 2 取暖 3 空调
+     */
+    private String heatcoldFlag;
+
+    /**
+     * 住院号
+     */
+    private String inpatientNo;
+
+    /**
+     * 住院次数
+     */
+    private Integer admissTimes;
+
+    /**
+     * 男, 女房间
+     */
+    private String sex;
+
+    /**
+     * 费率
+     */
+    private Float percent2;
+
+    /**
+     * 费率
+     */
+    private Float percent3;
+
+    /**
+     * 费率
+     */
+    private Float percent4;
+
+    /**
+     * 费率
+     */
+    private Float percent5;
+
+    /**
+     * 1开放2加床3虚床4家庭病床5借出6借入
+     */
+    private String type;
+
+    /**
+     * 费率
+     */
+    private Float percent1;
+
+    /**
+     * [special_charge]
+     */
+    private String specialCharge;
+
+    /**
+     * [remark]
+     */
+    private String remark;
+
+    /**
+     * [icu_flag]
+     */
+    private String icuFlag;
+
+    /**
+     * 床位费编码
+     */
+    private String chargeCodeBed;
+
+    /**
+     * [charge_code_heat]
+     */
+    private String chargeCodeHeat;
+
+    /**
+     * [charge_code_air]
+     */
+    private String chargeCodeAir;
+
+    /**
+     * 住院流水号
+     */
+    private String zySerialNo;
+
+    /**
+     * 位置说明
+     */
+    private String bedPos;
+
+
+}

+ 49 - 49
src/main/java/cn/hnthyy/thmz/entity/his/ZyLedgerFile.java

@@ -13,17 +13,17 @@ import java.util.Date;
 public class ZyLedgerFile {
 
     /**
-    * [inpatient_no]
+    * 住院号
     */
     private String inpatientNo;
 
     /**
-    * [admiss_times]
+    * 住院次数
     */
     private Integer admissTimes;
 
     /**
-    * [ledger_sn]
+    * 主帐号
     */
     private Integer ledgerSn;
 
@@ -33,177 +33,177 @@ public class ZyLedgerFile {
     private Date accountDate;
 
     /**
-    * [op_id_code]
+    * 操作员
     */
     private String opIdCode;
 
     /**
-    * [deposit]
+    * 预交金
     */
     private BigDecimal deposit;
 
     /**
-    * [balance]
+    * 余额
     */
     private BigDecimal balance;
 
     /**
-    * [total_charge]
+    * 总费用
     */
-    private String totalCharge;
+    private BigDecimal totalCharge;
 
     /**
     * [charge1]
     */
-    private String charge1;
+    private BigDecimal charge1;
 
     /**
     * [charge2]
     */
-    private String charge2;
+    private BigDecimal charge2;
 
     /**
     * [charge3]
     */
-    private String charge3;
+    private BigDecimal charge3;
 
     /**
     * [charge4]
     */
-    private String charge4;
+    private BigDecimal charge4;
 
     /**
     * [charge5]
     */
-    private String charge5;
+    private BigDecimal charge5;
 
     /**
     * [charge6]
     */
-    private String charge6;
+    private BigDecimal charge6;
 
     /**
     * [charge7]
     */
-    private String charge7;
+    private BigDecimal charge7;
 
     /**
     * [charge8]
     */
-    private String charge8;
+    private BigDecimal charge8;
 
     /**
     * [charge9]
     */
-    private String charge9;
+    private BigDecimal charge9;
 
     /**
     * [charge10]
     */
-    private String charge10;
+    private BigDecimal charge10;
 
     /**
     * [charge11]
     */
-    private String charge11;
+    private BigDecimal charge11;
 
     /**
     * [charge12]
     */
-    private String charge12;
+    private BigDecimal charge12;
 
     /**
     * [charge13]
     */
-    private String charge13;
+    private BigDecimal charge13;
 
     /**
     * [charge14]
     */
-    private String charge14;
+    private BigDecimal charge14;
 
     /**
     * [charge15]
     */
-    private String charge15;
+    private BigDecimal charge15;
 
     /**
     * [charge16]
     */
-    private String charge16;
+    private BigDecimal charge16;
 
     /**
     * [charge17]
     */
-    private String charge17;
+    private BigDecimal charge17;
 
     /**
     * [charge18]
     */
-    private String charge18;
+    private BigDecimal charge18;
 
     /**
     * [charge19]
     */
-    private String charge19;
+    private BigDecimal charge19;
 
     /**
     * [charge20]
     */
-    private String charge20;
+    private BigDecimal charge20;
 
     /**
     * [charge21]
     */
-    private String charge21;
+    private BigDecimal charge21;
 
     /**
     * [charge22]
     */
-    private String charge22;
+    private BigDecimal charge22;
 
     /**
     * [charge23]
     */
-    private String charge23;
+    private BigDecimal charge23;
 
     /**
     * [charge24]
     */
-    private String charge24;
+    private BigDecimal charge24;
 
     /**
     * [charge25]
     */
-    private String charge25;
+    private BigDecimal charge25;
 
     /**
     * [charge26]
     */
-    private String charge26;
+    private BigDecimal charge26;
 
     /**
     * [charge27]
     */
-    private String charge27;
+    private BigDecimal charge27;
 
     /**
     * [charge28]
     */
-    private String charge28;
+    private BigDecimal charge28;
 
     /**
     * [charge29]
     */
-    private String charge29;
+    private BigDecimal charge29;
 
     /**
     * [charge30]
     */
-    private String charge30;
+    private BigDecimal charge30;
 
     /**
-    * [last_balance]
+    * 不用
     */
     private BigDecimal lastBalance;
 
@@ -218,27 +218,27 @@ public class ZyLedgerFile {
     private String settleType;
 
     /**
-    * [receipt_no]
+    * 收据号
     */
     private String receiptNo;
 
     /**
-    * [ward_x]
+    * 结算小病房
     */
     private String wardX;
 
     /**
-    * [dept_x]
+    * 结算小科室
     */
     private String deptX;
 
     /**
-    * [ward_code]
+    * 病房
     */
     private String wardCode;
 
     /**
-    * [dept_code]
+    * 科室
     */
     private String deptCode;
 
@@ -248,27 +248,27 @@ public class ZyLedgerFile {
     private Date cashDate;
 
     /**
-    * [zy_serial_no]
+    * 住院流水号
     */
     private String zySerialNo;
 
     /**
-    * [cash_id]
+    * 出纳员
     */
     private String cashId;
 
     /**
-    * [dcount_no]
+    * 1:已结账
     */
     private String dcountNo;
 
     /**
-    * [dcount_date]
+    * 结账日期
     */
     private Date dcountDate;
 
     /**
-    * [tf_flag]
+    * 1:已作冲销
     */
     private String tfFlag;
 

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/ZyAdtMapper.java

@@ -21,6 +21,6 @@ public interface ZyAdtMapper {
      * @return
      */
     @Insert("INSERT INTO zy_adt ( zy_serial_no , inpatient_no , admiss_times , trans_times , admiss_date , curr_ward , curr_dept , curr_room , curr_bed , mark ) " +
-            "VALUES ( #{zySerialNo} , #{inpatientNo} , #{admissTimes} , #{trans_times} , #{admissDate} , #{currWard} , #{currDept} , #{currRoom} , #{currBed} , #{mark}) ")
+            "VALUES ( #{zySerialNo} , #{inpatientNo} , #{admissTimes} , #{transTimes} , #{admissDate} , #{currWard} , #{currDept} , #{currRoom} , #{currBed} , #{mark}) ")
     int inserZyAdt(ZyAdt zyAdt);
 }

+ 14 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/ZyBedMiMapper.java

@@ -0,0 +1,14 @@
+package cn.hnthyy.thmz.mapper.his;
+
+import cn.hnthyy.thmz.entity.his.ZyBedMi;
+import org.apache.ibatis.annotations.Update;
+
+public interface ZyBedMiMapper {
+    /**
+     * 更新床位
+     * @param zyBedMi
+     * @return
+     */
+    @Update(" update zy_bed_mi SET bed_status =#{bedStatus} , inpatient_no =#{inpatientNo} , admiss_times =#{admissTimes} WHERE ward_code =#{wardCode} AND dept_code =#{deptCode} AND bed_no =#{bedNo} ")
+    int updateZyBedMi(ZyBedMi zyBedMi);
+}

+ 17 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zyLedgerFileMapper.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.mapper.his;
 
 import cn.hnthyy.thmz.entity.his.ZyLedgerFile;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
@@ -16,4 +17,20 @@ public interface zyLedgerFileMapper {
      */
     @Select("select * from zy_ledger_file where inpatient_no=#{inpatientNo} and admiss_times = #{admissTimes}  ")
     List<ZyLedgerFile> selectZyLedgerFileByInpatientNoAndTimes(@Param("inpatientNo") String inpatientNo, @Param("admissTimes") Integer admissTimes);
+
+
+    /**
+     * 插入账页信息
+     * @param zyLedgerFile
+     * @return
+     */
+    @Insert("INSERT INTO zy_ledger_file (inpatient_no , admiss_times , ledger_sn , op_id_code , deposit , balance , total_charge , charge1 , charge2 , charge3 , " +
+            "charge4 , charge5 , charge6 , charge7 , charge8 , charge9 , charge10 , charge11 , charge12 , charge13 , charge14 , charge15 , charge16 , charge17 , " +
+            "charge18 , charge19 , charge20 , charge21 , charge22 , charge23 , charge24 , charge25 , charge26 , charge27 , charge28 , charge29 , charge30 , " +
+            "settle , last_balance , settle_type , dept_code , ward_code , dept_x , ward_x , account_date , cash_date , cash_id , dcount_no , dcount_date , zy_serial_no )" +
+            " VALUES ( #{inpatientNo} , #{admissTimes},#{ledgerSn} , #{opIdCode}, #{deposit} , #{balance} , #{totalCharge} , #{charge1} , #{charge2} ,#{charge3} ," +
+            "#{charge4},#{charge5} , #{charge6}, #{charge7} , #{charge8}, #{charge9} , #{charge10} ,#{charge11} , #{charge12}, #{charge13} , #{charge14}, #{charge15} ,#{charge16} , #{charge17}, " +
+            "#{charge18}, #{charge19}, #{charge20} , #{charge21} , #{charge22} , #{charge23} , #{charge24} , #{charge25} , #{charge26} ,#{charge27} ,#{charge28} , #{charge29} , #{charge30} ," +
+            " #{settle} ,#{lastBalance}, #{settleType} , #{deptCode} , #{wardCode} , #{deptX} , #{wardX} , #{accountDate} , #{cashDate} , #{cashId} , #{dcountNo} , #{dcountDate} , #{zySerialNo} ) ")
+    int insetZyLedgerFile(ZyLedgerFile zyLedgerFile);
 }

+ 93 - 7
src/main/java/cn/hnthyy/thmz/service/impl/his/ZyActpatientServiceImpl.java

@@ -1,16 +1,11 @@
 package cn.hnthyy.thmz.service.impl.his;
 
 import cn.hnthyy.thmz.entity.MzException;
-import cn.hnthyy.thmz.entity.his.APatientMi;
-import cn.hnthyy.thmz.entity.his.MzZyReq;
-import cn.hnthyy.thmz.entity.his.ZyActpatient;
+import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.enums.BedStatusEnum;
 import cn.hnthyy.thmz.enums.ResponceTypeEnum;
 import cn.hnthyy.thmz.enums.YesNoEnum;
-import cn.hnthyy.thmz.mapper.his.APatientMiMapper;
-import cn.hnthyy.thmz.mapper.his.MzZyReqMapper;
-import cn.hnthyy.thmz.mapper.his.PatientMiSfzMapper;
-import cn.hnthyy.thmz.mapper.his.ZyActpatientMapper;
+import cn.hnthyy.thmz.mapper.his.*;
 import cn.hnthyy.thmz.service.his.ZyActpatientService;
 import cn.hnthyy.thmz.service.his.ZyConfigService;
 import org.apache.commons.lang3.StringUtils;
@@ -21,6 +16,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -38,6 +34,15 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
     @SuppressWarnings("all")
     @Autowired
     private PatientMiSfzMapper patientMiSfzMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private ZyAdtMapper zyAdtMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private ZyBedMiMapper zyBedMiMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private zyLedgerFileMapper zyLedgerFileMapper;
     @Autowired
     private ZyConfigService zyConfigService;
 
@@ -56,6 +61,9 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
         if(aPatientMiDb==null){
             throw new MzException("当前病人还未建档成功!");
         }
+        if(zyActpatientMapper.selectCountByInpatientNo(aPatientMiDb.getInpatientNo())>0){
+            throw new MzException("当前病人是在院病人,请不要重复操作!");
+        }
         if(aPatientMiDb.getLastadmissTimes()==null){
             aPatientMiDb.setLastadmissTimes(0);
         }
@@ -106,9 +114,11 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
         zyActpatient.setDept(zyActpatient.getAdmissDept());
         zyActpatient.setWard(zyActpatient.getAdmissWard());
         zyActpatient.setSex(aPatientMiDb.getSex());
+        zyActpatient.setInputDate(new Date());
         zyActpatient.setTableName("zy_actpatient");
         int num= zyActpatientMapper.insertZyActpatient(zyActpatient);
         if(num>0){
+            //修改门诊住院申请单
             MzZyReq mzZyReq = new MzZyReq();
             mzZyReq.setPatientId(zyActpatient.getMzNo());
             mzZyReq.setConfirmId(zyActpatient.getOpIdCode());
@@ -116,6 +126,82 @@ public class ZyActpatientServiceImpl implements ZyActpatientService {
             mzZyReq.setZySerialNo(zyActpatient.getZySerialNo());
             mzZyReq.setReqStatus(YesNoEnum.YES.code.toString());
             mzZyReqMapper.updateMzZyReq(mzZyReq);
+            //病人流转入库
+            ZyAdt zyAdt = new ZyAdt();
+            zyAdt.setZySerialNo(zyActpatient.getZySerialNo());
+            zyAdt.setInpatientNo(zyActpatient.getInpatientNo());
+            zyAdt.setAdmissTimes(zyActpatient.getAdmissTimes());
+            zyAdt.setTransTimes(0);
+            zyAdt.setAdmissDate(zyActpatient.getAdmissDate());
+            zyAdt.setCurrWard(zyActpatient.getWard());
+            zyAdt.setCurrDept(zyActpatient.getDept());
+            zyAdt.setCurrRoom(null);
+            zyAdt.setCurrBed(zyActpatient.getBedNo());
+            zyAdt.setMark("1");
+            zyAdtMapper.deleteZyAdt(zyAdt.getInpatientNo(),zyAdt.getAdmissTimes());
+            zyAdtMapper.inserZyAdt(zyAdt);
+            //更新床号记录
+            ZyBedMi zyBedMi = new ZyBedMi();
+            zyBedMi.setBedStatus(ZyBedMi.BED_STATUS_FREE);
+            zyBedMi.setInpatientNo(zyActpatient.getInpatientNo());
+            zyBedMi.setAdmissTimes(zyActpatient.getAdmissTimes());
+            zyBedMi.setDeptCode(zyActpatient.getDept());
+            zyBedMi.setWardCode(zyActpatient.getDept());
+            zyBedMi.setBedNo(zyActpatient.getBedNo());
+            zyBedMiMapper.updateZyBedMi(zyBedMi);
+            //入库账页信息
+            ZyLedgerFile zyLedgerFile = new ZyLedgerFile();
+            zyLedgerFile.setInpatientNo(zyActpatient.getInpatientNo());
+            zyLedgerFile.setAdmissTimes(zyActpatient.getAdmissTimes());
+            zyLedgerFile.setLedgerSn(1);
+            zyLedgerFile.setOpIdCode(zyActpatient.getOpIdCode());
+            zyLedgerFile.setDeposit(BigDecimal.ZERO);
+            zyLedgerFile.setBalance(BigDecimal.ZERO);
+            zyLedgerFile.setTotalCharge(BigDecimal.ZERO);
+            zyLedgerFile.setCharge1(BigDecimal.ZERO);
+            zyLedgerFile.setCharge2(BigDecimal.ZERO);
+            zyLedgerFile.setCharge3(BigDecimal.ZERO);
+            zyLedgerFile.setCharge4(BigDecimal.ZERO);
+            zyLedgerFile.setCharge5(BigDecimal.ZERO);
+            zyLedgerFile.setCharge6(BigDecimal.ZERO);
+            zyLedgerFile.setCharge7(BigDecimal.ZERO);
+            zyLedgerFile.setCharge8(BigDecimal.ZERO);
+            zyLedgerFile.setCharge9(BigDecimal.ZERO);
+            zyLedgerFile.setCharge10(BigDecimal.ZERO);
+            zyLedgerFile.setCharge11(BigDecimal.ZERO);
+            zyLedgerFile.setCharge12(BigDecimal.ZERO);
+            zyLedgerFile.setCharge13(BigDecimal.ZERO);
+            zyLedgerFile.setCharge14(BigDecimal.ZERO);
+            zyLedgerFile.setCharge15(BigDecimal.ZERO);
+            zyLedgerFile.setCharge16(BigDecimal.ZERO);
+            zyLedgerFile.setCharge17(BigDecimal.ZERO);
+            zyLedgerFile.setCharge18(BigDecimal.ZERO);
+            zyLedgerFile.setCharge19(BigDecimal.ZERO);
+            zyLedgerFile.setCharge20(BigDecimal.ZERO);
+            zyLedgerFile.setCharge21(BigDecimal.ZERO);
+            zyLedgerFile.setCharge22(BigDecimal.ZERO);
+            zyLedgerFile.setCharge23(BigDecimal.ZERO);
+            zyLedgerFile.setCharge24(BigDecimal.ZERO);
+            zyLedgerFile.setCharge25(BigDecimal.ZERO);
+            zyLedgerFile.setCharge26(BigDecimal.ZERO);
+            zyLedgerFile.setCharge27(BigDecimal.ZERO);
+            zyLedgerFile.setCharge28(BigDecimal.ZERO);
+            zyLedgerFile.setCharge29(BigDecimal.ZERO);
+            zyLedgerFile.setCharge30(BigDecimal.ZERO);
+            zyLedgerFile.setSettle(BigDecimal.ZERO);
+            zyLedgerFile.setLastBalance(BigDecimal.ZERO);
+            zyLedgerFile.setSettleType("0");
+            zyLedgerFile.setDeptCode(zyActpatient.getDept());
+            zyLedgerFile.setWardCode(zyActpatient.getWard());
+            zyLedgerFile.setDeptX("");
+            zyLedgerFile.setWardX("");
+            zyLedgerFile.setAccountDate(null);
+            zyLedgerFile.setCashDate(null);
+            zyLedgerFile.setCashId("");
+            zyLedgerFile.setDcountNo("");
+            zyLedgerFile.setDcountDate(null);
+            zyLedgerFile.setZySerialNo(zyActpatient.getZySerialNo());
+            zyLedgerFileMapper.insetZyLedgerFile(zyLedgerFile);
         }
         return num;
     }

+ 29 - 1
src/main/resources/static/js/hospitalized.js

@@ -479,7 +479,35 @@ function queryUserInfoByCardNo() {
                                     $("#idCard").attr("title", resAp.data.socialNo);
                                     $("#idCard").blur();
                                     $("#admissionNumber").val(resAp.data.inpatientNo);
-
+                                    //验证当前病人是不是在院病人
+                                    if(resAp.data.inpatientNo!=null && resAp.data.inpatientNo!=""){
+                                        $.ajax({
+                                            type: "GET",
+                                            url: '/thmz/getCountByInpatientNo?inpatientNo=' + resAp.data.inpatientNo,
+                                            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) {
+                                                    if (res.data > 0) {
+                                                        new PNotify({
+                                                            title: '错误提示',
+                                                            text: '当前办理入院的病人是在院病人,请不要重复操作!',
+                                                            type: 'error',
+                                                            hide: false,
+                                                            styling: 'bootstrap3'
+                                                        });
+                                                    }
+                                                } else {
+                                                    errorMesage(res);
+                                                }
+                                            }
+                                        });
+                                    }
                                 }
                             }
                         });