提交 8ccbdfdd authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 2c7555ff
...@@ -43,6 +43,11 @@ public class MessageInfo { ...@@ -43,6 +43,11 @@ public class MessageInfo {
*/ */
private String actionType; private String actionType;
/**
* 【选填】消息类型:TIMTextElem,TIMLocationElem,TIMFaceElem,TIMCustomElem,TIMSoundElem,TIMImageElem,TIMFileElem, TIMVideoFileElem
*/
private String msgType;
public List<AccountVO> getReceiveAccounts() { public List<AccountVO> getReceiveAccounts() {
return receiveAccounts; return receiveAccounts;
} }
...@@ -91,6 +96,14 @@ public class MessageInfo { ...@@ -91,6 +96,14 @@ public class MessageInfo {
this.actionType = actionType; this.actionType = actionType;
} }
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
@Override @Override
public String toString() { public String toString() {
return "MessageInfo{" + return "MessageInfo{" +
......
...@@ -30,4 +30,6 @@ public class SendImMsgDTO { ...@@ -30,4 +30,6 @@ public class SendImMsgDTO {
private String abnormalId; private String abnormalId;
private String intention; private String intention;
private String thirdId;
} }
...@@ -36,4 +36,8 @@ public class RegisterPatientVo { ...@@ -36,4 +36,8 @@ public class RegisterPatientVo {
private String intention; private String intention;
private String doctorId; private String doctorId;
private String thirdId;
private String userId;
} }
...@@ -13,5 +13,5 @@ public class ReportDetailItemVo { ...@@ -13,5 +13,5 @@ public class ReportDetailItemVo {
private String fileUrl; private String fileUrl;
private String fileType; private Integer fileType;
} }
...@@ -21,7 +21,7 @@ public class ReportDetailVo { ...@@ -21,7 +21,7 @@ public class ReportDetailVo {
private String diagnosis; private String diagnosis;
private String reportType; private Integer reportType;
private String createTime; private String createTime;
......
package com.ebaiyihui.family.doctor.server.common.enums;
import org.apache.commons.lang.StringUtils;
/**
* @ClassName: ReportTypeEnum
* @Author:yanliang
* @Date:2024/3/27 15:10
* @Description
*/
public enum ReportTypeEnum {
// 报告类型,1检查检验, 2就诊病历
INSPECTION("检查检验", 1),
CONSULTATION("就诊病历", 2);
private String desc;
private Integer value;
private ReportTypeEnum(String desc, Integer value) {
this.desc = desc;
this.value = value;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public static String getDesc(Integer value) {
if (value == null || value < 0) {
return null;
}
for (ReportTypeEnum reportTypeEnum : ReportTypeEnum.values()) {
if (value.equals(reportTypeEnum.getValue())) {
return reportTypeEnum.getDesc();
}
}
return null;
}
public static Integer getValue(String desc) {
if (StringUtils.isBlank(desc)) {
return null;
}
for (ReportTypeEnum reportTypeEnum : ReportTypeEnum.values()) {
if (reportTypeEnum.getDesc().equals(desc)) {
return reportTypeEnum.getValue();
}
}
return null;
}
}
...@@ -10,11 +10,15 @@ import com.doctoruser.api.pojo.vo.UserInfoByUserIdRespVO; ...@@ -10,11 +10,15 @@ import com.doctoruser.api.pojo.vo.UserInfoByUserIdRespVO;
import com.ebaiyihui.family.doctor.common.bo.*; import com.ebaiyihui.family.doctor.common.bo.*;
import com.ebaiyihui.family.doctor.common.dto.DoctorIdDTO; import com.ebaiyihui.family.doctor.common.dto.DoctorIdDTO;
import com.ebaiyihui.family.doctor.common.dto.HealthInfoDTO; import com.ebaiyihui.family.doctor.common.dto.HealthInfoDTO;
import com.ebaiyihui.family.doctor.common.dto.ReportDetailDTO;
import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO; import com.ebaiyihui.family.doctor.common.dto.SendImMsgDTO;
import com.ebaiyihui.family.doctor.common.vo.ReportDetailItemVo;
import com.ebaiyihui.family.doctor.common.vo.ReportDetailVo;
import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants; import com.ebaiyihui.family.doctor.server.common.constants.CommonConstants;
import com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants; import com.ebaiyihui.family.doctor.server.common.constants.IMInformConstants;
import com.ebaiyihui.family.doctor.server.common.constants.ImConstants; import com.ebaiyihui.family.doctor.server.common.constants.ImConstants;
import com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum; import com.ebaiyihui.family.doctor.server.common.enums.MsgTempTypeEnum;
import com.ebaiyihui.family.doctor.server.common.enums.ReportTypeEnum;
import com.ebaiyihui.family.doctor.server.common.enums.SenderEnum; import com.ebaiyihui.family.doctor.server.common.enums.SenderEnum;
import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity; import com.ebaiyihui.family.doctor.server.entity.PatientSignEntity;
import com.ebaiyihui.family.doctor.server.exception.BusinessException; import com.ebaiyihui.family.doctor.server.exception.BusinessException;
...@@ -26,6 +30,7 @@ import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper; ...@@ -26,6 +30,7 @@ import com.ebaiyihui.family.doctor.server.mapper.PatientSignMapper;
import com.ebaiyihui.family.doctor.server.service.ImChatTemplate; import com.ebaiyihui.family.doctor.server.service.ImChatTemplate;
import com.ebaiyihui.family.doctor.server.util.JsonUtil; import com.ebaiyihui.family.doctor.server.util.JsonUtil;
import com.ebaiyihui.family.doctor.server.util.ThirdOrderPushUtil; import com.ebaiyihui.family.doctor.server.util.ThirdOrderPushUtil;
import com.ebaiyihui.family.doctor.server.util.UUIDUtil;
import com.ebaiyihui.framework.response.BaseResponse; import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.*; import com.ebaiyihui.imforward.client.vo.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -35,9 +40,7 @@ import org.springframework.stereotype.Service; ...@@ -35,9 +40,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.ArrayList; import java.util.*;
import java.util.List;
import java.util.Objects;
/** /**
* @ClassName: ImChatTemplateImpl * @ClassName: ImChatTemplateImpl
...@@ -153,14 +156,58 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -153,14 +156,58 @@ public class ImChatTemplateImpl implements ImChatTemplate {
Boolean flag = false; Boolean flag = false;
if (!componentsList.isEmpty()) { if (!componentsList.isEmpty()) {
log.info("componentsList={}", componentsList); log.info("componentsList={}", componentsList);
String reportResult = "";
// 报告推送
if (MsgTempTypeEnum.REP_INTER.getValue().equals(sendImMsgDTO.getType())) {
ReportDetailDTO reportDetailDTO = new ReportDetailDTO();
reportDetailDTO.setThirdId(sendImMsgDTO.getThirdId());
reportResult = thirdOrderPushUtil.getReportDetail(reportDetailDTO);
}
for (int i = 0; i < componentsList.size(); i++) { for (int i = 0; i < componentsList.size(); i++) {
String content = componentsList.get(i).getContent(); String content = componentsList.get(i).getContent();
List<MessageInfo> messageInfos = new ArrayList<>(); List<MessageInfo> messageInfos = new ArrayList<>();
PatientSignInfo patientSignInfo = getPatientSignInfo(sendImMsgDTO.getAdmId()); PatientSignInfo patientSignInfo = getPatientSignInfo(sendImMsgDTO.getAdmId());
MessageInfo messageInfo = new MessageInfo(); MessageInfo messageInfo = new MessageInfo();
// 报告解读
if (MsgTempTypeEnum.REP_INTER.getValue().equals(sendImMsgDTO.getType())) {
if (!StringUtils.isEmpty(reportResult)) {
Result<String> rrResult = JSON.parseObject(reportResult, Result.class);
if (rrResult.isSuccess()) {
ReportDetailVo reportDetailVo = JSONObject.parseObject(rrResult.getData(), ReportDetailVo.class);
List<ReportDetailItemVo> reportDetailItemVos = reportDetailVo.getReportFileList();
if (i == 1 || i == 3) {
if (Objects.nonNull(reportDetailVo)) {
content = MessageFormat.format(content, patientSignInfo.getDoctorName(), ReportTypeEnum.getDesc(reportDetailVo.getReportType()));
}
} else if (i == 2) {
Map<String, Object> map = new HashMap<>();
if (reportDetailVo.getReportType().equals(1)) {
List<Map<String, Object>> mapList = new ArrayList<>();
map.put("UUID", UUIDUtil.getUUID());
map.put("ImageFormat", 1);
for (ReportDetailItemVo reportDetailItemVo : reportDetailItemVos) {
if (reportDetailItemVo.getFileType().equals(1)) {
Map<String, Object> imageMap = new HashMap<>();
imageMap.put("Type", 1);
imageMap.put("URL", reportDetailItemVo.getFileUrl());
mapList.add(imageMap);
}
}
map.put("ImageInfoArray", mapList);
} else {
map.put("UUID", UUIDUtil.getUUID());
map.put("URL", reportDetailItemVos.get(0).getFileUrl());
map.put("FileName", StringUtils.isEmpty(reportDetailVo.getReprotName())
? ReportTypeEnum.getDesc(reportDetailVo.getReportType())
: reportDetailVo.getReprotName());
map.put("Download_Flag", "2");
}
content = JSONObject.toJSONString(map);
}
}
}
// 报告异常特殊处理 } else if (MsgTempTypeEnum.REP_ANO.getValue().equals(sendImMsgDTO.getType())) { // 报告异常特殊处理
if (MsgTempTypeEnum.REP_ANO.getValue().equals(sendImMsgDTO.getType())) {
content = MessageFormat.format(content, patientSignInfo.getDoctorName(), sendImMsgDTO.getIntention()); content = MessageFormat.format(content, patientSignInfo.getDoctorName(), sendImMsgDTO.getIntention());
} else { } else {
if (!StringUtils.isEmpty(sendImMsgDTO.getOldAdmId())) { if (!StringUtils.isEmpty(sendImMsgDTO.getOldAdmId())) {
...@@ -188,9 +235,6 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -188,9 +235,6 @@ public class ImChatTemplateImpl implements ImChatTemplate {
} else { } else {
content = MessageFormat.format(content, patientSignInfo.getDoctorName()); content = MessageFormat.format(content, patientSignInfo.getDoctorName());
if (MsgTempTypeEnum.REP_INTER.getValue().equals(sendImMsgDTO.getType())){
}
} }
} }
......
...@@ -126,6 +126,10 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ ...@@ -126,6 +126,10 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
registerPatientVo.setDoctorId(map.get("doctorId")); registerPatientVo.setDoctorId(map.get("doctorId"));
} }
if (Objects.nonNull(map.get("thirdId"))) {
registerPatientVo.setThirdId(map.get("thirdId"));
}
if (Objects.nonNull(map.get("signSeqId"))) { if (Objects.nonNull(map.get("signSeqId"))) {
registerPatientVo.setSignSeqId(map.get("signSeqId")); registerPatientVo.setSignSeqId(map.get("signSeqId"));
PatientSignEntity patientSignEntity = patientSignMapper.selectById(Long.valueOf(map.get("signSeqId"))); PatientSignEntity patientSignEntity = patientSignMapper.selectById(Long.valueOf(map.get("signSeqId")));
...@@ -181,7 +185,7 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ ...@@ -181,7 +185,7 @@ public class MobileBenefitPackageServiceImpl implements MobileBenefitPackageServ
mobileBenefitPackageMapper.update(entity); mobileBenefitPackageMapper.update(entity);
} }
registerPatientVo.setUserId(entity.getUserId());
return BaseResponse.success(registerPatientVo); return BaseResponse.success(registerPatientVo);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论