Selaa lähdekoodia

新增病历引用表信息

gaodm 5 vuotta sitten
vanhempi
commit
49f0baf2cb

+ 37 - 0
docs/022.20191118预问诊新对接/init_prec.sql

@@ -8,3 +8,40 @@ ADD COLUMN `is_quoted`  int(1) NULL DEFAULT 0 COMMENT '是否被引用:0-未
 ALTER TABLE `prec_question_info` ADD COLUMN `flag` varchar(20) NOT NULL DEFAULT ''
  COMMENT '类型标记(1:时间类型,2:诱因类型,3:伴随类型)' AFTER `spec_flag`;
 
+DROP TABLE IF EXISTS `prec_inquiry_quote`;
+ CREATE TABLE `prec_inquiry_quote` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
+  `is_deleted` char(1) NOT NULL DEFAULT 'N' COMMENT '是否删除,N:未删除,Y:删除',
+  `gmt_create` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录创建时间',
+  `gmt_modified` datetime NOT NULL DEFAULT '1970-01-01 12:00:00' COMMENT '记录修改时间,如果时间是1970年则表示纪录未修改',
+  `creator` varchar(20) NOT NULL DEFAULT '0' COMMENT '创建人,0表示无创建人值',
+  `modifier` varchar(20) NOT NULL DEFAULT '0' COMMENT '修改人,如果为0则表示纪录未修改',
+  `inquiry_id` bigint(20) NOT NULL COMMENT '引用问诊id',
+  `hospital_id` bigint(20) NOT NULL COMMENT '医院id',
+  `hospital_code` varchar(16) NOT NULL COMMENT '医院编码',
+  `hospital_name` varchar(32) NOT NULL COMMENT '医院名称',
+  `son_hospital_id` bigint(20) DEFAULT '0' COMMENT '子医院id',
+  `son_hospital_code` varchar(16) DEFAULT '' COMMENT '子医院code',
+  `son_hospital_name` varchar(32) DEFAULT '' COMMENT '子医院名称',
+  `hospital_dept_id` bigint(20) NOT NULL COMMENT '医院科室id',
+  `hospital_dept_code` varchar(16) NOT NULL COMMENT '医院科室编码',
+  `hospital_dept_name` varchar(32) NOT NULL COMMENT '医院科室名称',
+  `doctor_id` bigint(20) NOT NULL COMMENT '医生id',
+  `doctor_code` varchar(16) NOT NULL COMMENT '医生编码',
+  `doctor_name` varchar(32) NOT NULL COMMENT '医生姓名',
+  `patient_id` bigint(20) NOT NULL COMMENT '患者id',
+  `patient_code` varchar(16) NOT NULL COMMENT '患者编号',
+  `patient_name` varchar(32) NOT NULL COMMENT '患者姓名',
+  `patient_sex` int(1) DEFAULT NULL COMMENT '患者性别:1男2女',
+  `patient_phone` varchar(20) DEFAULT NULL COMMENT '患者联系电话',
+  `patient_birthday` datetime DEFAULT NULL COMMENT '患者出生日期',
+  `patient_id_no` varchar(30) DEFAULT NULL COMMENT '患者证件号码(病历号)',
+  `inquiry_code` varchar(50) NOT NULL COMMENT '就诊序列号',
+  `reg_visited_state` int(1) DEFAULT NULL COMMENT '就诊状态(0待接诊,1接诊中,2完成接诊)',
+  `type` int(1) DEFAULT NULL COMMENT '分类(1:门诊,2:住院)',
+  `data_json` longtext COMMENT '内容JSON字符串',
+  `remark` varchar(128) DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='问诊记录-主表';
+
+

+ 432 - 0
prec-service/src/main/java/com/diagbot/entity/InquiryQuote.java

