Pārlūkot izejas kodu

传染病上报

DESKTOP-0GD05B0\Administrator 2 gadi atpakaļ
vecāks
revīzija
e214822196

+ 23 - 3
src/main/java/thyyxxk/webserver/controller/zhuyuanyizheng/ContagiousDiseaseController.java

@@ -1,12 +1,15 @@
 package thyyxxk.webserver.controller.zhuyuanyizheng;
 
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.zhuyuanyisheng.contagiousdisease.CrbMainCard;
 import thyyxxk.webserver.service.zhuyuanyisheng.ContagiousDiseaseService;
 
+import java.util.List;
+
 @RestController
-@RequestMapping("/ContagiousDisease")
+@RequestMapping("/contagiousDisease")
 public class ContagiousDiseaseController {
 
     private final ContagiousDiseaseService service;
@@ -15,4 +18,21 @@ public class ContagiousDiseaseController {
     public ContagiousDiseaseController(ContagiousDiseaseService service) {
         this.service = service;
     }
+
+    @GetMapping("/getContagiousDiseaseByPatNo")
+    public ResultVo<List<CrbMainCard>> getContagiousDiseaseByPatNo(@RequestParam("patNo") String patNo) {
+        return service.getContagiousDiseaseByPatNo(patNo);
+    }
+
+    @PostMapping("/confirmCrb")
+    public ResultVo<String> confirmCrb(@RequestBody CrbMainCard param) {
+        return service.confirmCrb(param);
+    }
+
+    @PostMapping("/updateCrb")
+    public ResultVo<String> updateCrb(@RequestBody CrbMainCard param) {
+        return service.updateCrb(param);
+    }
+
+
 }

+ 6 - 0
src/main/java/thyyxxk/webserver/dao/his/PublicDao.java

@@ -213,6 +213,12 @@ public interface PublicDao {
     @Update("update yz_sequence set page_no = #{newId} where page_no = #{oldId} ")
     int genXingCaoYaoDanHao(Integer newId, Integer oldId);
 
+    @Select("select card_no from crb_config")
+    Integer oldCrbNo();
+
+    @Update("update crb_config set card_no =#{newId} where card_no = #{oldId}")
+    int updateCrbNo(Integer newId, Integer oldId);
+
     @Select("select top (1) cast(settle_type as int) as settle_type " + "from zy_ledger_file " + "where inpatient_no = #{patNo} " + "  and admiss_times = #{times} " + "order by ledger_sn desc")
     Integer jieSuanXinXi(@Param("patNo") String patNo, @Param("times") Integer times);
 

+ 103 - 1
src/main/java/thyyxxk/webserver/dao/his/zhuyuanyisheng/ContagiousDiseaseDao.java

@@ -1,4 +1,106 @@
 package thyyxxk.webserver.dao.his.zhuyuanyisheng;
 
-public interface ContagiousDiseaseDao {
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Select;
+import thyyxxk.webserver.entity.zhuyuanyisheng.contagiousdisease.CrbMainCard;
+
+import java.util.List;
+
+@Mapper
+public interface ContagiousDiseaseDao extends BaseMapper<CrbMainCard> {
+
+    @Select("SELECT patient_id, " +
+            "       times, " +
+            "       card_no, " +
+            "       ill_type, " +
+            "       scope_flag, " +
+            "       name, " +
+            "       sex, " +
+            "       age, " +
+            "       age_unit, " +
+            "       corporation, " +
+            "       relation_tel, " +
+            "       genearch, " +
+            "       current_district, " +
+            "       current_street, " +
+            "       home_district, " +
+            "       home_street, " +
+            "       occupation_code, " +
+            "       ill_start_date, " +
+            "       ill_first_date, " +
+            "       admiss_date, " +
+            "       dis_date, " +
+            "       dischar_status, " +
+            "       dis_diag_type, " +
+            "       report_hospital, " +
+            "       report_dept, " +
+            "       zy_mz_flag, " +
+            "       report_opera, " +
+            "       report_date, " +
+            "       anamnesis, " +
+            "       rtrim(contagion) contagion, " +
+            "       rtrim(contagion_text) contagion_text, " +
+            "       social_no, " +
+            "       rtrim(contagion2) contagion2, " +
+            "       rtrim(contagion3) contagion3, " +
+            "       op_id, " +
+            "       input_dt, " +
+            "       death_date, " +
+            "       case_type, " +
+            "       vaccinate, " +
+            "       dc_flag, " +
+            "       vaccinate2, " +
+            "       rtrim(contagion_qt) contagion_qt, " +
+            "       card_ret, " +
+            "       report_tel, " +
+            "       birth_date, " +
+            "       remark, " +
+            "       status_flag, " +
+            "       sub_card, " +
+            "       icd_code, " +
+            "       print_flag, " +
+            "       modify_id, " +
+            "       modify_date, " +
+            "       config_flag, " +
+            "       config_id, " +
+            "       gy_lcfx, " +
+            "       gy_byfx, " +
+            "       rtrim(v_alt) valt, " +
+            "       rtrim(v_k_hcv) vkhcv, " +
+            "       rtrim(v_zdhz) vzdhz, " +
+            "       rtrim(v_hcv_rna) vhcvrna, " +
+            "       rtrim(v_k_havigm) vkhavigm, " +
+            "       rtrim(v_k_hdvigm) vkhdvigm, " +
+            "       rtrim(v_hav_rna) vhavrna, " +
+            "       rtrim(v_k_hdv) vkhdv, " +
+            "       rtrim(v_hbsag) vhbsag, " +
+            "       rtrim(v_hdv_rna) vhdvrna, " +
+            "       rtrim(v_k_hbs) vkhbs, " +
+            "       rtrim(v_k_hevigm) vkhevigm, " +
+            "       rtrim(v_hbeag) vhbeag, " +
+            "       rtrim(v_k_hev) vkhev, " +
+            "       rtrim(v_k_hbe) vkhbe, " +
+            "       rtrim(v_hev_rna) vhevrna, " +
+            "       rtrim(v_k_hbc) vkhbc, " +
+            "       rtrim(v_k_hbcigm) vkhbcigm, " +
+            "       rtrim(v_hbv_dna) vhbvdna, " +
+            "       gy_dzbm, " +
+            "       visit_type, " +
+            "       rtrim(c_trust) ctrust, " +
+            "       rtrim(c_rpr) crpr, " +
+            "       rtrim(c_tppa) ctppa, " +
+            "       rtrim(c_tpha)  ctpha, " +
+            "       rtrim(m_trust) mtrust, " +
+            "       rtrim(m_rpr) mrpr, " +
+            "       rtrim(m_tppa) mtppa, " +
+            "       rtrim(m_other) mother, " +
+            "       config_date, " +
+            "       yun_days, " +
+            "       order_code " +
+            "FROM crb_main_card a " +
+            "where patient_id = #{patNo} " +
+            "  and status_flag <> 'd'")
+    List<CrbMainCard> seleceContagiousDisease(String patNo);
+
 }

+ 459 - 0
src/main/java/thyyxxk/webserver/entity/zhuyuanyisheng/contagiousdisease/CrbMainCard.java

@@ -0,0 +1,459 @@
+package thyyxxk.webserver.entity.zhuyuanyisheng.contagiousdisease;
+
+import java.io.Serializable;
+
+import com.alibaba.fastjson.annotation.JSONField;
+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;
+
+}

+ 15 - 0
src/main/java/thyyxxk/webserver/service/PublicServer.java

@@ -244,6 +244,21 @@ public class PublicServer {
         return Integer.valueOf(DateUtil.formatDatetime(new Date(), "yyMMdd") + newId);
     }
 
+    /**
+     * 获取传染病序号
+     *
+     * @return 序号
+     */
+    public Integer getCrbNo() {
+        Integer oldId = dao.oldCrbNo();
+        Integer newId = oldId + 1;
+        int num = dao.updateCrbNo(newId, oldId);
+        if (num == 0) {
+            throw new BizException(ExceptionEnum.LOGICAL_ERROR, "生成申请号错误,请重试!");
+        }
+        return newId;
+    }
+
     /**
      * @param inpatientNo 住院号
      * @return 返回婴儿标志

+ 2 - 0
src/main/java/thyyxxk/webserver/service/redislike/RedisLikeService.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service.redislike;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import thyyxxk.webserver.dao.his.redislike.RedisLikeDao;
@@ -190,6 +191,7 @@ public class RedisLikeService {
         return name;
     }
 
+    @DS("his")
     public UserInfo getUserInfoByCode(String code) {
         if (StringUtil.invalidValue(code)) {
             return null;

+ 9 - 6
src/main/java/thyyxxk/webserver/service/xctest/TempText.java

@@ -7,30 +7,33 @@ import java.util.Objects;
 import java.util.function.Function;
 
 
-public class TempText<V> {
+/**
+ * @author Administrator
+ */
+public class TempText<T> {
     private final Map<String, Object> map = new HashMap<>();
 
     @SuppressWarnings("unchecked")
-    V get(String name) {
+    T get(String name) {
         if (map.containsKey(name)) {
-            return (V) map.get(name);
+            return (T) map.get(name);
         }
         return null;
     }
 
     @SuppressWarnings("unchecked")
-    V get(String name, Function<String, Object> filter) {
+    T get(String name, Function<String, Object> filter) {
         Objects.requireNonNull(filter);
 
         if (map.containsKey(name)) {
-            return (V) map.get(name);
+            return (T) map.get(name);
         }
         Object object = filter.apply(name);
         if (object == null) {
             return null;
         } else {
             map.put(name, object);
-            return (V) (object);
+            return (T) (object);
         }
     }
 

+ 55 - 1
src/main/java/thyyxxk/webserver/service/zhuyuanyisheng/ContagiousDiseaseService.java

@@ -1,20 +1,74 @@
 package thyyxxk.webserver.service.zhuyuanyisheng;
 
+import cn.hutool.extra.spring.SpringUtil;
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import thyyxxk.webserver.config.exception.ExceptionEnum;
 import thyyxxk.webserver.dao.his.zhuyuanyisheng.ContagiousDiseaseDao;
+import thyyxxk.webserver.entity.ResultVo;
+import thyyxxk.webserver.entity.zhuyuanyisheng.contagiousdisease.CrbMainCard;
+import thyyxxk.webserver.service.PublicServer;
+import thyyxxk.webserver.utils.ResultVoUtil;
+import thyyxxk.webserver.utils.TokenUtil;
+
+import java.util.Date;
+import java.util.List;
 
 @Service
+@Slf4j
 public class ContagiousDiseaseService {
 
     private final ContagiousDiseaseDao dao;
+    private final PublicServer publicServer;
 
     @Autowired
-    public ContagiousDiseaseService(ContagiousDiseaseDao dao) {
+    public ContagiousDiseaseService(ContagiousDiseaseDao dao, PublicServer publicServer) {
         this.dao = dao;
+        this.publicServer = publicServer;
+    }
+
+    private ContagiousDiseaseService getThis() {
+        return SpringUtil.getBean(this.getClass());
+    }
+
+    public ResultVo<List<CrbMainCard>> getContagiousDiseaseByPatNo(String patNo) {
+        List<CrbMainCard> list = dao.seleceContagiousDisease(patNo);
+        return ResultVoUtil.success(list);
+    }
+
+    public ResultVo<String> confirmCrb(CrbMainCard param) {
+        param.setCardNo(publicServer.getCrbNo().toString());
+        setTheValue(param);
+        dao.insert(param);
+
+        log.info("上传传染病==》操作人:{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(param));
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "保存成功。");
+    }
+
+    private void setTheValue(CrbMainCard param) {
+        Date date = new Date();
+        String code = TokenUtil.getTokenUserId();
+
+        param.setReportOpera(code);
+        param.setReportDate(date);
+        param.setOpId(code);
+        param.setInputDt(date);
+        param.setZyMzFlag("1");
+        param.setStatusFlag("1");
     }
 
+    public ResultVo<String> updateCrb(CrbMainCard param) {
+        setTheValue(param);
+        QueryWrapper<CrbMainCard> qw = new QueryWrapper<>();
 
+        qw.eq("card_no", param.getCardNo());
+        dao.update(param, qw);
+        log.info("更新传染病==》操作人:{},数据:{}", TokenUtil.getTokenUserId(), JSON.toJSONString(param));
+        return ResultVoUtil.success(ExceptionEnum.SUCCESS_AND_NOTIFICATION, "修改成功。");
+    }
 
 
 }