package com.ruoyi.web.modules.architecture.support;

import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;

/**
 * 用药工具药物名称入参校验。
 */
public final class AppMedicationDrugNameSupport
{
    private AppMedicationDrugNameSupport()
    {
    }

    public static String requireDrugName(String drugName)
    {
        if (StringUtils.isEmpty(drugName))
        {
            throw new ServiceException("请选择药物名称");
        }
        String name = drugName.trim();
        WithdrawalPeriodStandardValidation.validateDrugName(name);
        return name;
    }
}
