1、和HIS对接委托人相关的接口,并对敏感数据进行加密,新增入参可返回记录id的数据,加入身份证号和手机号等各参数的验证机制。

2、部分和就诊记录相关的住院接口进行数据加密。
3、用户绑定身份证错误时提示不正确调整。
debug
wangsq 1 week ago
parent 42c6318dc1
commit c935b675fb
  1. 107
      src/main/java/com/ynxbd/common/action/AuthAgentAction.java
  2. 24
      src/main/java/com/ynxbd/common/action/HealthCodeAction.java
  3. 22
      src/main/java/com/ynxbd/common/action/InHospAction.java
  4. 15
      src/main/java/com/ynxbd/common/action/TreatAction.java
  5. 39
      src/main/java/com/ynxbd/common/bean/enums/HisAuthAgentRelationEnum.java
  6. 44
      src/main/java/com/ynxbd/common/bean/his/HisAuthAgent.java
  7. 5
      src/main/java/com/ynxbd/common/bean/his/HisTreat.java
  8. 3
      src/main/java/com/ynxbd/common/bean/in_hosp/InHosp.java
  9. 2
      src/main/java/com/ynxbd/common/bean/in_hosp/InHospitalList.java
  10. 5
      src/main/java/com/ynxbd/common/bean/pay/Order.java
  11. 164
      src/main/java/com/ynxbd/common/dao/his/HisAuthAgentDao.java
  12. 23
      src/main/java/com/ynxbd/common/dao/his/HisPatientDao.java
  13. 4
      src/main/java/com/ynxbd/common/helper/common/ParamHelper.java
  14. 6
      src/main/java/com/ynxbd/common/helper/his/HisEnum.java
  15. 3
      src/main/java/com/ynxbd/common/helper/his/HisHelper.java
  16. 14
      src/main/java/com/ynxbd/common/service/PatientService.java
  17. 2
      src/main/java/com/ynxbd/wx/wxfactory/ReqParamHelper.java
  18. 4
      src/main/java/com/ynxbd/wx/wxfactory/WxMedicalHelper.java
  19. 2
      src/main/resources/webservice.properties

