package com.lantone.qc.trans.taizhou;

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

    @Override
    public LeaveHospitalDoc extract(MedrecVo medrecVo) {
        String content = ((List<String>) medrecVo.getContent().get("content")).get(0);

        Map<String, String> sourceMap = TzXmlUtil.getXmlToMapForTZWithReplace(content); // xml原始数据给华卓
        Map<String, String> structureMap = OrdinaryAssistant.mapKeyContrast(sourceMap, keyContrasts);
        LeaveHospitalDoc leaveHospitalDoc = new LeaveHospitalDoc();
        leaveHospitalDoc.setStructureMap(structureMap);
        leaveHospitalDoc.setPageData((Map)sourceMap);
        return leaveHospitalDoc;
    }

    private List<String> keyContrasts = Lists.newArrayList(
            "本人姓名=姓名",
            "性别=性别",
            "年龄=年龄",
            "床号=床号",
            "入院日期=入院时间",
            "出院时间=出院时间",
            "入院诊断=入院诊断",
            "出院诊断=出院诊断",
            "实际住院天数=住院天数",
            "入院情况=入院情况",
            "诊治经过=诊治经过",
            "出院时情况=出院情况",
            "出院医嘱=出院医嘱",
//            "注意事项=健康教育",
            "复诊时间=随访计划",
            "出院指导=健康教育",
            "医生=医师签名",
            "病历日期=签名时间"
            );

}