package com.lantone.enums.med;

import com.diagbot.core.KeyedNamed;
import lombok.Setter;

/**
 * @Description:
 * @Author:zhaops
 * @time: 2021/2/24 10:46
 */
public enum LexiconEnum implements KeyedNamed {

    Disease(100,"疾病"),
    Medicine(101,"药品通用名"),
    Form(102,"药品剂型"),
    Symptom(103,"症状"),
    Vital(104,"体格检查项目"),
    VitalResult(105,"体格检查结果"),
    Operation(106,"手术和操作"),
    LisName(107,"实验室检查套餐"),
    LisSubName(108,"实验室检查子项目"),
    PacsName(109,"辅助检查项目"),
    PacsSubName(110,"辅助检查子项目"),
    PacsDescribe(111,"辅助检查描述"),
    PacsResult(112,"辅助检查结果"),
    Transfusion(113,"输血类型"),
    Anesthesia(114,"麻醉"),
    Dept(115,"科室"),
    Gender(116,"性别"),
    Group(117,"人群"),
    Food(118,"食物"),
    Allergen(119,"其他过敏原"),
    Device(120,"医疗器械及物品"),
    AdministrationRoute(121,"给药途径"),
    Part(122,"部位"),
    Nurse(123,"护理"),
    Scale(124,"量表"),
    Unit(125,"单位"),
    Nature(126,"性质"),
    Tcmdisease(127, "中医疾病"),
    Tcmsyndrome(128, "中医证候"),
    Inducement(129, "诱因"),
    Law(130, "政策法规"),
    not(131, "否定词"),
    Physicotherapy(132, "物理治疗"),
    ICD10Class(300,"ICD10疾病类别"),
    MedChemClass(301,"药品化学物质类别"),
    MedZhiLiaoClass(302,"药品治疗学类别"),
    MedYaoLiClass(303,"药品药理学类别"),
    MedJiePouClass(304,"药品解剖学类别"),
    SymptomClass(305,"症状类别"),
    OperationClass(306,"手术和操作类别"),
    DisSysType(307,"疾病系统分类"),
    DiseaseCollection(308,"疾病集合"),
    MedicineCollection(309,"药品通用名集合"),
    FormCollection(310,"药品剂型集合"),
    SymptomCollection(311,"症状集合"),
    VitalCollection(312,"体格检查项目集合"),
    VitalResultCollection(313,"体格检查结果集合"),
    OperationCollection(314,"手术和操作集合"),
    LisNameCollection(315,"实验室检查套餐集合"),
    PacsNameCollection(316,"辅助检查项目集合"),
    PacsSubNameCollection(317,"辅助检查子项目集合"),
    PacsDescribeCollection(318,"辅助检查描述集合"),
    PacsResultCollection(319,"辅助检查结果集合"),
    AnesthesiaCollection(320,"麻醉集合"),
    DeptCollection(321,"科室集合"),
    FoodCollection(322,"食物集合"),
    AllergenCollection(323,"其他过敏原集合"),
    DeviceCollection(324,"医疗器械及物品集合"),
    PartCollection(325,"部位集合"),
    TcmdiseaseCollection(326,"中医疾病集合"),
    TcmsyndromeCollection(327,"中医证候集合"),
    InducementCollection(328,"诱因集合"),
    DugrouteCollection(329,"给药途径集合"),
    ICD10ClassNode(400,"ICD10疾病类别根节点"),
    DeptDiseaseNode(401,"科室疾病类别根节点"),
    MedChemClassNode(402,"药品化学物质类别根节点"),
    MedZhiLiaoClassNode(403,"药品治疗学类别根节点"),
    MedYaoLiClassNode(404,"药品药理学类别根节点"),
    MedJiePouClassNode(405,"药品解剖学类别根节点"),
    SymptomClassNode(406,"症状类别根节点"),
    OperationClassNode(407,"手术和操作类别根节点"),
    LisClassNode(408,"实验室检查类别根节点"),
    PacsClassNode(409,"辅助检查类别根节点"),
    Age(410,"年龄");


    @Setter
    private int key;

    @Setter
    private String name;

    LexiconEnum(int key, String name) {
        this.key = key;
        this.name = name;
    }

    public static LexiconEnum getEnum(int key) {
        for (LexiconEnum item : LexiconEnum.values()) {
            if (item.key == key) {
                return item;
            }
        }
        return null;
    }

    public static LexiconEnum getEnum(String value) {
        for (LexiconEnum item : LexiconEnum.values()) {
            if (item.getName().equals(value)) {
                return item;
            }
        }
        return null;
    }

    public static String getName(int key) {
        LexiconEnum item = getEnum(key);
        return item != null ? item.name : null;
    }

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public String getName() {
        return name;
    }
}
