Преглед изворни кода

疾病增加映射,重寫疾病后結構化

louhr пре 5 година
родитељ
комит
df17f49806

+ 2 - 3
kernel/src/main/java/com/lantone/qc/kernel/structure/ai/process/EntityProcess.java

@@ -9,6 +9,7 @@ import com.lantone.qc.kernel.util.CatalogueUtil;
 import com.lantone.qc.kernel.structure.ai.model.Relation;
 import com.lantone.qc.kernel.util.KernelConstants;
 import com.lantone.qc.kernel.util.RedisUtil;
+import com.lantone.qc.kernel.util.SpringContextUtil;
 import com.lantone.qc.pub.model.entity.Diag;
 import com.lantone.qc.pub.model.entity.DiagInfectious;
 import com.lantone.qc.pub.model.entity.Negative;
@@ -30,10 +31,7 @@ import java.util.regex.Pattern;
  * @Author: HUJING
  * @Date: 2020/2/2 10:07
  */
-@Component
 public class EntityProcess {
-    @Autowired
-    RedisUtil redisUtil;
     /**
      * 树形结构存储三元组关系,返回传入实体类型为节点的所有关联实体对象
      * @param aiOut
@@ -229,6 +227,7 @@ public class EntityProcess {
      * @param diag
      */
     protected void setDiag(Lemma lemma, Diag diag) {
+        RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
         Map<String, String> diagRedisMap = (Map<String, String>)redisUtil.get(KernelConstants.CONCEPT_DIAG_HOSPITAL_REFLECT);
         diag.setHospitalDiagName(lemma.getText());  //存放医院原始疾病名称
         diag.setName(diagRedisMap.get(lemma.getText()) == null ? "" : diagRedisMap.get(lemma.getText()));//映射到我们的标准疾病名称

+ 10 - 3
kernel/src/main/java/com/lantone/qc/kernel/web/controller/QCTestController.java

@@ -37,7 +37,7 @@ public class QCTestController {
 
     @ApiOperation(value = "质控测试接口,无需token信息", notes = "")
     @PostMapping("rec_test")
-    public Response<OutputInfo> extract(String caseIds) {
+    public Response<OutputInfo> extract(String caseIds, int length, String cid) {
         Response response = new Response();
         PropertiesUtil propertiesUtil = new PropertiesUtil("kernel.properties");
 
@@ -55,12 +55,13 @@ public class QCTestController {
             //测试数据查询
             String sql = "SELECT qmap.id, qi.id text_id, qi.text, ca.name, entry.code FROM \n" +
                     "qc_inputcases_mapping qmap, qc_inputcases qi, qc_cases_entry entry, qc_cases ca\n" +
-                    "where qmap.cases_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id ";
+                    "where qmap.text_id = qi.id and qmap.cases_entry_id = entry.id and entry.cases_id = ca.id ";
 
             if (!StringUtils.isNotEmpty(caseIds)) {
                 sql = sql + " and entry.cases_id in (" + caseIds + ")";
             }
             sql = sql + " order by qi.id";
+
             Map<String, String> map = new HashMap<>();
             rs = st.executeQuery(sql);
             //条目数据结构, Key = 条目Code value = 条目属性{"precode":"BEH0002,BEH0003","title":"症状缺少时间描述"}
@@ -72,7 +73,7 @@ public class QCTestController {
             List<String> textList = new ArrayList<>();
             List<String> caseList = new ArrayList<>();
             List<Map<String, String>> updateList = new ArrayList<>();
-            String textId = "";
+            String textId = ""; int index = 0;
             while (rs.next()) {
                 r1 = rs.getString(1);
                 r2 = rs.getString(2);
@@ -81,6 +82,11 @@ public class QCTestController {
                 r5 = rs.getString(5);
                 if (!textId.equals(r2)) {
                     if (StringUtils.isNotEmpty(textId)) {
+                        index++;
+                        if (index > length) {
+                            break;
+                        }
+
                         catalogueList.add(catalogueMap);
                         updateList.add(updateMap);
                         textList.add(r3);
@@ -106,6 +112,7 @@ public class QCTestController {
 
                 QueryVo queryVo = new QueryVo();
                 queryVo.setMedrec(medrec);
+                queryVo.setCid(cid);
                 queryVo.setInputCatalogueMap(catalogueList.get(i));
 
                 OutputInfo outputInfo = qCAnalysis.anlysis(queryVo);