Explorar el Código

1、将用户中医疾病、中医证候转成标准医学术语

zhaops hace 4 años
padre
commit
fbb4bcd803

+ 1 - 0
src/main/java/com/diagbot/config/ResourceServerConfigurer.java

@@ -151,6 +151,7 @@ public class ResourceServerConfigurer extends ResourceServerConfigurerAdapter {
                 .antMatchers("/sys/disclaimerInfo/getDisclaimerInfo").permitAll()
                 .antMatchers("/sys/mr/createMr").permitAll()
                 .antMatchers("/sys/mr/getMr").permitAll()
+                .antMatchers("/sys/mr/getTcmMr").permitAll()
                 .antMatchers("/sys/mr/getIndicationMr").permitAll()
                 .antMatchers("/sys/plan/getSysPlanInfoDatas").permitAll()
                 .antMatchers("/sys/mrqc/analyze_run").permitAll()

+ 1 - 0
src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -194,6 +194,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
                 || matchers("/sys/disclaimerInfo/getDisclaimerInfo", request)
                 || matchers("/sys/mr/createMr", request)
                 || matchers("/sys/mr/getMr", request)
+                || matchers("/sys/mr/getTcmMr", request)
                 || matchers("/sys/mr/getIndicationMr", request)
                 || matchers("/sys/plan/getSysPlanInfoDatas", request)
                 || matchers("/sys/mrqc/analyze_run", request)

+ 23 - 0
src/main/java/com/diagbot/dto/TcmDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import com.diagbot.biz.push.entity.Item;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/5/14 13:54
+ */
+@Getter
+@Setter
+public class TcmDTO {
+    /**
+     * 中医疾病
+     */
+    private Item tcmdisease;
+    /**
+     * 中医证候
+     */
+    private Item tcmsyndrome;
+}

+ 9 - 2
src/main/java/com/diagbot/service/MrService.java

@@ -1,5 +1,6 @@
 package com.diagbot.service;
 
+import com.diagbot.dto.TcmDTO;
 import com.diagbot.vo.PushJoinVO;
 
 /**
@@ -11,16 +12,22 @@ public interface MrService {
 
     /**
      * 创建病历信息
-     *
      */
     String createMr(PushJoinVO imgVerInfo);
 
     /**
      * 获取病历信息
-     *
      */
     PushJoinVO getMr(String mrId);
 
+    /**
+     * 获取中医病历信息
+     *
+     * @param mrId
+     * @return
+     */
+    TcmDTO getTcmMr(String mrId);
+
     /**
      * 删除病历信息
      */

+ 62 - 0
src/main/java/com/diagbot/service/impl/MrServiceImpl.java

@@ -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;
+    }
+
     /**
      * 删除用户短信验证码信息
      */

+ 9 - 0
src/main/java/com/diagbot/web/MrController.java

@@ -3,6 +3,7 @@ package com.diagbot.web;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.IndicationDTO;
 import com.diagbot.dto.RespDTO;
+import com.diagbot.dto.TcmDTO;
 import com.diagbot.facade.MrFacade;
 import com.diagbot.vo.MrVO;
 import com.diagbot.vo.PushJoinVO;
@@ -46,6 +47,14 @@ public class MrController {
 		return RespDTO.onSuc(mrFacade.getMr(mrVO.getMrId()));
 	}
 
+	@ApiOperation(value = "获取中医病历信息 :[by:zhaops]",
+			notes = "mrId: 病历编号,必填<br>")
+	@PostMapping("/getTcmMr")
+	@SysLogger("getTcmMr")
+	public RespDTO<TcmDTO> getTcmMr(@RequestBody @Valid MrVO mrVO) {
+		return RespDTO.onSuc(mrFacade.getTcmMr(mrVO.getMrId()));
+	}
+
 	@ApiOperation(value = "获取提醒类结果 :[by:zhoutg]",
 			notes = "mrId: 病历编号,必填<br>")
 	@PostMapping("/getIndicationMr")