package com.lantone.qc.trans.shaoyf.util;

import com.lantone.qc.pub.util.StringUtil;
import org.apache.commons.collections.MapUtils;

import java.util.Map;

/**
 * @Description:
 * @author: rengb
 * @time: 2020/4/2 14:04
 */
public class ShaoyfOrdinaryAssistant {

    /**
     * 医生签名中，包含职称A/R/F...时，去掉
     *
     * @param structureMap
     * @param key
     */
    public static void techTitleDocRemove(Map<String, String> structureMap, String key) {
        if (MapUtils.isEmpty(structureMap) || StringUtil.isBlank(key)) {
            return;
        }
        String value = structureMap.get(key);
        if (StringUtil.isBlank(value) || value.length() == 1) {
            return;
        }
        if (value.endsWith("A") || value.endsWith("F") || value.endsWith("R")
                || value.endsWith("Y") || value.endsWith("I") || value.endsWith("J")
                || value.endsWith("L") || value.endsWith("b")) {
            structureMap.put(key, value.substring(0, value.length() - 1));
            structureMap.put(key+"个人职称",value.substring(value.length() - 1));
        }
    }

}