|
@@ -1,23 +1,61 @@
|
|
|
package com.lantone.qc.trans.taizhou;
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
import com.lantone.qc.pub.model.doc.InformedConsentDoc;
|
|
|
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 lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.collections.MapUtils;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @Description: 知情同意书
|
|
|
* @author: wangyu
|
|
|
* @time: 2020/4/20 17:48
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
public class TaizhouInformedConsentDocTrans extends ModelDocTrans {
|
|
|
@Override
|
|
|
public List<InformedConsentDoc> extract(MedrecVo medrecVo) {
|
|
|
- List<InformedConsentDoc> retList = new ArrayList<>();
|
|
|
- InformedConsentDoc informedConsentDoc = new InformedConsentDoc();
|
|
|
- retList.add(informedConsentDoc);
|
|
|
+ List<InformedConsentDoc> retList = Lists.newArrayList();
|
|
|
+ Map<String, List<String>> contentMap = (Map) medrecVo.getContent().get("content");
|
|
|
+ if (contentMap == null) {
|
|
|
+ return retList;
|
|
|
+ }
|
|
|
+ for (Map.Entry<String, List<String>> entry : contentMap.entrySet()) {
|
|
|
+ InformedConsentDoc informedConsentDoc = getInformedConsentDoc((List) entry.getValue());
|
|
|
+ retList.add(informedConsentDoc);
|
|
|
+ }
|
|
|
return retList;
|
|
|
}
|
|
|
+
|
|
|
+ private InformedConsentDoc getInformedConsentDoc(List<Map<String, Object>> contentMaps) {
|
|
|
+ InformedConsentDoc informedConsentDoc = new InformedConsentDoc();
|
|
|
+ if (ListUtil.isEmpty(contentMaps)) {
|
|
|
+ return informedConsentDoc;
|
|
|
+ }
|
|
|
+ for (Map<String, Object> contentMap : contentMaps) {
|
|
|
+ try {
|
|
|
+ Map<String, String> structureMap = new HashMap<>();
|
|
|
+ Object recTitle1 = contentMap.get("recTitle");
|
|
|
+ if (recTitle1 == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String recTitle = contentMap.get("recTitle").toString();
|
|
|
+ structureMap.put("标题", recTitle);
|
|
|
+ if (MapUtils.isNotEmpty(structureMap)) {
|
|
|
+ informedConsentDoc = ModelDocGenerate.informedConsentDocGen(structureMap);
|
|
|
+ informedConsentDoc.setPageData((Map) structureMap);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return informedConsentDoc;
|
|
|
+ }
|
|
|
}
|