package com.xinelu.common.enums;

import lombok.Getter;

/**
 * @Description 患者性别
 * @Author haown
 * @Date 2024-05-24
 */
@Getter
public enum PatientSexEnum {

	/**
	 * 男
	 */
	MALE("MALE", "男"),

	/**
	 * 女
	 */
	FEMALE("FEMALE", "女"),
	;
	private final String code;
	private final String info;

	PatientSexEnum(String code, String info) {
		this.code = code;
		this.info = info;
	}

	public String getCode() {
		return code;
	}

	public String getInfo() {
		return info;
	}

	public static PatientSexEnum getInfoByCode(String code) {
		for (PatientSexEnum sex : PatientSexEnum.values()) {
			if (code.equals(sex.getCode())) {
				return sex;
			}
		}
		return PatientSexEnum.MALE;
	}
}
