فهرست منبع

修改调用mcp服务

feng 10 ماه پیش
والد
کامیت
341bc208a9

+ 25 - 1
ruoyi-extend/ruoyi-mcp-server/src/main/java/org/ruoyi/mcpserve/service/impl/FastMCPServiceImpl.java

@@ -87,11 +87,35 @@ public class FastMCPServiceImpl implements IMCPService {
                 "required", List.of("startDate", "endDate")
         );
 
+        Map<String, Object> properties = new HashMap<>();
+        properties.put("id", Map.of("type", "integer", "description", "主键ID"));
+        properties.put("mrId", Map.of("type", "string", "description", "病历记录ID"));
+        properties.put("patVisitInfoId", Map.of("type", "string", "description", "病人就诊信息ID"));
+        properties.put("typeName", Map.of("type", "string", "description", "病历类型名称"));
+        properties.put("deptId", Map.of("type", "string", "description", "科室ID"));
+        properties.put("deptName", Map.of("type", "string", "description", "科室名称"));
+        properties.put("status", Map.of("type", "string", "description", "病历状态"));
+        properties.put("creator", Map.of("type", "string", "description", "创建人"));
+        properties.put("createTime", Map.of("type", "string", "description", "创建时间"));
+        properties.put("editor", Map.of("type", "string", "description", "修改人"));
+        properties.put("editTime", Map.of("type", "string", "description", "修改时间"));
+        properties.put("cmpltr", Map.of("type", "string", "description", "完成人"));
+        properties.put("cmpltTime", Map.of("type", "string", "description", "完成时间"));
+        properties.put("sno", Map.of("type", "string", "description", "病历排序号"));
+        properties.put("content", Map.of("type", "string", "description", "病历原文中的关键词(支持模糊匹配)"));
+        properties.put("datastatus", Map.of("type", "integer", "description", "处理状态:0-未处理,1-处理中,2-已处理"));
+
+        Map<String, Object> findMedicalRecordSchema = new HashMap<>();
+        findMedicalRecordSchema.put("type", "object");
+        findMedicalRecordSchema.put("properties", properties);
+        findMedicalRecordSchema.put("required", List.of("patVisitInfoId"));
+
         // 全部工具注册到 Map
         Map<String, ToolSchema> allTools = Map.of(
                 "loginUser", new ToolSchema("loginUser", "登录平台账号,验证用户名和密码", schema),
                 "queryKnowledgeList", new ToolSchema("queryKnowledgeList", "查询知识库列表,支持分页和筛选", knowledgeListSchema),
-                "hospitalActivity", new ToolSchema("hospitalActivity", "查询医院门诊和住院数据,支持按时间范围、医院、科室筛选", hospitalActivitySchema)
+                "hospitalActivity", new ToolSchema("hospitalActivity", "查询医院门诊和住院数据,支持按时间范围、医院、科室筛选", hospitalActivitySchema),
+                "findMedicalRecord", new ToolSchema("findMedicalRecord", "根据患者就诊信息ID及其他条件,查询电子病历记录,支持多字段精确或模糊筛选", hospitalActivitySchema)
         );
 
         // 工具名切分、过滤