@@ -0,0 +1,432 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 问诊记录-主表
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+@TableName("prec_inquiry_quote")
+public class InquiryQuote implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 引用问诊id
+     */
+    private Long inquiryId;
+
+    /**
+     * 医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院编码
+     */
+    private String hospitalCode;
+
+    /**
+     * 医院名称
+     */
+    private String hospitalName;
+
+    /**
+     * 子医院id
+     */
+    private Long sonHospitalId;
+
+    /**
+     * 子医院code
+     */
+    private String sonHospitalCode;
+
+    /**
+     * 子医院名称
+     */
+    private String sonHospitalName;
+
+    /**
+     * 医院科室id
+     */
+    private Long hospitalDeptId;
+
+    /**
+     * 医院科室编码
+     */
+    private String hospitalDeptCode;
+
+    /**
+     * 医院科室名称
+     */
+    private String hospitalDeptName;
+
+    /**
+     * 医生id
+     */
+    private Long doctorId;
+
+    /**
+     * 医生编码
+     */
+    private String doctorCode;
+
+    /**
+     * 医生姓名
+     */
+    private String doctorName;
+
+    /**
+     * 患者id
+     */
+    private Long patientId;
+
+    /**
+     * 患者编号
+     */
+    private String patientCode;
+
+    /**
+     * 患者姓名
+     */
+    private String patientName;
+
+    /**
+     * 患者性别:1男2女
+     */
+    private Integer patientSex;
+
+    /**
+     * 患者联系电话
+     */
+    private String patientPhone;
+
+    /**
+     * 患者出生日期
+     */
+    private Date patientBirthday;
+
+    /**
+     * 患者证件号码(病历号)
+     */
+    private String patientIdNo;
+
+    /**
+     * 就诊序列号
+     */
+    private String inquiryCode;
+
+    /**
+     * 就诊状态(0待接诊,1接诊中,2完成接诊)
+     */
+    private Integer regVisitedState;
+
+    /**
+     * 分类(1:门诊,2:住院)
+     */
+    private Integer type;
+
+    /**
+     * 内容JSON字符串
+     */
+    private String dataJson;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public Long getInquiryId() {
+        return inquiryId;
+    }
+
+    public void setInquiryId(Long inquiryId) {
+        this.inquiryId = inquiryId;
+    }
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getHospitalName() {
+        return hospitalName;
+    }
+
+    public void setHospitalName(String hospitalName) {
+        this.hospitalName = hospitalName;
+    }
+    public Long getSonHospitalId() {
+        return sonHospitalId;
+    }
+
+    public void setSonHospitalId(Long sonHospitalId) {
+        this.sonHospitalId = sonHospitalId;
+    }
+    public String getSonHospitalCode() {
+        return sonHospitalCode;
+    }
+
+    public void setSonHospitalCode(String sonHospitalCode) {
+        this.sonHospitalCode = sonHospitalCode;
+    }
+    public String getSonHospitalName() {
+        return sonHospitalName;
+    }
+
+    public void setSonHospitalName(String sonHospitalName) {
+        this.sonHospitalName = sonHospitalName;
+    }
+    public Long getHospitalDeptId() {
+        return hospitalDeptId;
+    }
+
+    public void setHospitalDeptId(Long hospitalDeptId) {
+        this.hospitalDeptId = hospitalDeptId;
+    }
+    public String getHospitalDeptCode() {
+        return hospitalDeptCode;
+    }
+
+    public void setHospitalDeptCode(String hospitalDeptCode) {
+        this.hospitalDeptCode = hospitalDeptCode;
+    }
+    public String getHospitalDeptName() {
+        return hospitalDeptName;
+    }
+
+    public void setHospitalDeptName(String hospitalDeptName) {
+        this.hospitalDeptName = hospitalDeptName;
+    }
+    public Long getDoctorId() {
+        return doctorId;
+    }
+
+    public void setDoctorId(Long doctorId) {
+        this.doctorId = doctorId;
+    }
+    public String getDoctorCode() {
+        return doctorCode;
+    }
+
+    public void setDoctorCode(String doctorCode) {
+        this.doctorCode = doctorCode;
+    }
+    public String getDoctorName() {
+        return doctorName;
+    }
+
+    public void setDoctorName(String doctorName) {
+        this.doctorName = doctorName;
+    }
+    public Long getPatientId() {
+        return patientId;
+    }
+
+    public void setPatientId(Long patientId) {
+        this.patientId = patientId;
+    }
+    public String getPatientCode() {
+        return patientCode;
+    }
+
+    public void setPatientCode(String patientCode) {
+        this.patientCode = patientCode;
+    }
+    public String getPatientName() {
+        return patientName;
+    }
+
+    public void setPatientName(String patientName) {
+        this.patientName = patientName;
+    }
+    public Integer getPatientSex() {
+        return patientSex;
+    }
+
+    public void setPatientSex(Integer patientSex) {
+        this.patientSex = patientSex;
+    }
+    public String getPatientPhone() {
+        return patientPhone;
+    }
+
+    public void setPatientPhone(String patientPhone) {
+        this.patientPhone = patientPhone;
+    }
+    public Date getPatientBirthday() {
+        return patientBirthday;
+    }
+
+    public void setPatientBirthday(Date patientBirthday) {
+        this.patientBirthday = patientBirthday;
+    }
+    public String getPatientIdNo() {
+        return patientIdNo;
+    }
+
+    public void setPatientIdNo(String patientIdNo) {
+        this.patientIdNo = patientIdNo;
+    }
+    public String getInquiryCode() {
+        return inquiryCode;
+    }
+
+    public void setInquiryCode(String inquiryCode) {
+        this.inquiryCode = inquiryCode;
+    }
+    public Integer getRegVisitedState() {
+        return regVisitedState;
+    }
+
+    public void setRegVisitedState(Integer regVisitedState) {
+        this.regVisitedState = regVisitedState;
+    }
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+    public String getDataJson() {
+        return dataJson;
+    }
+
+    public void setDataJson(String dataJson) {
+        this.dataJson = dataJson;
+    }
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "InquiryQuote{" +
+            "id=" + id +
+            ", isDeleted=" + isDeleted +
+            ", gmtCreate=" + gmtCreate +
+            ", gmtModified=" + gmtModified +
+            ", creator=" + creator +
+            ", modifier=" + modifier +
+            ", inquiryId=" + inquiryId +
+            ", hospitalId=" + hospitalId +
+            ", hospitalCode=" + hospitalCode +
+            ", hospitalName=" + hospitalName +
+            ", sonHospitalId=" + sonHospitalId +
+            ", sonHospitalCode=" + sonHospitalCode +
+            ", sonHospitalName=" + sonHospitalName +
+            ", hospitalDeptId=" + hospitalDeptId +
+            ", hospitalDeptCode=" + hospitalDeptCode +
+            ", hospitalDeptName=" + hospitalDeptName +
+            ", doctorId=" + doctorId +
+            ", doctorCode=" + doctorCode +
+            ", doctorName=" + doctorName +
+            ", patientId=" + patientId +
+            ", patientCode=" + patientCode +
+            ", patientName=" + patientName +
+            ", patientSex=" + patientSex +
+            ", patientPhone=" + patientPhone +
+            ", patientBirthday=" + patientBirthday +
+            ", patientIdNo=" + patientIdNo +
+            ", inquiryCode=" + inquiryCode +
+            ", regVisitedState=" + regVisitedState +
+            ", type=" + type +
+            ", dataJson=" + dataJson +
+            ", remark=" + remark +
+        "}";
+    }
+}

