浏览代码

根据匹配的基础规则ID获取确诊、拟诊、警惕的疾病

gaodm 4 年之前
父节点
当前提交
b2a66b0c63

+ 11 - 0
src/main/java/com/diagbot/vo/DiagnoseVO.java

@@ -13,5 +13,16 @@ import java.util.List;
 @Getter
 @Setter
 public class DiagnoseVO {
+    /**
+     * 符合的Id列表
+     */
     private List<Long> ids;
+    /**
+     * 性别:1:男, 2:女, 3:通用
+     */
+    private Integer sexType;
+    /**
+     * 年龄
+     */
+    private Double age;
 }

+ 11 - 0
src/main/java/com/diagbot/web/TestController.java

@@ -1,9 +1,12 @@
 package com.diagbot.web;
 
+import com.diagbot.dto.DiagnoseDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.StandConvertCrfBatchDTO;
 import com.diagbot.dto.StandConvertCrfDTO;
+import com.diagbot.facade.KlDiagnoseFacade;
 import com.diagbot.facade.TestFacade;
+import com.diagbot.vo.DiagnoseVO;
 import com.diagbot.vo.StandConvertCrfVO;
 import com.diagbot.vo.TestAllVO;
 import com.diagbot.vo.TestLineVO;
@@ -34,6 +37,8 @@ public class TestController {
 
     @Autowired
     private TestFacade testFacade;
+    @Autowired
+    private KlDiagnoseFacade klDiagnoseFacade;
 
     @ApiOperation(value = "开单合理性测试API[zhoutg]",
             notes = "idNum:指定行测试<br>" +
@@ -165,5 +170,11 @@ public class TestController {
     public RespDTO<List<Map<String, Object>>> importBill(@RequestParam("file") MultipartFile file, TestLineVO testLineVO) {
         return RespDTO.onSuc(testFacade.importBill(file, testLineVO));
     }
+
+    @ApiOperation(value = "获取确诊、拟诊、警惕的疾病[gaodm]", notes = "")
+    @PostMapping("/getDiagnoseByIds")
+    public RespDTO<List<DiagnoseDTO>> getDiagnoseByIds(@RequestBody DiagnoseVO diagnoseVO) {
+        return RespDTO.onSuc(klDiagnoseFacade.getDiagnoseByIds(diagnoseVO));
+    }
 }
 

+ 19 - 2
src/main/resources/mapper/KlDiagnoseMapper.xml

@@ -98,9 +98,26 @@
                     t11.concept_id,
                     t11.condition_type,
                     t11.condition_group
-            ) t12
+                ) t12,
+                kl_concept_common t15
         WHERE
-            t12.groupDiff = 1
+        t15.concept_id = t12.concept_id
+        AND t15.is_deleted = "N"
+        <if test="sexType != null or age != null">
+            <if test="sexType != null">
+                <if test="sexType == 3">
+                    and t15.sex_type in ('1','2','3')
+                </if>
+                <if test="sexType != 3">
+                    and t15.sex_type in ('3',#{sexType})
+                </if>
+            </if>
+            <if test="age != null">
+                <![CDATA[ AND t15.min_age <= #{age} ]]>
+                <![CDATA[ AND t15.max_age >= #{age} ]]>
+            </if>
+        </if>
+        AND t12.groupDiff = 1
     </select>
 
 </mapper>