|
@@ -1,5 +1,11 @@
|
|
|
package com.diagbot.service.impl;
|
|
|
|
|
|
+import com.diagbot.biz.push.entity.Item;
|
|
|
+import com.diagbot.dto.TcmDTO;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
+import com.diagbot.facade.TcmdiseaseConfigFacade;
|
|
|
+import com.diagbot.facade.TcmsyndromeConfigFacade;
|
|
|
import com.diagbot.idc.VisibleIdCreater;
|
|
|
import com.diagbot.service.MrService;
|
|
|
import com.diagbot.util.DateUtil;
|
|
@@ -14,7 +20,10 @@ import org.springframework.data.redis.core.RedisCallback;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @Description: 病历保存到redis接口实现
|
|
@@ -27,6 +36,10 @@ public class MrServiceImpl implements MrService {
|
|
|
@Autowired
|
|
|
@Qualifier("redisTemplateForMr")
|
|
|
private RedisTemplate redisForMr;
|
|
|
+ @Autowired
|
|
|
+ private TcmdiseaseConfigFacade tcmdiseaseConfigFacade;
|
|
|
+ @Autowired
|
|
|
+ private TcmsyndromeConfigFacade tcmsyndromeConfigFacade;
|
|
|
|
|
|
@Autowired
|
|
|
private VisibleIdCreater visibleIdCreater;
|
|
@@ -106,6 +119,55 @@ public class MrServiceImpl implements MrService {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取中医病历信息
|
|
|
+ * @param mrId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public TcmDTO getTcmMr(String mrId) {
|
|
|
+ TcmDTO tcmDTO = new TcmDTO();
|
|
|
+ PushJoinVO pushJoinVO = getMr(mrId);
|
|
|
+ if (pushJoinVO == null) {
|
|
|
+ return tcmDTO;
|
|
|
+ }
|
|
|
+ Long hospitalId = pushJoinVO.getHospitalId();
|
|
|
+ if (hospitalId == null) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "请输入医院id");
|
|
|
+ }
|
|
|
+ Map<String, String> otherIndex = pushJoinVO.getOtherIndex();
|
|
|
+ if (otherIndex != null) {
|
|
|
+ Item tcmdisease = new Item();
|
|
|
+ if (otherIndex.containsKey("中医疾病")) {
|
|
|
+ tcmdisease.setName(otherIndex.get("中医疾病"));
|
|
|
+ Map<String, Map<String, Long>> configMap
|
|
|
+ = tcmdiseaseConfigFacade.getConfigMap(hospitalId,
|
|
|
+ Arrays.asList(new String[] { tcmdisease.getName() }), null);
|
|
|
+ if (configMap != null && configMap.get(tcmdisease.getName()) != null) {
|
|
|
+ tcmdisease.setUniqueName(configMap.get(tcmdisease.getName()).keySet().stream().collect(Collectors.toList()).get(0));
|
|
|
+ } else {
|
|
|
+ tcmdisease.setUniqueName(tcmdisease.getName());
|
|
|
+ }
|
|
|
+ tcmDTO.setTcmdisease(tcmdisease);
|
|
|
+ }
|
|
|
+
|
|
|
+ Item tcmsyndrome = new Item();
|
|
|
+ if (otherIndex.containsKey("中医证候")) {
|
|
|
+ tcmsyndrome.setName(otherIndex.get("中医证候"));
|
|
|
+ Map<String, Map<String, Long>> configMap
|
|
|
+ = tcmsyndromeConfigFacade.getConfigMap(hospitalId,
|
|
|
+ Arrays.asList(new String[] { tcmsyndrome.getName() }), null);
|
|
|
+ if (configMap != null && configMap.get(tcmsyndrome.getName()) != null) {
|
|
|
+ tcmsyndrome.setUniqueName(configMap.get(tcmsyndrome.getName()).keySet().stream().collect(Collectors.toList()).get(0));
|
|
|
+ } else {
|
|
|
+ tcmsyndrome.setUniqueName(tcmsyndrome.getName());
|
|
|
+ }
|
|
|
+ tcmDTO.setTcmsyndrome(tcmsyndrome);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return tcmDTO;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除用户短信验证码信息
|
|
|
*/
|