Browse Source

同步表和患者表添加“患者编号”字段,对接时以此字段为唯一标识

hnzxyjhyy
zhangye 2 weeks ago
parent
commit
b9c99295c2
  1. 2
      ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml
  2. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java
  3. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java
  4. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java
  5. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java
  6. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java
  7. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java
  8. 15
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java
  9. 63
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml
  10. 91
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml
  11. 25
      ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml
  12. 8
      sql/数据对接.sql

2
ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml

@ -60,7 +60,7 @@
<!-- <table tableName="ums_device" domainObjectName="UmsDevice"/>-->
<!-- <table tableName="ums_data_source" domainObjectName="UmsDataSource"/>-->
<!-- <table tableName="pms_patient" domainObjectName="PmsPatient"/>-->
<table tableName="pms_patient" domainObjectName="PmsPatient"/>
<!-- <table tableName="ld_patient_record" domainObjectName="LdPatientRecord"/>-->
<!-- <table tableName="pms_patient_record" domainObjectName="PmsPatientRecord"/>-->
<!-- <table tableName="pms_patient_acp" domainObjectName="PmsPatientAcp"/>-->

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java

@ -8,6 +8,8 @@ public class DockPatientBaseInfo implements Serializable {
private String name;
private String patientNo;
private String idCard;
private String phone;
@ -76,6 +78,14 @@ public class DockPatientBaseInfo implements Serializable {
this.name = name == null ? null : name.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
public String getIdCard() {
return idCard;
}
@ -284,6 +294,7 @@ public class DockPatientBaseInfo implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", patientNo=").append(patientNo);
sb.append(", idCard=").append(idCard);
sb.append(", phone=").append(phone);
sb.append(", sex=").append(sex);

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java

@ -262,6 +262,76 @@ public class DockPatientBaseInfoExample {
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andIdCardIsNull() {
addCriterion("id_card is null");
return (Criteria) this;

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java

@ -9,6 +9,8 @@ public class DockPatientVisitInfo implements Serializable {
private String idCard;
private String patientNo;
private String visitType;
private String visitNo;
@ -111,6 +113,14 @@ public class DockPatientVisitInfo implements Serializable {
this.idCard = idCard == null ? null : idCard.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
public String getVisitType() {
return visitType;
}
@ -455,6 +465,7 @@ public class DockPatientVisitInfo implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", idCard=").append(idCard);
sb.append(", patientNo=").append(patientNo);
sb.append(", visitType=").append(visitType);
sb.append(", visitNo=").append(visitNo);
sb.append(", age=").append(age);

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java

@ -236,6 +236,76 @@ public class DockPatientVisitInfoExample {
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andVisitTypeIsNull() {
addCriterion("visit_type is null");
return (Criteria) this;

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java

@ -96,6 +96,8 @@ public class PmsPatient implements Serializable {
private String rhBloodType;
private String patientNo;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -466,6 +468,14 @@ public class PmsPatient implements Serializable {
this.rhBloodType = rhBloodType == null ? null : rhBloodType.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -518,6 +528,7 @@ public class PmsPatient implements Serializable {
sb.append(", idCardTypeOther=").append(idCardTypeOther);
sb.append(", aboBloodType=").append(aboBloodType);
sb.append(", rhBloodType=").append(rhBloodType);
sb.append(", patientNo=").append(patientNo);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java

@ -3154,6 +3154,76 @@ public class PmsPatientExample {
addCriterion("rh_blood_type not between", value1, value2, "rhBloodType");
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

15
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java

@ -425,13 +425,13 @@ public class DockServiceImpl implements DockService {
return;
}
for (DockPatientBaseInfo dockPatientBaseInfo : dockPatientBaseInfos) {
if(ObjectUtil.isNull(dockPatientBaseInfo.getIdCard())){
if(ObjectUtil.isNull(dockPatientBaseInfo.getPatientNo())){
continue;
}
//根据患者身份证号查询业务表内患者信息
//根据患者患者唯一编号查询业务表内患者信息
PmsPatient pmsPatient;
PmsPatientExample pmsPatientExample = new PmsPatientExample();
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientBaseInfo.getIdCard()).andDelFlagEqualTo((byte) 0);
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientBaseInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<PmsPatient> pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample);
if (CollUtil.isNotEmpty(pmsPatients)) {
//存在就更新
@ -468,15 +468,15 @@ public class DockServiceImpl implements DockService {
}
private PmsPatientBody savePatientBady(DockPatientVisitInfo dockPatientVisitInfo) {
//根据身份证号查找业务表内患者信息
//根据患者唯一编号查找业务表内患者信息
PmsPatient pmsPatient;
PmsPatientExample pmsPatientExample = new PmsPatientExample();
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientVisitInfo.getIdCard()).andDelFlagEqualTo((byte) 0);
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientVisitInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<PmsPatient> pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample);
if (CollUtil.isEmpty(pmsPatients)) {
//根据身份证号查找同步表的患者信息
//根据患者唯一编号查找同步表的患者信息
DockPatientBaseInfoExample dockPatientBaseInfoExample = new DockPatientBaseInfoExample();
dockPatientBaseInfoExample.createCriteria().andIdCardEqualTo(dockPatientVisitInfo.getIdCard()).andDelFlagEqualTo((byte) 0);
dockPatientBaseInfoExample.createCriteria().andIdCardEqualTo(dockPatientVisitInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<DockPatientBaseInfo> dockPatientBaseInfos = dockPatientBaseInfoMapper.selectByExample(dockPatientBaseInfoExample);
if (CollUtil.isNotEmpty(dockPatientBaseInfos)) {
//存在则更新
@ -658,6 +658,7 @@ public class DockServiceImpl implements DockService {
private void disposePmsPatient(DockPatientBaseInfo dockPatientBaseInfo, PmsPatient pmsPatient) {
pmsPatient.setPatientNo(dockPatientBaseInfo.getPatientNo());
// 姓名相关
pmsPatient.setName(dockPatientBaseInfo.getName());
pmsPatient.setNameFull(PinyinUtil.getPinyin(pmsPatient.getName(), ""));

63
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml

@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientBaseInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
@ -89,10 +90,10 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, id_card, phone, sex, birthday, educational_status, career, marital_status,
nation, native_place, address, dwelling_state, contact_name, contact_mobile, contact_relation,
abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time, update_by,
update_time, del_flag, remark, sync
id, name, patient_no, id_card, phone, sex, birthday, educational_status, career,
marital_status, nation, native_place, address, dwelling_state, contact_name, contact_mobile,
contact_relation, abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time,
update_by, update_time, del_flag, remark, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultMap="BaseResultMap">
select
@ -125,26 +126,26 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info (id, name, id_card,
phone, sex, birthday,
educational_status, career, marital_status,
nation, native_place, address,
dwelling_state, contact_name, contact_mobile,
contact_relation, abo_blood_type, rh_blood_type,
belief, hobby, create_by,
create_time, update_by, update_time,
del_flag, remark, sync
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE},
#{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR}, #{maritalStatus,jdbcType=VARCHAR},
#{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR}, #{rhBloodType,jdbcType=VARCHAR},
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, #{sync,jdbcType=VARCHAR}
)
insert into dock_patient_base_info (id, name, patient_no,
id_card, phone, sex,
birthday, educational_status, career,
marital_status, nation, native_place,
address, dwelling_state, contact_name,
contact_mobile, contact_relation, abo_blood_type,
rh_blood_type, belief, hobby,
create_by, create_time, update_by,
update_time, del_flag, remark,
sync)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{idCard,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR},
#{maritalStatus,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{contactMobile,jdbcType=VARCHAR}, #{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{rhBloodType,jdbcType=VARCHAR}, #{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info
@ -155,6 +156,9 @@
<if test="name != null">
name,
</if>
<if test="patientNo != null">
patient_no,
</if>
<if test="idCard != null">
id_card,
</if>
@ -238,6 +242,9 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
#{idCard,jdbcType=VARCHAR},
</if>
@ -330,6 +337,9 @@
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR},
</if>
@ -414,6 +424,7 @@
update dock_patient_base_info
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
id_card = #{record.idCard,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
@ -449,6 +460,9 @@
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
@ -530,6 +544,7 @@
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
update dock_patient_base_info
set name = #{name,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},

91
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml

@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientVisitInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
<result column="visit_type" jdbcType="VARCHAR" property="visitType" />
<result column="visit_no" jdbcType="VARCHAR" property="visitNo" />
<result column="age" jdbcType="INTEGER" property="age" />
@ -106,13 +107,13 @@
</where>
</sql>
<sql id="Base_Column_List">
id, id_card, visit_type, visit_no, age, department, doctor, admission_date, admission_count,
bed_number, discharge_date, admission_method, discharge_method, height, weight, tz,
temperature, blood_pressure_shrink, blood_pressure_diastole, pulse, creatinine, oxygen_saturation,
albumin, total_protein, vitamin_d3, hematocrit, dimer, smoking_history, smoking_year,
smoking_quit, smoking_quit_year, drink_history, drink_year, drink_quit, drink_quit_year,
has_allergy, allergy_drug, create_by, create_time, update_by, update_time, del_flag,
remark, sync
id, id_card, patient_no, visit_type, visit_no, age, department, doctor, admission_date,
admission_count, bed_number, discharge_date, admission_method, discharge_method,
height, weight, tz, temperature, blood_pressure_shrink, blood_pressure_diastole,
pulse, creatinine, oxygen_saturation, albumin, total_protein, vitamin_d3, hematocrit,
dimer, smoking_history, smoking_year, smoking_quit, smoking_quit_year, drink_history,
drink_year, drink_quit, drink_quit_year, has_allergy, allergy_drug, create_by, create_time,
update_by, update_time, del_flag, remark, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultMap="BaseResultMap">
select
@ -145,36 +146,38 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info (id, id_card, visit_type,
visit_no, age, department,
doctor, admission_date, admission_count,
bed_number, discharge_date, admission_method,
discharge_method, height, weight,
tz, temperature, blood_pressure_shrink,
blood_pressure_diastole, pulse, creatinine,
oxygen_saturation, albumin, total_protein,
vitamin_d3, hematocrit, dimer,
smoking_history, smoking_year, smoking_quit,
smoking_quit_year, drink_history, drink_year,
drink_quit, drink_quit_year, has_allergy,
allergy_drug, create_by, create_time,
update_by, update_time, del_flag,
remark, sync)
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{visitType,jdbcType=VARCHAR},
#{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR},
#{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP}, #{admissionCount,jdbcType=INTEGER},
#{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP}, #{admissionMethod,jdbcType=VARCHAR},
#{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL}, #{weight,jdbcType=DECIMAL},
#{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL}, #{bloodPressureShrink,jdbcType=INTEGER},
#{bloodPressureDiastole,jdbcType=INTEGER}, #{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL},
#{oxygenSaturation,jdbcType=DECIMAL}, #{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL},
#{vitaminD3,jdbcType=DECIMAL}, #{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL},
#{smokingHistory,jdbcType=TINYINT}, #{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER},
#{drinkQuit,jdbcType=TINYINT}, #{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT},
#{allergyDrug,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{sync,jdbcType=VARCHAR})
insert into dock_patient_visit_info (id, id_card, patient_no,
visit_type, visit_no, age,
department, doctor, admission_date,
admission_count, bed_number, discharge_date,
admission_method, discharge_method, height,
weight, tz, temperature,
blood_pressure_shrink, blood_pressure_diastole,
pulse, creatinine, oxygen_saturation,
albumin, total_protein, vitamin_d3,
hematocrit, dimer, smoking_history,
smoking_year, smoking_quit, smoking_quit_year,
drink_history, drink_year, drink_quit,
drink_quit_year, has_allergy, allergy_drug,
create_by, create_time, update_by,
update_time, del_flag, remark,
sync)
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{visitType,jdbcType=VARCHAR}, #{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},
#{department,jdbcType=VARCHAR}, #{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP},
#{admissionCount,jdbcType=INTEGER}, #{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP},
#{admissionMethod,jdbcType=VARCHAR}, #{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL},
#{weight,jdbcType=DECIMAL}, #{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL},
#{bloodPressureShrink,jdbcType=INTEGER}, #{bloodPressureDiastole,jdbcType=INTEGER},
#{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL}, #{oxygenSaturation,jdbcType=DECIMAL},
#{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL}, #{vitaminD3,jdbcType=DECIMAL},
#{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL}, #{smokingHistory,jdbcType=TINYINT},
#{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT}, #{smokingQuitYear,jdbcType=INTEGER},
#{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER}, #{drinkQuit,jdbcType=TINYINT},
#{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT}, #{allergyDrug,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info
@ -185,6 +188,9 @@
<if test="idCard != null">
id_card,
</if>
<if test="patientNo != null">
patient_no,
</if>
<if test="visitType != null">
visit_type,
</if>
@ -319,6 +325,9 @@
<if test="idCard != null">
#{idCard,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null">
#{visitType,jdbcType=VARCHAR},
</if>
@ -462,6 +471,9 @@
<if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.visitType != null">
visit_type = #{record.visitType,jdbcType=VARCHAR},
</if>
@ -597,6 +609,7 @@
update dock_patient_visit_info
set id = #{record.id,jdbcType=BIGINT},
id_card = #{record.idCard,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
visit_type = #{record.visitType,jdbcType=VARCHAR},
visit_no = #{record.visitNo,jdbcType=VARCHAR},
age = #{record.age,jdbcType=INTEGER},
@ -649,6 +662,9 @@
<if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null">
visit_type = #{visitType,jdbcType=VARCHAR},
</if>
@ -781,6 +797,7 @@
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
update dock_patient_visit_info
set id_card = #{idCard,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
visit_type = #{visitType,jdbcType=VARCHAR},
visit_no = #{visitNo,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER},

25
ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml

@ -48,6 +48,7 @@
<result column="id_card_type_other" jdbcType="VARCHAR" property="idCardTypeOther" />
<result column="abo_blood_type" jdbcType="VARCHAR" property="aboBloodType" />
<result column="rh_blood_type" jdbcType="VARCHAR" property="rhBloodType" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -114,7 +115,7 @@
city, address, domicile, independent_living_skills, dwelling_state, recorder, remark,
create_by, create_time, update_by, update_time, del_flag, birth_year, birthday, belief,
hobby, contact_name, contact_relation, contact_mobile, contact_other, id_card_type,
id_card_type_other, abo_blood_type, rh_blood_type
id_card_type_other, abo_blood_type, rh_blood_type, patient_no
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultMap="BaseResultMap">
select
@ -162,7 +163,7 @@
belief, hobby, contact_name,
contact_relation, contact_mobile, contact_other,
id_card_type, id_card_type_other, abo_blood_type,
rh_blood_type)
rh_blood_type, patient_no)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{nameInitial,jdbcType=VARCHAR}, #{nameFull,jdbcType=VARCHAR},
#{patientNumber,jdbcType=VARCHAR}, #{hospitalNumber,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},
@ -178,7 +179,7 @@
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{contactOther,jdbcType=VARCHAR},
#{idCardType,jdbcType=VARCHAR}, #{idCardTypeOther,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{rhBloodType,jdbcType=VARCHAR})
#{rhBloodType,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.PmsPatient">
insert into pms_patient
@ -321,6 +322,9 @@
<if test="rhBloodType != null">
rh_blood_type,
</if>
<if test="patientNo != null">
patient_no,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -461,6 +465,9 @@
<if test="rhBloodType != null">
#{rhBloodType,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultType="java.lang.Long">
@ -610,6 +617,9 @@
<if test="record.rhBloodType != null">
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -662,7 +672,8 @@
id_card_type = #{record.idCardType,jdbcType=VARCHAR},
id_card_type_other = #{record.idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{record.aboBloodType,jdbcType=VARCHAR},
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR}
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -805,6 +816,9 @@
<if test="rhBloodType != null">
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -854,7 +868,8 @@
id_card_type = #{idCardType,jdbcType=VARCHAR},
id_card_type_other = #{idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{aboBloodType,jdbcType=VARCHAR},
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR}
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

8
sql/数据对接.sql

@ -42,6 +42,7 @@ DROP TABLE IF EXISTS `dock_patient_base_info`;
CREATE TABLE `dock_patient_base_info` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
`patient_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '患者唯一编号',
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号码(身份证号)',
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系电话',
`sex` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别:0女、1男',
@ -126,7 +127,8 @@ CREATE TABLE `dock_patient_medication_info` (
DROP TABLE IF EXISTS `dock_patient_visit_info`;
CREATE TABLE `dock_patient_visit_info` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号码,使用身份证号与基础信息关联',
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号码',
`patient_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '患者唯一编号',
`visit_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '就诊类型',
`visit_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门诊/住院号',
`age` int NULL DEFAULT NULL COMMENT '年龄',
@ -174,6 +176,10 @@ CREATE TABLE `dock_patient_visit_info` (
INDEX `idx_id_card`(`id_card` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '患者就诊信息表' ROW_FORMAT = Dynamic;
-- 患者表添加字段
ALTER TABLE `pms_patient`
ADD COLUMN `patient_no` varchar(50) COMMENT '患者院内唯一编号';
-- 主库从库都需要修改部门和用户表,加字段
ALTER TABLE `ums_user`
ADD COLUMN `empl_code` varchar(30) DEFAULT '' COMMENT '工号' AFTER `nick_name`;

Loading…
Cancel
Save