|
@@ -6,12 +6,12 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lantone.qc.kernel.catalogue.QCCatalogue;
|
|
|
import com.lantone.qc.kernel.client.CRFServiceClient;
|
|
|
import com.lantone.qc.kernel.structure.ai.model.CrfOut;
|
|
|
-import com.lantone.qc.kernel.structure.ai.process.EntityProcess;
|
|
|
-import com.lantone.qc.kernel.structure.ai.process.EntityProcessSymptom;
|
|
|
+import com.lantone.qc.kernel.structure.ai.process.*;
|
|
|
import com.lantone.qc.pub.Content;
|
|
|
import com.lantone.qc.pub.model.InputInfo;
|
|
|
import com.lantone.qc.pub.model.doc.BeHospitalizedDoc;
|
|
|
import com.lantone.qc.pub.model.entity.Annotation;
|
|
|
+import com.lantone.qc.pub.model.entity.Lis;
|
|
|
import com.lantone.qc.pub.model.vo.CRFVo;
|
|
|
import com.lantone.qc.pub.util.StringUtil;
|
|
|
|
|
@@ -36,7 +36,9 @@ public class BeHospitalizedAI extends QCCatalogue {
|
|
|
"GeneralVital_cx", "chief_present");
|
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
|
public static String outputs = "outputs";
|
|
|
- public void medrec(InputInfo inputInfo,CRFServiceClient crfServiceClient){
|
|
|
+
|
|
|
+ public Map<String,List<CrfOut>> medrec(InputInfo inputInfo,CRFServiceClient crfServiceClient){
|
|
|
+
|
|
|
Map<String,List<CrfOut>> crfOut = new HashMap<>();//主诉-->
|
|
|
JSONArray crfContent = new JSONArray();
|
|
|
BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
@@ -72,21 +74,27 @@ public class BeHospitalizedAI extends QCCatalogue {
|
|
|
//获取CRF模型返回数据
|
|
|
JSONArray data = getAnnotation(crfServiceClient, crfVo).getData();
|
|
|
JSONObject midData = getOutputs(data);
|
|
|
- putAllCrfData(midData.getJSONObject(Content.chief),crfOut,Content.chief);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ //处理主诉
|
|
|
+ putAllCrfData(midData.getJSONObject(Content.chief),crfOut);
|
|
|
+ return crfOut;
|
|
|
}
|
|
|
- public void putAllCrfData(JSONObject jsonObject,Map<String,List<CrfOut>> crfOut,String sign){
|
|
|
+
|
|
|
+ public void putAllCrfData(JSONObject jsonObject,Map<String,List<CrfOut>> crfOut){
|
|
|
if (jsonObject == null) {
|
|
|
return;
|
|
|
}
|
|
|
- Map<String,List<CrfOut>> detailOutput = new HashMap<>();
|
|
|
JSONObject outputs = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
- List<CrfOut> outputInfos = new ArrayList<>();
|
|
|
+ List<CrfOut> medOut = new ArrayList<>();
|
|
|
CrfOut outputInfo = new CrfOut();
|
|
|
- add2Output(new EntityProcessSymptom(), outputs, outputInfo);
|
|
|
+ add2Output(new EntityProcessSymptom(), outputs, outputInfo);//临床表现
|
|
|
+ add2Output(new EntityProcessGenerals(), outputs, outputInfo);//一般情况描述
|
|
|
+ add2Output(new EntityProcessVital(), outputs, outputInfo);//体征
|
|
|
+ add2Output(new EntityProcessLis(), outputs, outputInfo);//化验
|
|
|
+ add2Output(new EntityProcessPacs(), outputs, outputInfo);//辅检
|
|
|
+
|
|
|
|
|
|
+ medOut.add(outputInfo);
|
|
|
+ crfOut.put(jsonObject.getString("detail_title"),medOut);
|
|
|
}
|
|
|
public void add2Output(EntityProcess entityProcess, JSONObject outputs, CrfOut outputInfo){
|
|
|
entityProcess.extractEntity(outputs, outputInfo);
|