@ -0,0 +1,107 @@
package com.ynxbd.common.action;
import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.his.HisAuthAgent;
import com.ynxbd.common.dao.his.HisAuthAgentDao;
import com.ynxbd.common.helper.common.ParamHelper;
import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.wx.wxfactory.ReqParamHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import java.util.List;
import java.util.stream.Collectors;
// 授权委托人
@Slf4j
@Namespace("/authAgent")
public class AuthAgentAction extends BaseAction {
@Action("getAuthAgent")
public Result getAuthAgent(String treatNum, Integer treatType, String itemNo) {
try {
treatNum = getDecodeString(treatNum);
log.info("[委托人信息]查询 treatNum={}, treatType={}", treatNum, treatType);
if (!ObjectUtils.isEmpty(itemNo)) {
itemNo = getDecodeString(itemNo);
if (itemNo == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
}
List<HisAuthAgent> dataList = new HisAuthAgentDao().queryAuthAgent(treatNum, treatType);
boolean hasItemNo = !ObjectUtils.isEmpty(itemNo);
if (hasItemNo) {
String finalItemNo = itemNo;
dataList = dataList.stream().filter(o -> finalItemNo.equals(o.getItemNo())).collect(Collectors.toList());
}
for (HisAuthAgent item : dataList) {
item.setEnItemNo(ReqParamHelper.encode(item.getItemNo()));
item.setEnPersonId(ReqParamHelper.encode(item.getPersonId()));
item.setEnPersonTel(ReqParamHelper.encode(item.getPersonTel()));
item.setShowPersonId(ParamHelper.hideIdCardNo(item.getPersonId()));
item.setShowPersonTel(ParamHelper.hidTel(item.getPersonTel()));
item.setPersonId(null);
item.setPersonTel(null);
}
return Result.success(dataList);
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
@Action("addAuthAgent")
public Result addAuthAgent(String openid, String treatNum, Integer treatType, String personName, String personSex, String personTel, String personId, String relationship, Integer personAge, String personAddress) {
try {
treatNum = getDecodeString(treatNum);
log.info("[委托人信息]添加 treatNum={}, treatType={}, personName={}, personSex={}, relationship={}", treatNum, treatType, personName, personSex, relationship);
new HisAuthAgentDao().addAuthAgent(treatNum, treatType, personName, personSex, personTel, personId, relationship, personAge, personAddress);
return Result.success();
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
@Action("updateAuthAgent")
public Result updateAuthAgent(String openid, String itemNo, String personName, String personSex, String personTel, String personId, String relationship, String personAge, String personAddress, String enPersonTel, String enPersonId) {
try {
if (personId == null || personTel == null || enPersonTel == null || enPersonId == null) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
itemNo = getDecodeString(itemNo);
log.info("[委托人信息]添加 itemNo={},personName={}, personSex={}, relationship={}, enPersonTel={}, enPersonId={}", itemNo, personName, personSex, relationship, enPersonTel, enPersonId);
if (personId.contains("*")) { // 数据没有变化
personId = getDecodeString(enPersonId);
}
if (personTel.contains("*")) {
personTel = getDecodeString(enPersonTel);
}
if (ObjectUtils.isEmpty(personId) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(itemNo)) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}
new HisAuthAgentDao().updateAuthAgent(itemNo, personName, personSex, personTel, personId, relationship, personAge, personAddress);
return Result.success();
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
@Action("delAuthAgent")
public Result delAuthAgent(String itemNo, String openid) {
try {
itemNo = getDecodeString(itemNo);
log.info("[委托人信息]修改 itemNo={}", itemNo);
new HisAuthAgentDao().delAuthAgent(itemNo);
return Result.success();
} catch (Exception e) {
return Result.error(e.getMessage());
}
}
}

@ -9,6 +9,7 @@ import com.ynxbd.common.bean.enums.HCardTypeEnum;
import com.ynxbd.common.bean.enums.HealthCardEnum;
import com.ynxbd.common.bean.enums.HealthCardRespCodeEnum;
import com.ynxbd.common.dao.PatientDao;
import com.ynxbd.common.dao.his.HisPatientDao;
import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.helper.common.IDNumberHelper;
import com.ynxbd.common.helper.common.ValidHelper;
@ -77,7 +78,7 @@ public class HealthCodeAction extends BaseAction {
@Action("appBindHealthCard")
public Result appBindHealthCard(String openid,String healthCode){
public Result appBindHealthCard(String openid, String healthCode) {
log.info("[新版电子健康卡]H5嵌入链接绑卡-通过healthCode获取健康卡数据 healthCode={}, openid={}", healthCode, openid);
if (healthCode == null || openid == null) return Result.error(ResultEnum.PARAM_IS_DEFECT); // 参数为空
@ -144,6 +145,18 @@ public class HealthCodeAction extends BaseAction {
}
/**
* 获取卡包订单ID
*/
@Action("getArea")
public Result getArea(Integer level, String areaCode) {
try {
return Result.success(new HisPatientDao().getArea(level, areaCode));
} catch (Exception e) {
return Result.error(e);
}
}
/**
* 健康卡[上报数据]
*
@ -182,8 +195,8 @@ public class HealthCodeAction extends BaseAction {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
if(isFace){
if(!HCodeService.checkUniformVerifyResult(orderId, registerOrderId)){
if (isFace) { // 实名认证
if (!HCodeService.checkUniformVerifyResult(orderId, registerOrderId)) {
return Result.error(ResultEnum.FACE_VERIFY_ERROR);
}
}
@ -201,13 +214,13 @@ public class HealthCodeAction extends BaseAction {
if (!ValidHelper.isValidIdCard(idCardNo)) {
log.info("[电子健康卡]身份证错误 name={}, tel={}, idCardNo={}", name, tel, idCardNo);
return Result.error(ResultEnum.PARAM_IS_INVALID);
return Result.error(ResultEnum.ID_CARD_ERROR);
}
if (!ValidHelper.isValidNation(nation)) {
return Result.error(ResultEnum.NATION_ERROR);
}
if(nation.equals("未知")) {
if (nation.equals("未知")) {
nation = "";
}
@ -392,7 +405,6 @@ public class HealthCodeAction extends BaseAction {
}
@Action("batchUpdate")
public void batchUpdate() {
Timer timer = new Timer();

@ -7,6 +7,7 @@ import com.ynxbd.common.helper.common.DateHelper;
import com.ynxbd.common.result.JsonResult;
import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.wx.wxfactory.ReqParamHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
@ -37,11 +38,11 @@ public class InHospAction extends BaseAction {
*/
@Action("getPreMoneyList")
public Result getPreMoneyList(String begDate, String endDate, String patientId) {
patientId = getDecodeString(patientId);
log.info("[住院]预交金缴费记录查询, patientId={}", patientId);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
patientId = getDecodeString(patientId);
JsonResult resp = new HisInHospDao().getPreMoneyList(patientId);
@ -74,6 +75,7 @@ public class InHospAction extends BaseAction {
@Action("getInHospSumFee")
public Result getInHospSumFee(String date, String patientId) {
log.info("[住院]查询住院日费用汇总 patientId={}, date={}", patientId, date);
patientId = getDecodeString(patientId);
if (patientId == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -107,6 +109,7 @@ public class InHospAction extends BaseAction {
@Action("getInHospFee")
public Result getInHospFee(String date, String patientId) {
log.info("[住院]查询住院费用清单 patientId={}, date={}", patientId, date);
patientId = getDecodeString(patientId);
if (patientId == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -146,6 +149,7 @@ public class InHospAction extends BaseAction {
*/
@Action("getInHospByTreatNum")
public Result getInHospByTreatNum(String treatNum) {
treatNum = getDecodeString(treatNum);
log.info("[住院]通过住院号查询患者信息(含预交金) treatNum={}", treatNum);
if (treatNum == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
@ -159,7 +163,6 @@ public class InHospAction extends BaseAction {
InHosp inHosp = resp.dataMapToBean(InHosp.class);
treatNum = resp.getDataMapString("InPatientNum");
inHosp.setTreatNum(treatNum);
return Result.success(inHosp);
}
@ -174,6 +177,7 @@ public class InHospAction extends BaseAction {
*/
@Action("getInHospByPatientId")
public Result getInHospByPatientId(String patientId, String begDate, String endDate, String inHospState) {
patientId = getDecodeString(patientId);
log.info("[住院]通过患者ID查询在院患者信息 patientId={}, endDate={}, endDate={}", patientId, begDate, endDate);
if (patientId == null || begDate == null || endDate == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
@ -191,9 +195,11 @@ public class InHospAction extends BaseAction {
List<InHosp> records = resp.getDataMapList(InHosp.class, "InPatientInfo", "Items", "Item");
List<InHosp> resultList = new ArrayList<>();
boolean hasHosp = "1".equals(inHospState);
String inDate;
for (InHosp item : records) {
if ("1".equals(inHospState)) { // 只查询在院记录
if (hasHosp) { // 只查询在院记录
if (item.getOutDate() != null) { // 已出院
continue;
}
@ -203,6 +209,7 @@ public class InHospAction extends BaseAction {
inDate = DateHelper.dateFormatShort(inDate);
if (inDate != null && DateHelper.inDateRange(begDate, endDate, inDate, DateHelper.DateEnum.yyyy_MM_dd)) {
item.setTreatNum(item.getInPatientNum());
item.setEnTreatNum(ReqParamHelper.encode(item.getTreatNum()));
resultList.add(item);
}
}
@ -219,9 +226,8 @@ public class InHospAction extends BaseAction {
*/
@Action("getHospListByPatientId")
public Result getHospListByPatientId(String patientId) {
// [住院]通过患者ID查询患者所有住院记录
log.info("[住院]通过患者ID查询住院记录 patientId-{}", patientId);
patientId = getDecodeString(patientId);
log.info("[住院]通过患者ID查询住院记录 patientId-{}", patientId);
if (patientId == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
@ -230,6 +236,9 @@ public class InHospAction extends BaseAction {
return Result.error(resp.getMessage());
}
List<InHospitalList> dataList = resp.getDataMapList(InHospitalList.class, "Items", "Item");
for (InHospitalList item : dataList) {
item.setEnTreatNum(ReqParamHelper.encode(item.getZyNum()));
}
return Result.success(dataList);
}
@ -241,7 +250,8 @@ public class InHospAction extends BaseAction {
*/
@Action("getAllFeeByTreat")
public Result getAllFeeByTreat(String treatNum) {
log.info("[住院]通过住院号查询所有费用明细, treatNum-{}", treatNum);
treatNum = getDecodeString(treatNum);
log.info("[住院]通过住院号查询所有费用明细 treatNum-{}", treatNum);
if (treatNum == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}

@ -2,7 +2,6 @@ package com.ynxbd.common.action;
import com.ynxbd.common.action.base.BaseAction;
import com.ynxbd.common.bean.his.HisReRegister;
import com.ynxbd.common.bean.his.HisTreat;
import com.ynxbd.common.dao.his.HisTreatDao;
import com.ynxbd.common.helper.common.AesHelper;
@ -18,18 +17,26 @@ import org.apache.struts2.convention.annotation.Namespace;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Namespace("/treat")
public class TreatAction extends BaseAction {
@Action("getTreatList")
public Result getTreatList(String patientId, String deptCode) {
log.info("[就诊记录]查询 patientId={}, deptCode={}", patientId, deptCode);
public Result getTreatList(String patientId, String deptCode, Boolean isSCD) {
patientId = getDecodeString(patientId);
log.info("[就诊记录]查询 patientId={}, deptCode={}, isSCD={}", patientId, deptCode, isSCD);
if (patientId == null || deptCode == null) {
return Result.error(ResultEnum.PARAM_IS_DEFECT);
}
List<HisTreat> treatList = new HisTreatDao().getTreatList(patientId, deptCode);
if (isSCD == null) {
isSCD = false;
}
if (isSCD) {
treatList = treatList.stream().filter(HisTreat::hasMTBFlag).collect(Collectors.toList());
}
return Result.success(treatList);
}
@ -100,6 +107,7 @@ public class TreatAction extends BaseAction {
@Action("getInfoByTreatNum")
public Result getInfoByTreatNum(String treatNum) {
try {
treatNum = getDecodeString(treatNum);
if (treatNum == null) {
return Result.error(ResultEnum.PARAM_IS_BLANK);
}
@ -118,6 +126,7 @@ public class TreatAction extends BaseAction {
@Action("getDoctCaSign")
public Result getDoctCaSign(String doctCode) {
try {
doctCode = getDecodeString(doctCode);
if (ObjectUtils.isEmpty(doctCode)) {
return Result.error(ResultEnum.PARAM_IS_INVALID);
}

@ -0,0 +1,39 @@
package com.ynxbd.common.bean.enums;
import lombok.ToString;
@ToString
public enum HisAuthAgentRelationEnum {
_01(1, "配偶"),
_02(2, "父母"),
_03(3, "子女"),
_04(4, "兄弟"),
_05(5, "姐妹"),
_06(6, "祖父母"),
_07(7, "外祖父母"),
_08(8, "孙子女"),
_09(9, "外孙子女"),
;
public final Integer CODE;
public final String NAME;
HisAuthAgentRelationEnum(Integer CODE, String NAME) {
this.CODE = CODE;
this.NAME = NAME;
}
public static HisAuthAgentRelationEnum findEnumByName(String name) {
if (name == null) {
return null;
}
for (HisAuthAgentRelationEnum item : HisAuthAgentRelationEnum.values()) {
if(item.NAME.equals(name)) {
return item;
}
}
return null;
}
}

@ -0,0 +1,44 @@
package com.ynxbd.common.bean.his;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Getter
@Setter
@ToString
@NoArgsConstructor
public class HisAuthAgent {
// 记录ID
private String itemNo;
// 加密的记录id
private String enItemNo;
// 委托人姓名
private String personName;
// 委托人性别
private String personSex;
// 联系电话
private String personTel;
// 加密联系电话
private String enPersonTel;
// 显示的电话号码
private String showPersonTel;
// 身份证号
private String personId;
// 加密的证件号
private String enPersonId;
// 显示的证件号
private String showPersonId;
// 年龄
private String personAge;
// 住址
private String personAddress;
// 关系
private String relationship;
// 记录创建时间
private String createDate;
}

@ -35,5 +35,10 @@ public class HisTreat {
private String processDoctorName;
// 接诊日期
private String processDate;
// 慢特病标识 1是;0否
private Integer mtbFlag;
public Boolean hasMTBFlag() {
return mtbFlag != null && mtbFlag == 1;
}
}

@ -60,8 +60,9 @@ public class InHosp {
private String prepayWay;
// 收款金额
private BigDecimal prepayMoney;
//
// 住院号
private String treatNum;
private String enTreatNum;
// 备注
private String note;

@ -18,6 +18,8 @@ import lombok.ToString;
@NoArgsConstructor
public class InHospitalList {
private String zyNum;
private String enTreatNum;
private String patientName;
private String sex;
private String age;

@ -10,7 +10,6 @@ import org.apache.commons.lang3.ObjectUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
@ -159,14 +158,14 @@ public class Order implements Serializable {
if (!ObjectUtils.isEmpty(_cardNo)) {
this.idCardNo = null;
this.enCardNo = ReqParamHelper.encode(_cardNo);
this.showCardNo = ParamHelper.idCardNoFilter(_cardNo);
this.showCardNo = ParamHelper.hideIdCardNo(_cardNo);
}
String _tel = this.tel;
if (!ObjectUtils.isEmpty(_tel)) {
this.tel = null;
this.enTel = ReqParamHelper.encode(_tel);
this.showTel = ParamHelper.telFilter(_tel);
this.showTel = ParamHelper.hidTel(_tel);
}
if (!ObjectUtils.isEmpty(this.patientId)) {

@ -0,0 +1,164 @@
package com.ynxbd.common.dao.his;
import cn.hutool.core.util.IdcardUtil;
import cn.hutool.core.util.PhoneUtil;
import com.ynxbd.common.bean.enums.HisAuthAgentRelationEnum;
import com.ynxbd.common.bean.his.HisAuthAgent;
import com.ynxbd.common.helper.his.HisEnum;
import com.ynxbd.common.helper.his.HisHelper;
import com.ynxbd.common.result.JsonResult;
import com.ynxbd.common.result.Result;
import com.ynxbd.common.result.ResultEnum;
import com.ynxbd.common.result.ServiceException;
import org.apache.commons.lang3.ObjectUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
// 授权委托人
public class HisAuthAgentDao {
/**
* 委托人信息查询
*
* @param treatNum 门诊号
* @param treatType 1:门诊2:住院
* @return list
*/
public List<HisAuthAgent> queryAuthAgent(String treatNum, Integer treatType) throws ServiceException {
if (ObjectUtils.isEmpty(treatNum)) {
throw new ServiceException("就诊号参数为空");
}
if (treatType == null) {
treatType = 2;
}
Map<String, Object> params = new HashMap<>();
if (treatType == 1) {
params.put("MZNum", treatNum);
} else if (treatType == 2) {
params.put("ZYNum", treatNum);
} else {
throw new ServiceException("就诊类型异常");
}
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.QUERY_AUTH_AGENT, params);
if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
}
return jsonResult.getDataMapList(HisAuthAgent.class, "Items", "Item");
}
/**
* 委托人信息查询
*
* @param treatNum 门诊号
* @param treatType 1:门诊2:住院
*/
public void addAuthAgent(String treatNum, Integer treatType, String personName, String personSex, String personTel, String personId, String relationship, Integer personAge, String personAddress) throws ServiceException {
if (ObjectUtils.isEmpty(treatNum)) {
throw new ServiceException("就诊号参数为空");
}
if (ObjectUtils.isEmpty(personName) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(personId)) {
throw new ServiceException("委托人信息为空");
}
if (!PhoneUtil.isPhone(personTel)) {
throw new ServiceException(ResultEnum.TEL_ERROR);
}
if (!IdcardUtil.isValidCard(personId)) {
throw new ServiceException(ResultEnum.ID_CARD_ERROR);
}
if (treatType == null) {
treatType = 2;
}
HisAuthAgentRelationEnum relationEnum = HisAuthAgentRelationEnum.findEnumByName(relationship);
if (relationEnum == null) {
throw new ServiceException("关系匹配失败");
}
Map<String, Object> params = new HashMap<>();
if (treatType == 1) {
params.put("MZNum", treatNum);
} else if (treatType == 2) {
params.put("ZYNum", treatNum);
} else {
throw new ServiceException("就诊类型异常");
}
params.put("PersonName", personName);
params.put("PersonSex", personSex);
params.put("PersonTel", personTel);
params.put("PersonID", personId);
params.put("PersonAge", personAge);
params.put("PersonAddress", personAddress);
params.put("Relationship", relationEnum.NAME);
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.ADD_AUTH_AGENT, params);
if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
}
}
/**
* 委托人信息查询
*
* @param itemNo 记录id
*/
public void updateAuthAgent(String itemNo, String personName, String personSex, String personTel, String personId, String relationship, String personAge, String personAddress) throws ServiceException {
if (ObjectUtils.isEmpty(itemNo)) {
throw new ServiceException("记录id为空");
}
if (ObjectUtils.isEmpty(personName) || ObjectUtils.isEmpty(personTel) || ObjectUtils.isEmpty(personId)) {
throw new ServiceException("委托人信息为空");
}
if (!PhoneUtil.isPhone(personTel)) {
throw new ServiceException(ResultEnum.TEL_ERROR);
}
if (!IdcardUtil.isValidCard(personId)) {
throw new ServiceException(ResultEnum.ID_CARD_ERROR);
}
HisAuthAgentRelationEnum relationEnum = HisAuthAgentRelationEnum.findEnumByName(relationship);
if (relationEnum == null) {
throw new ServiceException("关系匹配失败");
}
Map<String, Object> params = new HashMap<>();
params.put("ItemNo", itemNo);
params.put("PersonName", personName);
params.put("PersonSex", personSex);
params.put("PersonTel", personTel);
params.put("PersonID", personId);
params.put("PersonAge", personAge);
params.put("PersonAddress", personAddress);
params.put("Relationship", relationEnum.NAME);
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.UPDATE_AUTH_AGENT, params);
if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
}
}
/**
* 委托人信息查询
*
* @param itemNo 记录id
*/
public void delAuthAgent(String itemNo) throws ServiceException {
if (ObjectUtils.isEmpty(itemNo)) {
throw new ServiceException("记录id为空");
}
Map<String, Object> params = new HashMap<>();
params.put("ItemNo", itemNo);
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.DELETE_AUTH_AGENT, params);
if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
}
}
}

@ -1,5 +1,6 @@
package com.ynxbd.common.dao.his;
import com.alibaba.fastjson.JSONArray;
import com.ynxbd.common.bean.Patient;
import com.ynxbd.common.bean.enums.HCardTypeEnum;
import com.ynxbd.common.helper.his.HisEnum;
@ -156,14 +157,30 @@ public class HisPatientDao {
// 不传入,则his中的患者信息不会被修改
params.put("Address_Code", county); // 行政区编码
params.put("Address", address); // 行政区编码
params.put("Address", address); // 地址
//
params.put("Tel", tel); // 行政区编码
params.put("Nation", nation); // 行政区编码
params.put("Tel", tel);
params.put("Nation", nation);
return HisHelper.getJsonResult(HisEnum.AP_Query_Patient, params);
}
public JSONArray getArea(Integer level, String areaCode) throws ServiceException {
if (level == null || ObjectUtils.isEmpty(areaCode)) {
throw new ServiceException(ResultEnum.PARAM_IS_DEFECT);
}
Map<String, Object> params = new HashMap<>();
params.put("Level", level);
params.put("AreaCode", areaCode);
JsonResult jsonResult = HisHelper.getJsonResult(HisEnum.Query_Area, params);
if (!jsonResult.success()) {
throw new ServiceException(jsonResult.getMessage());
}
return jsonResult.getJsonArray("Items", "Item");
}
//
// public static void main(String[] args) {
// String xml = "<?xml version=\"1.0\" encoding=\"GB2312\"?><Response><TransactionCode>1002</TransactionCode><ResponseCode>-1</ResponseCode><ResponseMessage>该卡已注册,不能再次注册!</ResponseMessage><PatientID>11149300</PatientID></Response>";

@ -146,7 +146,7 @@ public class ParamHelper {
* @param idCardNo 身份证
* @return idCardNo
*/
public static String idCardNoFilter(String idCardNo) {
public static String hideIdCardNo(String idCardNo) {
if (ObjectUtils.isEmpty(idCardNo)) {
return null;
}
@ -168,7 +168,7 @@ public class ParamHelper {
}
public static String telFilter(String tel) {
public static String hidTel(String tel) {
if (ObjectUtils.isEmpty(tel)) {
return null;
}

@ -52,6 +52,7 @@ public enum HisEnum {
//排班记录
AP_Doctor_Schedule("[排班]医生排班表","8003","UniversalInterface",true),
Query_Area("[地区]查询行政区划","8005","UniversalInterface",false),
// 支付[自定义]------------------
Create_Self_Help("[处方]生成自助申请单", "10001", "UniversalInterface", true),
@ -113,6 +114,11 @@ public enum HisEnum {
SH_SELF_HELP_CREATE("[创建自助开单申请单]","10004","UniversalInterface",true),
QUERY_ELECTRON_INVOICE("[查询电子发票信息]","8004","UniversalInterface",false),
QUERY_AUTH_AGENT("委托人信息[查询]","11003","UniversalInterface", true),
ADD_AUTH_AGENT("委托人信息[新增]","11004","UniversalInterface",true),
UPDATE_AUTH_AGENT("委托人信息[修改]","11005","UniversalInterface",true),
DELETE_AUTH_AGENT("委托人信息[删除]","11006","UniversalInterface",true),
;
public final String NAME;

@ -249,10 +249,11 @@ public class HisHelper {
} else {
if (IS_LOG_RESP) { // 配置文件强制要求打印xml
if (!HisEnum.AP_Query_Statement.equals(hisEnum))
if (!HisEnum.AP_Query_Statement.equals(hisEnum) && !HisEnum.Query_Area.equals(hisEnum)) {
log.info("[强制打印]HIS请求成功[{}]-耗时:[{}]-返回xml={}", transactionCode, takeTime, result);
}
}
}
new MiddleOfficeService().req_his_JH0104(soapUrl, HIS_SOAP_MD_URL, params, transactionCode, result);

@ -70,16 +70,16 @@ public class PatientService {
item.setEnCardNo(ReqParamHelper.encode(item.getIdCardNo()));
item.setEnTel(ReqParamHelper.encode(item.getTel()));
// 显示数据----------------------
item.setShowCardNo(ParamHelper.idCardNoFilter(item.getIdCardNo()));
item.setShowTel(ParamHelper.telFilter(item.getTel()));
item.setShowCardNo(ParamHelper.hideIdCardNo(item.getIdCardNo()));
item.setShowTel(ParamHelper.hidTel(item.getTel()));
} else {
// 无证绑定显示数据
item.setFatherIdCardNo(ParamHelper.idCardNoFilter(item.getFatherIdCardNo()));
item.setMotherIdCardNo(ParamHelper.idCardNoFilter(item.getMotherIdCardNo()));
item.setFatherIdCardNo(ParamHelper.hideIdCardNo(item.getFatherIdCardNo()));
item.setMotherIdCardNo(ParamHelper.hideIdCardNo(item.getMotherIdCardNo()));
// ------------
item.setFatherTel(ParamHelper.telFilter(item.getFatherTel()));
item.setMotherTel(ParamHelper.telFilter(item.getMotherTel()));
item.setFatherTel(ParamHelper.hidTel(item.getFatherTel()));
item.setMotherTel(ParamHelper.hidTel(item.getMotherTel()));
}
}
}
@ -217,7 +217,7 @@ public class PatientService {
public Result removePatient(String openid, String patientId, String idCardNo) {
boolean isRemove = new PatientDao().removePatient(openid, patientId);
log.info("[患者解绑]{} patientId={}, idCardNo={}", (isRemove ? "成功" : "失败"), patientId, ParamHelper.idCardNoFilter(idCardNo));
log.info("[患者解绑]{} patientId={}, idCardNo={}", (isRemove ? "成功" : "失败"), patientId, ParamHelper.hideIdCardNo(idCardNo));
if (!isRemove) {
return Result.error();
}

@ -22,7 +22,7 @@ public class ReqParamHelper {
public static void main(String[] args) {
// System.out.println(encode("397631"));
System.out.println(encode("11608089"));
System.out.println(encode("847149"));
// System.out.println(encode("533103198603294034"));
// System.out.println(decode("EF6115C81C9EA8FF79E21180FEC20294"));
}

@ -50,8 +50,8 @@ public class WxMedicalHelper {
userName = ParamHelper.nameFilter(userName);
realName = ParamHelper.nameFilter(realName);
if (userName.length() < 3 && realName.length() < 3) {
userName += ParamHelper.idCardNoFilter(meCardNo);
realName += ParamHelper.idCardNoFilter(cardNo);
userName += ParamHelper.hideIdCardNo(meCardNo);
realName += ParamHelper.hideIdCardNo(cardNo);
}
tip = String.format("医保卡绑定人是:【%s】,当前支付的订单属于患者:【%s】,该订单不属于医保卡本人,禁止支付", userName, realName);
}

@ -1 +1 @@
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09 his.is_recipe_prepay=false lis.url=192.168.1.185:8090 lis.unifiedEntrance=true # \u672C\u5730 #his.url=127.0.0.1:8888 # \u6D4B\u8BD5\u73AF\u5883 ali_code=675448357 # \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E his.is_log_resp=true # \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F his.is_push_msg=false #------------------------------------------------------------- #\u672C\u5730 his.md_url=127.0.0.1:7777 his.dev_url=127.0.0.1:7777 ## \u5FB7\u5B8F\u4E2D\u533B #his.url=200.200.200.60:8888 # \u7EA2\u6CB3\u5DDE\u533B\u9662 his.url=10.20.10.6:8888 # \u5B81\u8497\u5987\u5E7C #his.url=172.19.3.15:8888 # \u516C\u53F8\u6D4B\u8BD5 #his.url=192.168.12.39:8888 # \u516C\u53F8\u6D4B\u8BD5 #his.url=192.168.12.10:8888 # \u7EA2\u6CB3 #his.url=10.20.10.6:8888 # \u7EA2\u6CB3\u533B\u4FDD #his.url=10.20.10.6:8888 #his.url=192.168.12.10:8888 #his.md_url=192.168.1.128:7885 #his.dev_url=10.20.10.6:9988 # \u6C38\u80DC #his.url=200.200.200.20:8888 # \u5FB7\u5B8F\u4E2D\u533B #his.url=200.200.200.60:8888 # \u534E\u576A #his.url=192.168.1.115:8888 # \u8499\u81EA\u4E2D\u533B #his.url=192.168.0.228:8888 # \u7389\u9F99 #his.url=192.168.0.17:8888 # \u4E91\u9F99 #his.url=200.200.200.69:8888 # #his.url=172.16.10.15:8888 # \u7984\u529D\u949F\u7231 #his.url=200.200.200.5:8888 # \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662 #his.url=200.200.200.174:8080 # \u5143\u8C0B #his.url=200.200.200.29:8888 # \u5143\u8C0B\u533B\u4FDD #his.dev_url=200.200.200.36:9999 # \u8292\u5E02 #his.url=192.168.100.8:8888 # \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662 #his.url=192.168.1.204:8888 # \u8292\u5E02\u5987\u5E7C #his.url=192.168.11.7:8888 # #his.url=10.10.11.23:8888 # \u77F3\u6797 #his.url=192.168.10.10:8888 # \u5BCC\u6C11 #his.url=200.200.201.27:8888 # \u897F\u53CC\u7248\u7EB3 #his.url=10.10.11.23:8888 #wx.password=ynxbd@6910
# \u5F00\u542F\u5904\u65B9\u9884\u7ED3\u7B97\uFF08\u7B2C2\u5F00\u5173\uFF09\uFF08\u6CE8\u610F\u8BE5\u914D\u7F6E\u9700\u8054\u7CFBhis\u5F00\u53D1\u8005\u786E\u8BA4\u652F\u6301\u624D\u80FD\u5F00\u542F\uFF0C\u5426\u5219\u5B58\u5728\u98CE\u9669\uFF01\uFF09 his.is_recipe_prepay=false lis.url=192.168.1.185:8090 lis.unifiedEntrance=true # \u672C\u5730 #his.url=127.0.0.1:8888 # \u6D4B\u8BD5\u73AF\u5883 ali_code=675448357 # \u662F\u5426\u5F3A\u5236\u6253\u5370webservice\u7684xml\u8FD4\u56DE\u6570\u636E his.is_log_resp=true # \u662F\u5426\u4F20\u9012openid\u7ED9his\u63A8\u9001\u6D88\u606F his.is_push_msg=false #------------------------------------------------------------- #\u672C\u5730 his.md_url=127.0.0.1:7777 his.dev_url=127.0.0.1:7777 ## \u5FB7\u5B8F\u4E2D\u533B his.url=200.200.200.60:8888 ## \u7EA2\u6CB3\u5DDE\u533B\u9662 #his.url=10.20.10.6:8888 # \u5B81\u8497\u5987\u5E7C #his.url=172.19.3.15:8888 # \u516C\u53F8\u6D4B\u8BD5 #his.url=192.168.12.39:8888 # \u516C\u53F8\u6D4B\u8BD5 #his.url=192.168.12.10:8888 # \u7EA2\u6CB3 #his.url=10.20.10.6:8888 # \u7EA2\u6CB3\u533B\u4FDD #his.url=10.20.10.6:8888 #his.url=192.168.12.10:8888 #his.md_url=192.168.1.128:7885 #his.dev_url=10.20.10.6:9988 # \u6C38\u80DC #his.url=200.200.200.20:8888 # \u5FB7\u5B8F\u4E2D\u533B #his.url=200.200.200.60:8888 # \u534E\u576A #his.url=192.168.1.115:8888 # \u8499\u81EA\u4E2D\u533B #his.url=192.168.0.228:8888 # \u7389\u9F99 #his.url=192.168.0.17:8888 # \u4E91\u9F99 #his.url=200.200.200.69:8888 # #his.url=172.16.10.15:8888 # \u7984\u529D\u949F\u7231 #his.url=200.200.200.5:8888 # \u8499\u81EA\u5E02\u4EBA\u6C11\u533B\u9662 #his.url=200.200.200.174:8080 # \u5143\u8C0B #his.url=200.200.200.29:8888 # \u5143\u8C0B\u533B\u4FDD #his.dev_url=200.200.200.36:9999 # \u8292\u5E02 #his.url=192.168.100.8:8888 # \u7EA2\u6CB3\u5987\u5E7C\u4FDD\u5065\u9662 #his.url=192.168.1.204:8888 # \u8292\u5E02\u5987\u5E7C #his.url=192.168.11.7:8888 # #his.url=10.10.11.23:8888 # \u77F3\u6797 #his.url=192.168.10.10:8888 # \u5BCC\u6C11 #his.url=200.200.201.27:8888 # \u897F\u53CC\u7248\u7EB3 #his.url=10.10.11.23:8888 #wx.password=ynxbd@6910
Loading…
Cancel
Save