提交 4d67f70e authored 作者: 杨凯's avatar 杨凯

feat:家庭医生初始化

上级 32be867f
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<dependency> <dependency>
<groupId>com.ihospital</groupId> <groupId>com.ihospital</groupId>
<artifactId>doctor-basedata-api</artifactId> <artifactId>doctor-basedata-api</artifactId>
<version>2.0.0</version> <version>${doctoruser-api.version}</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -154,17 +154,98 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -154,17 +154,98 @@ public class ImChatTemplateImpl implements ImChatTemplate {
if (!componentsList.isEmpty()) { if (!componentsList.isEmpty()) {
log.info("componentsList={}", componentsList); log.info("componentsList={}", componentsList);
String reportResult = ""; String reportResult = "";
PatientSignInfo patientSignInfo = getPatientSignInfo(sendImMsgDTO.getAdmId());
// 报告推送 // 报告推送
if (MsgTempTypeEnum.REP_INTER.getValue().equals(sendImMsgDTO.getType())) { if (MsgTempTypeEnum.REP_INTER.getValue().equals(sendImMsgDTO.getType())) {
String msgType = null;
List<MessageInfo> messageInfos = new ArrayList<>();
MessageInfo messageInfo = new MessageInfo();
for (int i = 0; i < componentsList.size(); i++) {
List<String> contentStr = new ArrayList<>();
String content = componentsList.get(i).getContent();
ReportDetailDTO reportDetailDTO = new ReportDetailDTO(); ReportDetailDTO reportDetailDTO = new ReportDetailDTO();
reportDetailDTO.setThirdId(sendImMsgDTO.getThirdId()); reportDetailDTO.setThirdId(sendImMsgDTO.getThirdId());
reportResult = thirdOrderPushUtil.getReportDetail(reportDetailDTO); reportResult = thirdOrderPushUtil.getReportDetail(reportDetailDTO);
// reportResult = "{\"code\":\"200\",\"message\":\"success\",\"data\":{\"reportType\":1,\"institution\":\"瑞金医院\",\"reportFileList\":[{\"fileUrl\":\"https://pension.home.komect.com/ac-health-oss/health-container/K4aW5uWQToWj0Ty7rCUlqw?AWSAccessKeyId=82A0955SWSXVITYRB1Z4&Expires=4070880000&Signature=Efrj6X4BI%2BtYlcdjoGboaJhedE0%3D\",\"fileType\":1}],\"reportName\":\"验血报告\",\"createTime\":\"2024-03-26 19:29:28\",\"examinationTime\":\"2024-03-26\"},\"time\":1711530711174}"; reportResult = "{\"code\":\"200\",\"message\":\"success\",\"data\":{\"reportType\":1,\"institution\":\"瑞金医院\",\"reportFileList\":[{\"fileUrl\":\"https://pension.home.komect.com/ac-health-oss/health-container/K4aW5uWQToWj0Ty7rCUlqw?AWSAccessKeyId=82A0955SWSXVITYRB1Z4&Expires=4070880000&Signature=Efrj6X4BI%2BtYlcdjoGboaJhedE0%3D\",\"fileType\":1},{\"fileUrl\":\"https://pension.home.komect.com/ac-health-oss/health-container/K4aW5uWQToWj0Ty7rCUlqw?AWSAccessKeyId=82A0955SWSXVITYRB1Z4&Expires=4070880000&Signature=Efrj6X4BI%2BtYlcdjoGboaJhedE0%3D\",\"fileType\":1},{\"fileUrl\":\"https://pension.home.komect.com/ac-health-oss/health-container/K4aW5uWQToWj0Ty7rCUlqw?AWSAccessKeyId=82A0955SWSXVITYRB1Z4&Expires=4070880000&Signature=Efrj6X4BI%2BtYlcdjoGboaJhedE0%3D\",\"fileType\":1}],\"reportName\":\"验血报告\",\"createTime\":\"2024-03-26 19:29:28\",\"examinationTime\":\"2024-03-26\"},\"time\":1711530711174}";
if (!StringUtils.isEmpty(reportResult)) {
Result rrResult = JSON.parseObject(reportResult, Result.class);
if (rrResult.isSuccess()) {
ReportDetailVo reportDetailVo = JSON.parseObject(JSONObject.toJSONString(rrResult.getData()), ReportDetailVo.class);
List<ReportDetailItemVo> reportDetailItemVos = reportDetailVo.getReportFileList();
if (Objects.nonNull(reportDetailVo)) {
if (i == 0) {
content = MessageFormat.format(content, patientSignInfo.getDoctorName(), ReportTypeEnum.getDesc(reportDetailVo.getReportType()));
} else if (i == 1) {
Map<String, Object> imageMap = new HashMap<>();
for (ReportDetailItemVo reportDetailItemVo : reportDetailItemVos) {
imageMap.put("UserAction", CommonConstants.USER_ACTION);
imageMap.put("applicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
imageMap.put("appointmentId", sendImMsgDTO.getAdmId());
imageMap.put("attacheUrl", reportDetailItemVo.getFileUrl());
imageMap.put("businessCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
imageMap.put("doctorHeadUrl", patientSignInfo.getDoctorHeadPortrait());
imageMap.put("doctorName", patientSignInfo.getDoctorName());
imageMap.put("msgId", UUIDUtil.getUUID());
imageMap.put("msgType", CommonConstants.MSG_TYPE);
imageMap.put("senderName", patientSignInfo.getDoctorName());
imageMap.put("senderProfessional", patientSignInfo.getDoctorProfessional());
imageMap.put("team", false);
imageMap.put("teamFlag", 0);
imageMap.put("toApplicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
content = JSONObject.toJSONString(imageMap);
contentStr.add(content);
} }
msgType = "TIMCustomElem";
} else if (i == 2) {
if (Objects.nonNull(reportDetailVo)) {
content = MessageFormat.format(content, ReportTypeEnum.getDesc(reportDetailVo.getReportType()));
}
}
}
}
}
if (SenderEnum.DOCTOR.getDesc().equals(componentsList.get(i).getSender())) {
messageInfo = getDoctorInformRefreshPatientParam(patientSignInfo, IMInformConstants.REFRESH);
} else {
log.info("msgType={}", msgType);
messageInfo = getInformRefreshPatientParam(patientSignInfo, IMInformConstants.REFRESH, msgType);
}
messageInfos.add(messageInfo);
PersonImInformReq parameter = new PersonImInformReq();
parameter.setMessageInfos(messageInfos);
parameter.setAdmissionId(sendImMsgDTO.getAdmId());
parameter.setBusiCode(IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
log.info("推送家庭医生提示语推送:{}" + JSON.toJSONString(parameter.getMessageInfos()));
Long syncFlag = i * 100L;
if (i == 1) {
if (personUserImInform(parameter, content, syncFlag, msgType)) {
log.info("推送家庭医生提示语推送成功,admissionId:{}", sendImMsgDTO.getAdmId());
flag = true;
}
} else if (i == 1) {
for (int j = 1; j < contentStr.size(); j++) {
syncFlag = j * 100L;
if (personUserImInform(parameter, content, syncFlag, msgType)) {
log.info("推送家庭医生提示语推送成功,admissionId:{}", sendImMsgDTO.getAdmId());
flag = true;
}
}
} else if (i == 2) {
syncFlag = contentStr.size() + 1L;
if (personUserImInform(parameter, content, syncFlag, msgType)) {
log.info("推送家庭医生提示语推送成功,admissionId:{}", sendImMsgDTO.getAdmId());
flag = true;
}
}
}
} else {
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());
MessageInfo messageInfo = new MessageInfo(); MessageInfo messageInfo = new MessageInfo();
// 报告解读 // 报告解读
String msgType = null; String msgType = null;
...@@ -179,12 +260,13 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -179,12 +260,13 @@ public class ImChatTemplateImpl implements ImChatTemplate {
content = MessageFormat.format(content, patientSignInfo.getDoctorName(), ReportTypeEnum.getDesc(reportDetailVo.getReportType())); content = MessageFormat.format(content, patientSignInfo.getDoctorName(), ReportTypeEnum.getDesc(reportDetailVo.getReportType()));
} }
} else if (i == 1) { } else if (i == 1) {
List<String> contentStr = new ArrayList<>();
Map<String, Object> imageMap = new HashMap<>(); Map<String, Object> imageMap = new HashMap<>();
// if (reportDetailVo.getReportType().equals(1)) { for (ReportDetailItemVo reportDetailItemVo : reportDetailItemVos) {
imageMap.put("UserAction", CommonConstants.USER_ACTION); imageMap.put("UserAction", CommonConstants.USER_ACTION);
imageMap.put("applicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE); imageMap.put("applicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
imageMap.put("appointmentId", sendImMsgDTO.getAdmId()); imageMap.put("appointmentId", sendImMsgDTO.getAdmId());
imageMap.put("attacheUrl", reportDetailItemVos.get(0).getFileUrl()); imageMap.put("attacheUrl", reportDetailItemVo.getFileUrl());
imageMap.put("businessCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE); imageMap.put("businessCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
imageMap.put("doctorHeadUrl", patientSignInfo.getDoctorHeadPortrait()); imageMap.put("doctorHeadUrl", patientSignInfo.getDoctorHeadPortrait());
imageMap.put("doctorName", patientSignInfo.getDoctorName()); imageMap.put("doctorName", patientSignInfo.getDoctorName());
...@@ -195,10 +277,11 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -195,10 +277,11 @@ public class ImChatTemplateImpl implements ImChatTemplate {
imageMap.put("team", false); imageMap.put("team", false);
imageMap.put("teamFlag", 0); imageMap.put("teamFlag", 0);
imageMap.put("toApplicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE); imageMap.put("toApplicationCode", IMInformConstants.IM_SYSTEM_BUSINESS_CODE);
msgType = "TIMCustomElem";
// }
content = JSONObject.toJSONString(imageMap); content = JSONObject.toJSONString(imageMap);
contentStr.add(content);
}
msgType = "TIMCustomElem";
} else if (i == 2) { } else if (i == 2) {
if (Objects.nonNull(reportDetailVo)) { if (Objects.nonNull(reportDetailVo)) {
content = MessageFormat.format(content, ReportTypeEnum.getDesc(reportDetailVo.getReportType())); content = MessageFormat.format(content, ReportTypeEnum.getDesc(reportDetailVo.getReportType()));
...@@ -296,6 +379,8 @@ public class ImChatTemplateImpl implements ImChatTemplate { ...@@ -296,6 +379,8 @@ public class ImChatTemplateImpl implements ImChatTemplate {
flag = true; flag = true;
} }
} }
}
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论