微信后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
4.1 KiB

package com.ynxbd.common.bean;
import com.ynxbd.common.bean.enums.HCardTypeEnum;
import com.ynxbd.common.helper.common.ParamHelper;
import com.ynxbd.wx.wxfactory.AesWxHelper;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.ObjectUtils;
import java.io.Serializable;
/**
* @Author wsq
* @Date 2020/9/25 14:09
* @Copyright @ 2020 云南新八达科技有限公司 All rights reserved.
*/
@Setter
@Getter
@ToString
@NoArgsConstructor
public class Patient implements Serializable {
private static final long serialVersionUID = 9966666612123151L;
private Long id;
private String unionId;
private String openid;
private String patientId;
private String name;
private String sex;
private String age;
private String idCardNo;
private String birthday;
private String tel;
private String address;
private String bindDate;
private String hisTransNo;
private String nation;
//
private String fatherName;
private String fatherIdCardNo;
private String fatherTel;
private String motherName;
private String motherIdCardNo;
private String motherTel;
private String uuid;
//
private String healthCardId;
// 证件类型,电子健康卡
private String cardType;
// 区
private String county;
// 支付宝认证令牌
private String accessToken;
//
private String accessCode;
//
private String updateTime;
// 自己
private Boolean isMyself;
// 删除状态
private Integer deletedState;
// 加密后的患者id
private String enPatientId;
// 加密后的证件号码
private String enCardNo;
// 加密后的电话
private String enTel;
// 显示的身份证号码
private String showCardNo;
// 显示的电话号码
private String showTel;
// 地区编码
private String areaCode;
// 地区
private String areaAddress;
// 表内唯一ID
private String uniqueId;
// 医共体主体认证id
private String gmcOpenId;
// 医共体主体患者UUID
private String gmcUniqueId;
// 子公众号的AppId
private String hospAppId;
//
private Integer gmcBindState;
// 认证加密openid
private String enUnionId;
private String enOpenId;
private String enGmcOpenId;
private String enHospAppId;
// BindingFlag:值为1时,说明患者尚未绑定或建档
private String bindingFlag;
private HCardTypeEnum cardTypeEnum;
// HIS绑定
public boolean hasHisBind() {
return "1".equals(this.bindingFlag);
}
// 清除监护人信息
public void clearGuardianData() {
this.fatherName = null;
this.fatherIdCardNo = null;
this.fatherTel = null;
//
this.motherName = null;
this.motherIdCardNo = null;
this.motherTel = null;
}
/**
* 数据过滤
*
* @param isClearCardNoAndTel 是否清除证件号和电话
*/
public void filterData(boolean isClearCardNoAndTel) {
boolean noneCardNo = ObjectUtils.isEmpty(this.idCardNo); // 无证件号
// 患者ID
this.enPatientId = AesWxHelper.encode(this.patientId, true);
// 身份证
this.showCardNo = ParamHelper.hideIdCardNo(this.idCardNo);
this.enCardNo = AesWxHelper.encode(this.idCardNo, true);
// 电话
this.showTel = ParamHelper.hideTel(this.tel);
this.enTel = AesWxHelper.encode(this.tel, true);
if (noneCardNo) { // 无证绑定数据显示过滤
this.fatherIdCardNo = ParamHelper.hideIdCardNo(this.fatherIdCardNo);
this.fatherTel = ParamHelper.hideTel(this.fatherTel);
this.motherIdCardNo = ParamHelper.hideIdCardNo(this.motherIdCardNo);
this.motherTel = ParamHelper.hideTel(this.motherTel);
}
if (isClearCardNoAndTel) {
this.tel = null;
this.idCardNo = null;
}
}
}