+ 9 - 0
prec-service/src/main/java/com/diagbot/facade/InquiryInfoFacade.java

@@ -12,6 +12,7 @@ import com.diagbot.dto.SaveInquiryDTO;
 import com.diagbot.entity.InquiryDetail;
 import com.diagbot.entity.InquiryEvaluator;
 import com.diagbot.entity.InquiryInfo;
+import com.diagbot.entity.InquiryQuote;
 import com.diagbot.entity.InquiryReport;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.SexEnum;
@@ -64,6 +65,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
     private InquiryReportServiceImpl inquiryReportServiceImpl;
     @Autowired
     private TranServiceClient tranServiceClient;
+    @Autowired
+    private InquiryQuoteFacade inquiryQuoteFacade;
 
     /**
      * 问诊记录保存
@@ -376,6 +379,12 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
         inquiryInfo.setPatientSex(inquiryQuoteVO.getPatientInfo().getSex());
         updateById(inquiryInfo);
 
+        //插入引用表信息
+        InquiryQuote inquiryQuote = new InquiryQuote();
+        BeanUtil.copyProperties(inquiryInfo, inquiryQuote);
+        inquiryQuote.setInquiryId(inquiryQuoteVO.getInquiryId());
+        inquiryQuoteFacade.save(inquiryQuote);
+
         return true;
     }
 

+ 13 - 0
prec-service/src/main/java/com/diagbot/facade/InquiryQuoteFacade.java

@@ -0,0 +1,13 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.InquiryQuoteServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2019/11/21 13:29
+ */
+@Component
+public class InquiryQuoteFacade extends InquiryQuoteServiceImpl {
+}

