|
@ -2,6 +2,7 @@ package com.yihu.hos.rest.controllers;
|
|
|
|
|
|
import com.yihu.hos.core.datatype.StringUtil;
|
|
import com.yihu.hos.core.datatype.StringUtil;
|
|
import com.yihu.hos.rest.models.crawler.patient.Patient;
|
|
import com.yihu.hos.rest.models.crawler.patient.Patient;
|
|
|
|
import com.yihu.hos.rest.services.crawler.CrawlerFlowManager;
|
|
import com.yihu.hos.rest.services.crawler.CrawlerManager;
|
|
import com.yihu.hos.rest.services.crawler.CrawlerManager;
|
|
import com.yihu.hos.rest.services.crawler.CrawlerService;
|
|
import com.yihu.hos.rest.services.crawler.CrawlerService;
|
|
import com.yihu.hos.rest.services.standard.adapter.AdapterSchemeService;
|
|
import com.yihu.hos.rest.services.standard.adapter.AdapterSchemeService;
|
|
@ -20,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@ -36,6 +38,9 @@ public class CrawlerController {
|
|
CrawlerService crawlerService;
|
|
CrawlerService crawlerService;
|
|
@Resource
|
|
@Resource
|
|
CrawlerManager crawlerManager;
|
|
CrawlerManager crawlerManager;
|
|
|
|
@Resource
|
|
|
|
CrawlerFlowManager crawlerFlowManager;
|
|
|
|
|
|
|
|
|
|
@Resource(name = AdapterSchemeService.BEAN_ID)
|
|
@Resource(name = AdapterSchemeService.BEAN_ID)
|
|
private AdapterSchemeService adapterSchemeService;
|
|
private AdapterSchemeService adapterSchemeService;
|
|
@ -78,7 +83,7 @@ public class CrawlerController {
|
|
@RequestMapping(value = "patient", method = RequestMethod.POST)
|
|
@RequestMapping(value = "patient", method = RequestMethod.POST)
|
|
@ApiOperation(value = "采集病人健康档案", produces = "application/json", notes = "采集病人健康档案")
|
|
@ApiOperation(value = "采集病人健康档案", produces = "application/json", notes = "采集病人健康档案")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public Result crawler(
|
|
|
|
|
|
public Result crawlerPatient(
|
|
@ApiParam(name = "patient", value = "病人索引信息", required = true)
|
|
@ApiParam(name = "patient", value = "病人索引信息", required = true)
|
|
@RequestParam(value = "patient") String patientInfo) {
|
|
@RequestParam(value = "patient") String patientInfo) {
|
|
|
|
|
|
@ -95,6 +100,56 @@ public class CrawlerController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "patient/flow", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "采集病人健康档案", produces = "application/json", notes = "采集病人健康档案")
|
|
|
|
@ResponseBody
|
|
|
|
public Result crawlerPatientFlow(
|
|
|
|
@ApiParam(name = "patient", value = "病人索引信息", required = true)
|
|
|
|
@RequestParam(value = "patient") String patientInfo) {
|
|
|
|
|
|
|
|
Patient patient = crawlerFlowManager.parsePatient(patientInfo);
|
|
|
|
if (patient != null) {
|
|
|
|
Boolean result = crawlerFlowManager.collectProcess(patient);
|
|
|
|
if (result) {
|
|
|
|
return Result.success("采集上传成功");
|
|
|
|
} else {
|
|
|
|
return Result.error("采集上传失败");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return Result.error("参数转换病人实体失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "patientList", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "采集病人健康档案", produces = "application/json", notes = "采集病人健康档案")
|
|
|
|
@ResponseBody
|
|
|
|
public Result crawlerPatientList(
|
|
|
|
@ApiParam(name = "beginDate", value = "开始时间", required = true)
|
|
|
|
@RequestParam(value = "beginDate") Date beginDate,
|
|
|
|
@ApiParam(name = "endDate", value = "开始时间", required = true)
|
|
|
|
@RequestParam(value = "endDate") Date endDate) {
|
|
|
|
try {
|
|
|
|
return crawlerManager.dataCrawler(beginDate, endDate);
|
|
|
|
} catch (Exception e) {
|
|
|
|
return Result.error("采集上传失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "patientListFlow", method = RequestMethod.POST)
|
|
|
|
@ApiOperation(value = "采集病人健康档案", produces = "application/json", notes = "采集病人健康档案")
|
|
|
|
@ResponseBody
|
|
|
|
public Result crawlerPatientListFlow(
|
|
|
|
@ApiParam(name = "beginDate", value = "开始时间", required = true)
|
|
|
|
@RequestParam(value = "beginDate") Date beginDate,
|
|
|
|
@ApiParam(name = "endDate", value = "开始时间", required = true)
|
|
|
|
@RequestParam(value = "endDate") Date endDate) {
|
|
|
|
try {
|
|
|
|
return crawlerFlowManager.dataCrawler(beginDate, endDate);
|
|
|
|
} catch (Exception e) {
|
|
|
|
return Result.error("采集上传失败");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 保存任务编排数据
|
|
* 保存任务编排数据
|
|
*/
|
|
*/
|