package com.lantone.qc.trans.taizhou;

import com.google.common.collect.Lists;
import com.lantone.qc.pub.model.doc.DeathRecordDoc;
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:23
 */
public class TaiZhouDeathRecordDocTrans extends ModelDocTrans {

    @Override
    public DeathRecordDoc 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);

        DeathRecordDoc deathRecordDoc = new DeathRecordDoc();
        deathRecordDoc.setStructureMap(structureMap);
        deathRecordDoc.setPageData((Map)sourceMap);
        return deathRecordDoc;
    }

    private List<String> keyContrasts = Lists.newArrayList(
            "入院诊断=",
            "审核人=",
            "事件日期=",
            "医生=",
            "专科检查=",
            "事件基本信息=",
            "血压=",
            "年龄=",
            "影像学检查=",
            "主诉=",
            "当前诊断=死亡诊断",
            "床号=",
            "病人基本信息=",
            "实验室检查=",
            "就诊次数=",
            "死亡原因=",
            "审核日期=",
            "入院情况=",
            "死亡日期=死亡时间",
            "辅助检查结果=",
            "性别=",
            "本人姓名=",
            "病历号=",
            "初步诊断=入院诊断",
            "病历日期=",
            "现病史-发病情况=",
            "呼吸=",
            "入院日期=",
            "脉搏=",
            "临床科室=",
            "诊治经过=诊疗经过",
            "病历状态=",
            "审核=",
            "体温(耳)=",
            "入院病情="
    );

}