|
@@ -2,6 +2,7 @@ package com.lantone.structure.ai;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.lantone.structure.ai.process.*;
|
|
import com.lantone.structure.client.CRFServiceClient;
|
|
import com.lantone.structure.client.CRFServiceClient;
|
|
import com.lantone.structure.ai.process.EntityProcessClinic;
|
|
import com.lantone.structure.ai.process.EntityProcessClinic;
|
|
import com.lantone.structure.ai.process.EntityProcessDiag;
|
|
import com.lantone.structure.ai.process.EntityProcessDiag;
|
|
@@ -20,21 +21,14 @@ import com.lantone.structure.model.entity.Diag;
|
|
import com.lantone.structure.model.entity.Lis;
|
|
import com.lantone.structure.model.entity.Lis;
|
|
import com.lantone.structure.model.entity.Pacs;
|
|
import com.lantone.structure.model.entity.Pacs;
|
|
import com.lantone.structure.model.entity.Vital;
|
|
import com.lantone.structure.model.entity.Vital;
|
|
-import com.lantone.structure.model.label.ChiefLabel;
|
|
|
|
-import com.lantone.structure.model.label.DiagLabel;
|
|
|
|
-import com.lantone.structure.model.label.FamilyLabel;
|
|
|
|
-import com.lantone.structure.model.label.MaritalLabel;
|
|
|
|
-import com.lantone.structure.model.label.MenstrualLabel;
|
|
|
|
-import com.lantone.structure.model.label.PacsLabel;
|
|
|
|
-import com.lantone.structure.model.label.PastLabel;
|
|
|
|
-import com.lantone.structure.model.label.PersonalLabel;
|
|
|
|
-import com.lantone.structure.model.label.PresentLabel;
|
|
|
|
|
|
+import com.lantone.structure.model.label.*;
|
|
import com.lantone.common.util.FastJsonUtils;
|
|
import com.lantone.common.util.FastJsonUtils;
|
|
import com.lantone.common.util.StringUtil;
|
|
import com.lantone.common.util.StringUtil;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @ClassName : InHospitalDoc
|
|
* @ClassName : InHospitalDoc
|
|
@@ -56,7 +50,7 @@ public class BeHospitalizedAI extends ModelAI {
|
|
* DiagnoseInAssistant[辅助检查]
|
|
* DiagnoseInAssistant[辅助检查]
|
|
*/
|
|
*/
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
|
|
public static List<String> medicalTextType = Arrays.asList("FirstCourseRecord_cx", "PastFamily_cx", "PersonalHistory_cx", "HPIForCX_cx",
|
|
- "GeneralVital_cx", "chief_present", "Diagnoses_cx", "Present_cx", "DiagnoseInAssistant");
|
|
|
|
|
|
+ "GeneralVital_cx", "chief_present", "Diagnoses_cx", "Present_cx", "DiagnoseInAssistant","Taizhou_past_family");
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String entityRelationObject = "entity_relation_object";
|
|
public static String outputs = "outputs";
|
|
public static String outputs = "outputs";
|
|
|
|
|
|
@@ -64,6 +58,16 @@ public class BeHospitalizedAI extends ModelAI {
|
|
JSONArray crfContent = new JSONArray();
|
|
JSONArray crfContent = new JSONArray();
|
|
BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
BeHospitalizedDoc beHospitalizedDoc = inputInfo.getBeHospitalizedDoc();
|
|
if (beHospitalizedDoc != null) {
|
|
if (beHospitalizedDoc != null) {
|
|
|
|
+ Map<String, String> structureMap = beHospitalizedDoc.getStructureMap();
|
|
|
|
+ // String text = beHospitalizedDoc.getText();
|
|
|
|
+ if (StringUtil.isNotEmpty(structureMap.get("既往史"))) {
|
|
|
|
+ String opName = "既往史:" + structureMap.get("既往史");
|
|
|
|
+ putContent(crfContent, medicalTextType.get(9), opName, Content.pastLabel);
|
|
|
|
+ }
|
|
|
|
+ if (StringUtil.isNotEmpty(structureMap.get("家族史"))) {
|
|
|
|
+ String opName = "家族史:" + structureMap.get("家族史");
|
|
|
|
+ putContent(crfContent, medicalTextType.get(9), opName, Content.familyLabel);
|
|
|
|
+ }
|
|
/* 主诉 */
|
|
/* 主诉 */
|
|
if (beHospitalizedDoc.getChiefLabel() != null && beHospitalizedDoc.getChiefLabel().isCrfLabel()) {
|
|
if (beHospitalizedDoc.getChiefLabel() != null && beHospitalizedDoc.getChiefLabel().isCrfLabel()) {
|
|
String chiefText = beHospitalizedDoc.getChiefLabel().getText();
|
|
String chiefText = beHospitalizedDoc.getChiefLabel().getText();
|
|
@@ -147,6 +151,22 @@ public class BeHospitalizedAI extends ModelAI {
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject midData = loadAI(crfContent, crfServiceClient);
|
|
JSONObject midData = loadAI(crfContent, crfServiceClient);
|
|
|
|
+ if (midData.get(Content.pastLabel) != null || midData.get(Content.familyLabel) != null){
|
|
|
|
+ BeHospitalizedDoc beHospitalizedDocs = new BeHospitalizedDoc();
|
|
|
|
+ /* 恩泽过敏史、输血史、手术史、预防接种史、疾病史(含外伤)*/
|
|
|
|
+ if (midData.get(Content.pastLabel) != null)
|
|
|
|
+ EZAllCrfData(midData.getJSONObject(Content.pastLabel), inputInfo);
|
|
|
|
+ beHospitalizedDocs = inputInfo.getBeHospitalizedDoc();
|
|
|
|
+ /* 恩泽传染病史 */
|
|
|
|
+ if (midData.get(Content.familyLabel) != null) {
|
|
|
|
+ EZAllCrfData(midData.getJSONObject(Content.familyLabel), inputInfo);
|
|
|
|
+ FamilyLabel familyLabel = inputInfo.getBeHospitalizedDoc().getFamilyLabel();
|
|
|
|
+ if(familyLabel != null){
|
|
|
|
+ beHospitalizedDocs.setFamilyLabel(familyLabel);
|
|
|
|
+ }
|
|
|
|
+ inputInfo.setBeHospitalizedDoc(beHospitalizedDocs);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
/* 处理主诉 */
|
|
/* 处理主诉 */
|
|
if (beHospitalizedDoc.getChiefLabel() != null && beHospitalizedDoc.getChiefLabel().isCrfLabel()) {
|
|
if (beHospitalizedDoc.getChiefLabel() != null && beHospitalizedDoc.getChiefLabel().isCrfLabel()) {
|
|
@@ -222,6 +242,19 @@ public class BeHospitalizedAI extends ModelAI {
|
|
System.out.println(FastJsonUtils.getBeanToJson(chiefLabel));
|
|
System.out.println(FastJsonUtils.getBeanToJson(chiefLabel));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void EZAllCrfData(JSONObject jsonObject, InputInfo inputInfo) {
|
|
|
|
+ if (jsonObject == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ JSONObject aiOut = jsonObject.getJSONObject(entityRelationObject).getJSONObject(BeHospitalizedAI.outputs);
|
|
|
|
+ if (aiOut == null) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ EntityProcessEZaAll entityProcessEZaAll = new EntityProcessEZaAll();
|
|
|
|
+ BeHospitalizedDoc beHospitalizedDoc = entityProcessEZaAll.extractEntity(aiOut);
|
|
|
|
+ inputInfo.setBeHospitalizedDoc(beHospitalizedDoc);
|
|
|
|
+ }
|
|
|
|
+
|
|
public void putPresentCrfData(JSONObject jsonObject, InputInfo inputInfo) {
|
|
public void putPresentCrfData(JSONObject jsonObject, InputInfo inputInfo) {
|
|
if (jsonObject == null) {
|
|
if (jsonObject == null) {
|
|
return;
|
|
return;
|