+ 16 - 0
prec-service/src/main/java/com/diagbot/mapper/InquiryQuoteMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.InquiryQuote;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 问诊记录-主表 Mapper 接口
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+public interface InquiryQuoteMapper extends BaseMapper<InquiryQuote> {
+
+}

+ 16 - 0
prec-service/src/main/java/com/diagbot/service/InquiryQuoteService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.InquiryQuote;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+public interface InquiryQuoteService extends IService<InquiryQuote> {
+
+}

+ 20 - 0
prec-service/src/main/java/com/diagbot/service/impl/InquiryQuoteServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.InquiryQuote;
+import com.diagbot.mapper.InquiryQuoteMapper;
+import com.diagbot.service.InquiryQuoteService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 问诊记录-主表 服务实现类
+ * </p>
+ *
+ * @author gaodm
+ * @since 2019-11-21
+ */
+@Service
+public class InquiryQuoteServiceImpl extends ServiceImpl<InquiryQuoteMapper, InquiryQuote> implements InquiryQuoteService {
+
+}

+ 40 - 0
prec-service/src/main/resources/mapper/InquiryQuoteMapper.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.InquiryQuoteMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.InquiryQuote">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="inquiry_id" property="inquiryId" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="hospital_code" property="hospitalCode" />
+        <result column="hospital_name" property="hospitalName" />
+        <result column="son_hospital_id" property="sonHospitalId" />
+        <result column="son_hospital_code" property="sonHospitalCode" />
+        <result column="son_hospital_name" property="sonHospitalName" />
+        <result column="hospital_dept_id" property="hospitalDeptId" />
+        <result column="hospital_dept_code" property="hospitalDeptCode" />
+        <result column="hospital_dept_name" property="hospitalDeptName" />
+        <result column="doctor_id" property="doctorId" />
+        <result column="doctor_code" property="doctorCode" />
+        <result column="doctor_name" property="doctorName" />
+        <result column="patient_id" property="patientId" />
+        <result column="patient_code" property="patientCode" />
+        <result column="patient_name" property="patientName" />
+        <result column="patient_sex" property="patientSex" />
+        <result column="patient_phone" property="patientPhone" />
+        <result column="patient_birthday" property="patientBirthday" />
+        <result column="patient_id_no" property="patientIdNo" />
+        <result column="inquiry_code" property="inquiryCode" />
+        <result column="reg_visited_state" property="regVisitedState" />
+        <result column="type" property="type" />
+        <result column="data_json" property="dataJson" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
prec-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -58,7 +58,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix(new String[] { "prec_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "prec_inquiry_info" }); // 需要生成的表
+        strategy.setInclude(new String[] { "prec_inquiry_quote" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);