|
@@ -0,0 +1,65 @@
|
|
|
|
+package com.lantone.qc.trans.changx;
|
|
|
|
+
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import com.lantone.qc.pub.model.doc.transferrecord.TransferIntoDoc;
|
|
|
|
+import com.lantone.qc.pub.model.doc.transferrecord.TransferOutDoc;
|
|
|
|
+import com.lantone.qc.pub.model.doc.transferrecord.TransferRecordDoc;
|
|
|
|
+import com.lantone.qc.pub.model.keys.ModelStandardKeys;
|
|
|
|
+import com.lantone.qc.pub.model.vo.MedrecVo;
|
|
|
|
+import com.lantone.qc.pub.util.ListUtil;
|
|
|
|
+import com.lantone.qc.trans.ModelDocTrans;
|
|
|
|
+import com.lantone.qc.trans.comsis.ModelDocGenerate;
|
|
|
|
+import com.lantone.qc.trans.comsis.Preproc;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description: 转科记录文档生成
|
|
|
|
+ * @author: rengb
|
|
|
|
+ * @time: 2020/3/20 16:10
|
|
|
|
+ */
|
|
|
|
+public class ChangxTransferRecordDocTrans extends ModelDocTrans {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<TransferRecordDoc> extract(MedrecVo medrecVo) {
|
|
|
|
+ List<TransferRecordDoc> retList = Lists.newArrayList();
|
|
|
|
+ Map<String, Object> content = medrecVo.getContent();
|
|
|
|
+ Map<String, List<String>> labelMap = (Map) content.get("label");
|
|
|
|
+ List<String> transferIntoLabel = labelMap.get("转入");
|
|
|
|
+ List<String> transferOutLabel = labelMap.get("转出");
|
|
|
|
+ List<Map<String, String>> transferRecords = (List) content.get("content");
|
|
|
|
+
|
|
|
|
+ String transferIntoContent, transferOutContent;
|
|
|
|
+ Map<String, String> transferIntoStructureMap, transferOutStructureMap;
|
|
|
|
+ for (Map<String, String> transferRecord : transferRecords) {
|
|
|
|
+ TransferRecordDoc transferRecordDoc = new TransferRecordDoc();
|
|
|
|
+
|
|
|
|
+ transferIntoContent = transferRecord.get("转入");
|
|
|
|
+ transferIntoStructureMap =
|
|
|
|
+ Preproc.extract_doc_pub(
|
|
|
|
+ false,
|
|
|
|
+ ListUtil.isEmpty(transferIntoLabel) ? ModelStandardKeys.transferInto : transferIntoLabel,
|
|
|
|
+ transferIntoContent
|
|
|
|
+ );
|
|
|
|
+ TransferIntoDoc transferIntoDoc = ModelDocGenerate.transferIntoDocGen(transferIntoStructureMap);
|
|
|
|
+ transferIntoDoc.setText(transferIntoContent);
|
|
|
|
+ transferRecordDoc.setTransferIntoDoc(transferIntoDoc);
|
|
|
|
+
|
|
|
|
+ transferOutContent = transferRecord.get("转出");
|
|
|
|
+ transferOutStructureMap =
|
|
|
|
+ Preproc.extract_doc_pub(
|
|
|
|
+ false,
|
|
|
|
+ ListUtil.isEmpty(transferOutLabel) ? ModelStandardKeys.transferOut : transferOutLabel,
|
|
|
|
+ transferOutContent
|
|
|
|
+ );
|
|
|
|
+ TransferOutDoc transferOutDoc = ModelDocGenerate.transferOutDocGen(transferOutStructureMap);
|
|
|
|
+ transferOutDoc.setText(transferOutContent);
|
|
|
|
+ transferRecordDoc.setTransferOutDoc(transferOutDoc);
|
|
|
|
+
|
|
|
|
+ retList.add(transferRecordDoc);
|
|
|
|
+ }
|
|
|
|
+ return retList;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|