package com.lantone.qc.trans.taizhou;

import com.google.common.collect.Lists;
import com.lantone.qc.pub.model.doc.DeathCaseDiscussDoc;
import com.lantone.qc.pub.model.vo.MedrecVo;
import com.lantone.qc.trans.ModelDocTrans;
import com.lantone.qc.trans.comsis.OrdinaryAssistant;
import com.lantone.qc.trans.taizhou.util.TzXmlUtil;

import java.util.List;
import java.util.Map;

/**
 * @Description: 死亡病例讨论记录文档生成
 * @author: rengb
 * @time: 2020/3/17 13:22
 */
public class TaiZhouDeathCaseDiscussDocTrans extends ModelDocTrans {

    @Override
    public DeathCaseDiscussDoc extract(MedrecVo medrecVo) {
        String content = ((List<String>) medrecVo.getContent().get("content")).get(0);
        Map<String, String> sourceMap = TzXmlUtil.getXmlToMapForTZ(content);
        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(TzXmlUtil.getXmlToMapForTZ(content), keyContrasts);

        DeathCaseDiscussDoc deathCaseDiscussDoc = new DeathCaseDiscussDoc();
        deathCaseDiscussDoc.setStructureMap(structureMap);
        deathCaseDiscussDoc.setPageData((Map)sourceMap);
        return deathCaseDiscussDoc;
    }

    private List<String> keyContrasts = Lists.newArrayList(
            "审核人=",
            "讨论地点=",
            "事件日期=",
            "医生=",
            "专科检查=",
            "参加人员及职称=",
            "参加人员及职称（医生）=",
            "简要病情=",
            "事件基本信息=",
            "职务=",
            "血压=",
            "影像学检查=",
            "年龄=",
            "讨论小结=",
            "主诉=",
            "主持人=讨论主持人",
            "当前诊断=",
            "床号=",
            "实验室检查=",
            "病人基本信息=",
            "死亡原因=",
            "审核日期=",
            "记录人=",
            "死亡日期=死亡时间",
            "性别=",
            "辅助检查结果=",
            "讨论意见=讨论内容",
            "本人姓名=",
            "病历号=",
            "病历日期=",
            "职称=",
            "现病史-发病情况=入院情况",
            "脉搏=",
            "呼吸=",
            "入院日期=",
            "临床科室=",
            "审核=",
            "病历状态=",
            "体温(耳)="
    );

}