فهرست منبع

恩泽:一般手术记录增加逻辑

wangsy 4 سال پیش
والد
کامیت
74a77954d8

+ 4 - 3
structure-center/src/main/java/com/lantone/structure/ai/OperationAI.java

@@ -36,7 +36,7 @@ public class OperationAI extends ModelAI {
     /**
      *
      */
-    public static List<String> medicalTextType = Arrays.asList("CourseAfterOperation_cx", "CourseRecordSRR", "Taizhou_before_surgery");
+    public static List<String> medicalTextType = Arrays.asList("CourseAfterOperation_cx", "CourseRecordSRR", "Taizhou_before_surgery", "Taizhou_operation");
     public static String entityRelationObject = "entity_relation_object";
     public static String outputs = "outputs";
     public static String content = "content";
@@ -93,8 +93,9 @@ public class OperationAI extends ModelAI {
                 putContent(crfContent, medicalTextType.get(1), content, "手术记录" + i + "药物");
 
                 /***************************** 后结构化数据处理(一般手术记录)****************************************/
-                String text = operationRecordDoc.getText();
-                putContent(crfContent, medicalTextType.get(1), text, Content.operationRecord);
+                if (operationRecordDoc.getStructureMap() != null) {
+                    putContent(crfContent, medicalTextType.get(3), operationRecordDoc.getStructureMap().get("手术过程描述"), Content.operationRecord);
+                }
             }
             if (operationDocs.get(i).getOperationDiscussionDoc() != null) {
                 OperationDiscussionDoc operationDiscussionDoc = operationDocs.get(i).getOperationDiscussionDoc();

+ 9 - 11
structure-center/src/main/java/com/lantone/structure/ai/process/EntityOperationRecord.java

@@ -20,9 +20,6 @@ public class EntityOperationRecord extends EntityProcess {
     public OperationRecordLabel extractEntity(JSONObject aiOut) {
         OperationRecordLabel operationRecordLabel = new OperationRecordLabel();
         try {
-            //手术目标部位名称
-            operationRecordLabel.setOpBottomName(findFirstT(createEntityTree(aiOut, "手术目标部位名称"), new String()));
-
             //介入物名称
             List<Lemma> interventionLemma = createEntityTree(aiOut, "介入物名称");
             List<Intervention> interventionList = new ArrayList<>();
@@ -37,22 +34,23 @@ public class EntityOperationRecord extends EntityProcess {
             operationRecordLabel.setSkinSterilize(findFirstT(createEntityTree(aiOut, "皮肤消毒描述"), new SkinSterilize()));
 
             //手术切口描述
-            operationRecordLabel.setOperationIncision(findFirstT(createEntityTree(aiOut, "手术切口描述"), new OperationIncision()));
-
-            //出血量(mL)
-            operationRecordLabel.setBleedQuantity(findFirstT(createEntityTree(aiOut, "出血量"), new BleedQuantity()));
+            List<Lemma> operationIncisionLemma = createEntityTree(aiOut, "手术切口描述");
+            List<OperationIncision> operationIncisionList = new ArrayList<>();
+            for (Lemma lemma : operationIncisionLemma) {
+                OperationIncision operationIncision = new OperationIncision();
+                operationIncision.setName(lemma.getText());
+                operationIncisionList.add(operationIncision);
+            }
+            operationRecordLabel.setOperationIncision(operationIncisionList);
 
             //输液量(mL)
             operationRecordLabel.setTransfuseQuantity(findFirstT(createEntityTree(aiOut, "输液量"), new TransfuseQuantity()));
 
-            //输血量(mL)
-            operationRecordLabel.setBloodQuantity(findFirstT(createEntityTree(aiOut, "输血量"), new BloodQuantity()));
-
             //术前用药
             operationRecordLabel.setPreoperativeDrugs(findFirstT(createEntityTree(aiOut, "术前用药"), new PreoperativeDrugs()));
 
             //术中用药
-            operationRecordLabel.setDuringDrugs(findFirstT(createEntityTree(aiOut, "术中用药"), new DuringDrugs()));
+            operationRecordLabel.setDuringDrugs(findFirstT(createEntityTree(aiOut, "药物名称"), new DuringDrugs()));
 
             //引流材料名称
             operationRecordLabel.setDrainageMaterialsName(findFirstT(createEntityTree(aiOut, "引流材料名称"), new DrainageMaterialsName()));

+ 19 - 20
structure-center/src/main/java/com/lantone/structure/facade/tran/OperationRecordDocTran.java

@@ -8,6 +8,7 @@ import com.lantone.structure.facade.tran.util.CommonAnalysisUtil;
 import com.lantone.structure.model.doc.operation.OperationDoc;
 import com.lantone.structure.model.doc.operation.OperationRecordDoc;
 import com.lantone.structure.model.entity.Intervention;
+import com.lantone.structure.model.entity.OperationIncision;
 import com.lantone.structure.model.label.OperationRecordLabel;
 import com.lantone.structure.util.MapUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -33,14 +34,15 @@ public class OperationRecordDocTran extends TargetTran {
         OperationDoc operationDoc = new OperationDoc();
         OperationRecordDoc operationRecordDoc = new OperationRecordDoc();
         operationRecordDoc.setText(text);
+        Map<String, String> structureMap = cutWord(text);
+        Map<String, String> retMap = new HashMap<String, String>();
+        CommonAnalysisUtil.mapKeyContrastCommon(structureMap, keyContrasts, retMap);
+        operationRecordDoc.setStructureMap(retMap);
         operationDoc.setOperationRecordDoc(operationRecordDoc);
         operationDocs.add(operationDoc);
         inputInfo.setOperationDocs(operationDocs);
-//        aiProcess();
 
-        Map<String, String> structureMap = cutWord(text);
-        Map<String, String> retMap = new HashMap<String, String>();
-        CommonAnalysisUtil.mapKeyContrastCommon(structureMap, keyContrasts, retMap);
+        aiProcess();
         fetchModelData(inputInfo.getOperationDocs(), retMap);
         retMap.entrySet().removeIf(entry -> StringUtil.isBlank(entry.getValue()));
         retMap.entrySet().removeIf(entry -> !entry.getValue().matches("[\\d]+年[\\d]+月[\\d]+日[\\d]+时[\\d]+分") && "医师签名日期时间".equals(entry.getKey()));
@@ -52,15 +54,13 @@ public class OperationRecordDocTran extends TargetTran {
             OperationRecordDoc operationRecordDoc = operationDoc.getOperationRecordDoc();
             if (operationRecordDoc != null) {
                 int interventionCount = 1;
+                int operationIncisionCount = 1;
                 StringBuffer interventionString = new StringBuffer();
+                StringBuffer operationIncisionString = new StringBuffer();
                 OperationRecordLabel operationRecordLabel = operationRecordDoc.getOperationRecordLabel();
                 if (operationRecordLabel == null) {
                     return;
                 }
-                //手术目标部位名称
-                if (StringUtil.isNotBlank(operationRecordLabel.getOpBottomName())) {
-                    retMap.put("手术目标部位名称", operationRecordLabel.getOpBottomName());
-                }
 
                 //介入物名称
                 if (ListUtil.isNotEmpty(operationRecordLabel.getInterventions())) {
@@ -82,13 +82,17 @@ public class OperationRecordDocTran extends TargetTran {
                 }
 
                 //手术切口描述
-                if (operationRecordLabel.getOperationIncision() != null && StringUtils.isNotEmpty(operationRecordLabel.getOperationIncision().getName())) {
-                    retMap.put("手术切口描述", operationRecordLabel.getOperationIncision().getName());
-                }
+                if (ListUtil.isNotEmpty(operationRecordLabel.getOperationIncision())) {
+                    for (OperationIncision operationIncisions : operationRecordLabel.getOperationIncision()) {
+                        if (StringUtils.isNotEmpty(operationIncisions.getName())) {
+                            if (operationRecordLabel.getOperationIncision().size() > 1) {
+                                operationIncisionString.append((operationIncisionCount++) + ".");
+                            }
+                            operationIncisionString.append(operationIncisions.getName());
+                        }
 
-                //出血量(mL)
-                if (operationRecordLabel.getBleedQuantity() != null && StringUtils.isNotEmpty(operationRecordLabel.getBleedQuantity().getName())) {
-                    retMap.put("出血量(mL)", operationRecordLabel.getBleedQuantity().getName());
+                    }
+                    retMap.put("手术切口描述", operationIncisionString.toString());
                 }
 
                 //输液量(mL)
@@ -96,11 +100,6 @@ public class OperationRecordDocTran extends TargetTran {
                     retMap.put("输液量(mL)", operationRecordLabel.getTransfuseQuantity().getName());
                 }
 
-                //输血量(mL)
-                if (operationRecordLabel.getBloodQuantity() != null && StringUtils.isNotEmpty(operationRecordLabel.getBloodQuantity().getName())) {
-                    retMap.put("输血量(mL)", operationRecordLabel.getBloodQuantity().getName());
-                }
-
                 //术前用药
                 if (operationRecordLabel.getPreoperativeDrugs() != null && StringUtils.isNotEmpty(operationRecordLabel.getPreoperativeDrugs().getName())) {
                     retMap.put("术前用药", operationRecordLabel.getPreoperativeDrugs().getName());
@@ -132,7 +131,7 @@ public class OperationRecordDocTran extends TargetTran {
     private Map<String, String> cutWord(String text) {
         Map<String, String> sourceMap = Maps.newHashMap();
         text = text.replace("年  月  日  时  分", "").replace("第1次手术", "")
-                .replace("(包括体位、切口处理经过,病理标本肉眼所见) ", "");
+                .replace("(包括体位、切口处理经过,病理标本肉眼所见)", "");
         List<String> titles = CommonAnalysisUtil.sortTitles(
                 Lists.newArrayList("手术开始时间", "手术结束时间", "术前诊断", "手术名称", "术中诊断", "手 术 者", "手术人员", "助手",
                         "麻醉方法", "麻醉方式", "麻 醉 者", "麻醉医师", "手术标本", "手术切除标本", "术中并发症", "术中失血量", "术中输血量", "手术简要经过(包括“术中所见”)",

+ 1 - 4
structure-center/src/main/java/com/lantone/structure/model/label/OperationRecordLabel.java

@@ -17,13 +17,10 @@ import java.util.List;
 @Setter
 public class OperationRecordLabel {
     private List<Drug> drugs = new ArrayList<>();                           //药物
-    private String opBottomName;                                            //手术目标部位名称
     private List<Intervention> interventions = new ArrayList<>();           //介入物名称
     private SkinSterilize skinSterilize;                                    //皮肤消毒描述
-    private OperationIncision operationIncision;                            //手术切口描述
-    private BleedQuantity bleedQuantity;                                    //出血量(mL)
+    private List<OperationIncision> operationIncision = new ArrayList<>();; //手术切口描述
     private TransfuseQuantity transfuseQuantity;                            //输液量(mL)
-    private BloodQuantity bloodQuantity;                                    //输血量(mL)
     private PreoperativeDrugs preoperativeDrugs;                            //术前用药
     private DuringDrugs duringDrugs;                                        //术中用药
     private DrainageMaterialsName drainageMaterialsName;                    //引流材料名称