|
@@ -27,15 +27,8 @@ public class ModelAI {
|
|
* @param crfServiceClient
|
|
* @param crfServiceClient
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- protected JSONObject loadAI(boolean useCrfCache, String behospitalCode, JSONArray crfContent, CRFServiceClient crfServiceClient) {
|
|
|
|
|
|
+ protected JSONObject loadAI(JSONArray crfContent, CRFServiceClient crfServiceClient) {
|
|
JSONArray data = null;
|
|
JSONArray data = null;
|
|
- /*RedisUtil redisUtil = SpringContextUtil.getBean("redisUtil");
|
|
|
|
- SpecialStorageUtil specialStorageUtil = SpringContextUtil.getBean("specialStorageUtil");
|
|
|
|
- String prex = "crf_cache:" + specialStorageUtil.getHospitalIdThreadLocal().get() + ":";
|
|
|
|
- String classname = this.getClass().getName();
|
|
|
|
- if (useCrfCache) {
|
|
|
|
- data = (JSONArray) redisUtil.hget(prex + behospitalCode, classname);
|
|
|
|
- }*/
|
|
|
|
if (data == null) {
|
|
if (data == null) {
|
|
//存储CRF完整所需结构数据
|
|
//存储CRF完整所需结构数据
|
|
CRFVo crfVo = new CRFVo();
|
|
CRFVo crfVo = new CRFVo();
|
|
@@ -43,25 +36,11 @@ public class ModelAI {
|
|
long t1 = System.currentTimeMillis();
|
|
long t1 = System.currentTimeMillis();
|
|
//获取CRF模型返回数据
|
|
//获取CRF模型返回数据
|
|
data = getAnnotation(crfServiceClient, crfVo).getData();
|
|
data = getAnnotation(crfServiceClient, crfVo).getData();
|
|
- long t2 = System.currentTimeMillis();
|
|
|
|
- /*log.error(behospitalCode + "-----" + classname + "(CRF) 耗时:" + (t2 - t1));
|
|
|
|
- if (data != null) {
|
|
|
|
- redisUtil.hset(prex + behospitalCode, classname, data, 86400);
|
|
|
|
- }*/
|
|
|
|
}
|
|
}
|
|
JSONObject midData = getOutputs(data);
|
|
JSONObject midData = getOutputs(data);
|
|
return midData;
|
|
return midData;
|
|
}
|
|
}
|
|
|
|
|
|
- protected JSONObject loadEntity(JSONObject jsonObject, String entityRelationObject, String outputs, String content) {
|
|
|
|
- if (jsonObject == null) {
|
|
|
|
- return new JSONObject();
|
|
|
|
- }
|
|
|
|
- JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(outputs);
|
|
|
|
- aiOut.put(content, jsonObject.getJSONObject(entityRelationObject).getString(content));
|
|
|
|
- return aiOut;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
private Annotation getAnnotation(CRFServiceClient crfServiceClient, CRFVo crfVo) {
|
|
private Annotation getAnnotation(CRFServiceClient crfServiceClient, CRFVo crfVo) {
|
|
Annotation annotation = new Annotation();
|
|
Annotation annotation = new Annotation();
|
|
try {
|
|
try {
|