|
@@ -14,6 +14,8 @@ import com.lantone.qc.trans.beilun.util.BeiLunHtmlAnalysis;
|
|
|
import com.lantone.qc.trans.beilun.util.BeiLunTransferIntoHtmlAnalysis;
|
|
|
import com.lantone.qc.trans.beilun.util.BeiLunTransferOutHtmlAnalysis;
|
|
|
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
@@ -28,6 +30,7 @@ import java.util.TreeMap;
|
|
|
* @author: rengb
|
|
|
* @time: 2020/3/20 16:10
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
|
|
|
@Override
|
|
@@ -135,11 +138,17 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- transferRecordName = index + "";
|
|
|
- TransferIntoDoc transferIntoDoc = getTransferIntoDoc(contentMap);
|
|
|
- transferIntoDoc.setTransferRecordName(transferRecordName);
|
|
|
- retMap.put(transferRecordName, transferIntoDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ TransferIntoDoc transferIntoDoc = getTransferIntoDoc(contentMap);
|
|
|
+ if (transferIntoDoc != null) {
|
|
|
+ transferRecordName = index + "";
|
|
|
+ transferIntoDoc.setTransferRecordName(transferRecordName);
|
|
|
+ retMap.put(transferRecordName, transferIntoDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
@@ -154,17 +163,23 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunTransferIntoHtmlAnalysis();
|
|
|
Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
- structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
- structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ TransferIntoDoc transferIntoDoc = new TransferIntoDoc();
|
|
|
+ transferIntoDoc.setStructureMap(structureMap);
|
|
|
+ transferIntoDoc.setPageData((Map) structureMap);
|
|
|
+ return transferIntoDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
}
|
|
|
-
|
|
|
- TransferIntoDoc transferIntoDoc = new TransferIntoDoc();
|
|
|
- transferIntoDoc.setStructureMap(structureMap);
|
|
|
- transferIntoDoc.setPageData((Map) structureMap);
|
|
|
- return transferIntoDoc;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**************************************************全部*******************************************************/
|
|
|
private Map<String, TransferRecordDoc> getTransferAllDocMap(List<Map<String, Object>> contentMaps) {
|
|
|
Map<String, TransferRecordDoc> retMap = Maps.newHashMap();
|
|
@@ -177,11 +192,17 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- transferRecordName = index + "";
|
|
|
- TransferRecordDoc transferRecordDoc = getTransferAllDoc(contentMap);
|
|
|
- transferRecordDoc.setTransferRecordName(transferRecordName);
|
|
|
- retMap.put(transferRecordName, transferRecordDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ TransferRecordDoc transferRecordDoc = getTransferAllDoc(contentMap);
|
|
|
+ if (transferRecordDoc != null) {
|
|
|
+ transferRecordName = index + "";
|
|
|
+ transferRecordDoc.setTransferRecordName(transferRecordName);
|
|
|
+ retMap.put(transferRecordName, transferRecordDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
@@ -196,15 +217,20 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunTransferOutHtmlAnalysis();
|
|
|
Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
- structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
- structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ TransferRecordDoc transferAllDoc = new TransferRecordDoc();
|
|
|
+ transferAllDoc.setStructureMap(structureMap);
|
|
|
+ transferAllDoc.setPageData((Map) structureMap);
|
|
|
+ return transferAllDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
}
|
|
|
-
|
|
|
- TransferRecordDoc transferAllDoc = new TransferRecordDoc();
|
|
|
- transferAllDoc.setStructureMap(structureMap);
|
|
|
- transferAllDoc.setPageData((Map) structureMap);
|
|
|
- return transferAllDoc;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -220,11 +246,17 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
if (contentMap.get("xmlText") == null || StringUtil.isBlank(contentMap.get("xmlText").toString())) {
|
|
|
continue;
|
|
|
}
|
|
|
- transferRecordName = index + "";
|
|
|
- TransferOutDoc transferOutDoc = getTransferOutDoc(contentMap);
|
|
|
- transferOutDoc.setTransferRecordName(transferRecordName);
|
|
|
- retMap.put(transferRecordName, transferOutDoc);
|
|
|
- index++;
|
|
|
+ try {
|
|
|
+ TransferOutDoc transferOutDoc = getTransferOutDoc(contentMap);
|
|
|
+ if (transferOutDoc != null) {
|
|
|
+ transferRecordName = index + "";
|
|
|
+ transferOutDoc.setTransferRecordName(transferRecordName);
|
|
|
+ retMap.put(transferRecordName, transferOutDoc);
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
return retMap;
|
|
|
}
|
|
@@ -239,15 +271,20 @@ public class BeiLunTransferRecordDocTrans extends ModelDocTrans {
|
|
|
String recTypeId = contentMap.get("recTypeId").toString();
|
|
|
BeiLunHtmlAnalysis beiLunHtmlAnalysis = new BeiLunTransferOutHtmlAnalysis();
|
|
|
Map<String, String> sourceMap = beiLunHtmlAnalysis.analysis(content, recTitle, recTypeId);
|
|
|
- structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
- structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
- structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ if (MapUtils.isNotEmpty(sourceMap)) {
|
|
|
+ structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
|
|
|
+ structureMap.put("记录编号", contentMap.get("recId").toString());
|
|
|
+ structureMap.put("病历号", contentMap.get("behospitalCode") == null ? null : contentMap.get("behospitalCode").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ TransferOutDoc transferOutDoc = new TransferOutDoc();
|
|
|
+ transferOutDoc.setStructureMap(structureMap);
|
|
|
+ transferOutDoc.setPageData((Map) structureMap);
|
|
|
+ return transferOutDoc;
|
|
|
+ } else {
|
|
|
+ return null;
|
|
|
}
|
|
|
-
|
|
|
- TransferOutDoc transferOutDoc = new TransferOutDoc();
|
|
|
- transferOutDoc.setStructureMap(structureMap);
|
|
|
- transferOutDoc.setPageData((Map) structureMap);
|
|
|
- return transferOutDoc;
|
|
|
}
|
|
|
|
|
|
private List<String> keyContrasts = Lists.newArrayList(
|