import {stringNotBlank} from "@/utils/blank-utils";

export const cardReportingType = [
    {code: '01', name: '初次报告'},
    {code: '02', name: '订正报告'},
    {code: '03', name: '死亡'}
]

export const thePatientBelongsTo = [
    {code: '01', name: '外省'},
    {code: '02', name: '本县区'},
    {code: '03', name: '本市其他县区'},
    {code: '04', name: '本省其他城市'},
    {code: '05', name: '港奥台'},
    {code: '06', name: '外藉'}
]

export const occupation = [
    {code: '11', name: '国家公务员'},
    {code: '13', name: '专业技术人员'},
    {code: '17', name: '职员'},
    {code: '21', name: '企业管理人员'},
    {code: '24', name: '工人'},
    {code: '27', name: '农民'},
    {code: '31', name: '学生'},
    {code: '37', name: '现役军人'},
    {code: '51', name: '自由职业者'},
    {code: '54', name: '个体经营者'},
    {code: '70', name: '无业人员'},
    {code: '80', name: '退（离）休人员'},
    {code: '90', name: '其他'},
]

export const medicalRecordClassification1 = [
    {code: '1', name: '临床诊断'},
    {code: '2', name: '实验室确诊'},
    {code: '3', name: '疑似'},
    {code: '4', name: '病原携带者'}
]

export const medicalRecordClassification2 = [
    {code: '1', name: '急性'},
    {code: '2', name: '慢性'}
]

export const classA = [
    {code: '0100', name: '鼠疫'},
    {code: '0200', name: '霍乱'}
]

export const classB = [
    {code: '2002', name: '副伤寒'},
    {code: '2001', name: '伤寒'},
    {code: '0305', name: '肝炎（未分型）'},
    {code: '0401', name: '细菌性痢疾'},
    {code: '0402', name: '阿米巴性痢疾'},
    {code: '0501', name: '伤寒'},
    {code: '0502', name: '副伤寒'},
    {code: '0600', name: '艾滋病'},
    {code: '0700', name: '淋病'},
    {code: '0801', name: '梅毒Ⅰ期'},
    {code: '0802', name: '梅毒Ⅱ期'},
    {code: '0803', name: '梅毒Ⅲ期'},
    {code: '0804', name: '梅毒胎传'},
    {code: '0805', name: '梅毒隐性'},
    {code: '0900', name: '脊髓灰质炎'},
    {code: '1000', name: '麻疹'},
    {code: '1100', name: '百日咳'},
    {code: '1200', name: '白喉'},
    {code: '1400', name: '猩红热'},
    {code: '1500', name: '流行性出血热'},
    {code: '1600', name: '狂犬病'},
    {code: '1700', name: '钩端螺旋体病'},
    {code: '1800', name: '布鲁氏菌病'},
    {code: '2100', name: '流行性乙型脑炎'},
    {code: '2301', name: '间日疟'},
    {code: '2302', name: '恶性疟'},
    {code: '2303', name: '疟疾未分型'},
    {code: '2400', name: '登革热'},
    {code: '2500', name: '新生儿破伤风'},
    {code: '2603', name: '肺结核未痰检'},
    {code: '2604', name: '肺结核仅培阳'},
    {code: '3100', name: '血吸虫病'},
    {code: '5100', name: '不明原因肺炎'},
    {code: '2702', name: '传染性非典型肺炎'},
    {code: '0306', name: '甲型肝炎'},
    {code: '0307', name: '乙型肝炎'},
    {code: '0308', name: '丙型肝炎'},
    {code: '0309', name: '戊型肝炎'},
    {code: '5500', name: '人感染高致病性禽流感'},
    {code: '1901', name: '肺炭疽'},
    {code: '1902', name: '皮肤炭疽'},
    {code: '1903', name: '未分型炭疽'},
    {code: '2606', name: '肺结核涂阳'},
    {code: '2607', name: '肺结核菌阴'},
    {code: '5600', name: '流行性脑脊髓膜炎'},
    {code: '5800', name: '甲型H1N1流感'},
]

export const classC = [
    {code: '2200', name: '黑热病'},
    {code: '3200', name: '丝虫病'},
    {code: '3300', name: '包虫病'},
    {code: '3400', name: '麻风病'},
    {code: '3500', name: '流行性感冒'},
    {code: '3600', name: '流行性腮腺炎'},
    {code: '3700', name: '风疹'},
    {code: '3800', name: '急性出血性结膜炎'},
    {code: '3900', name: '其他感染性腹泻'},
    {code: '5700', name: '流行性和地方性斑疹伤寒'},
    {code: '5900', name: '手足口病'}
]

export const otherInfections = [
    {code: '4100', name: '非淋菌性尿道炎（衣原体）'},
    {code: '4200', name: '尖锐湿疣'},
    {code: '4300', name: '生殖器疱疹'},
    {code: '5200', name: '水痘'},
    {code: '5400', name: '肝吸虫病'},
    {code: '4000', name: '生殖道沙眼衣原体感染'},
    {code: '6000', name: '恙虫病'},
    {code: '6100', name: '森林脑炎'},
    {code: '6200', name: '结核性胸膜炎'},
    {code: '6300', name: '人感染猪链球菌'},
    {code: '6400', name: '人粒细胞无形体病'},
]

export const testing = [
    {code: '0', name: '没检测'},
    {code: '1', name: '阴性'},
    {code: '2', name: '阳性'}
]

export const other = [
    {code: '0', name: '1:1'},
    {code: '1', name: '1:2'},
    {code: '2', name: '1:4'},
    {code: '3', name: '1:8'},
    {code: '4', name: '1:16'},
    {code: '5', name: '1:32'},
    {code: '6', name: '1:61己以上'},
    {code: '7', name: '无'},
]

export const testOther = [
    {code: '0', name: '暗视野显微镜检查阳性'},
    {code: '1', name: 'ELISA阳性'},
    {code: '2', name: 'VDRL阳性'},
    {code: '3', name: 'FTA-ABS阳性'},
]

export const diagnosticBasis = [
    {code: '1', name: '临床'},
    {code: '2', name: '流行病学'},
    {code: '3', name: '特异性诊断'},
]

export const pastHistory = [
    {code: '1', name: '有'},
    {code: '0', name: '无'}
]

export const visitType = [
    {code: '初诊', name: '初诊'},
    {code: '复诊', name: '复诊'},
    {code: '急性发作', name: '急性发作'},
]

export const gyLcfx = [
    {code: '急黄肝', name: '急黄肝'},
    {code: '隐无黄肝', name: '隐无黄肝'},
    {code: '慢迁肝', name: '慢迁肝'},
    {code: '慢活肝', name: '慢活肝'},
    {code: '重肝', name: '重肝'},
    {code: '瘀胆肝', name: '瘀胆肝'},
    {code: '肝硬化', name: '肝硬化'},
]

export const gyByfx = [
    {code: '甲型', name: '甲型'},
    {code: '乙型', name: '乙型'},
    {code: '丙型', name: '丙型'},
    {code: '戊型', name: '戊型'},
    {code: '未分型', name: '未分型'},
    {code: '病原携带者', name: '病原携带者'}
]

export const getClassName = (data) => {
    if (stringNotBlank(data.contagion)) {
        return classA.filter(item => {
            return item.code === data.contagion
        })[0]
    }

    if (stringNotBlank(data.contagion2)) {
        return classB.filter(item => {
            return item.code === data.contagion2
        })[0]
    }
    if (stringNotBlank(data.contagion3)) {
        return classC.filter(item => {
            return item.code === data.contagion3
        })[0]
    }
    if (stringNotBlank(data.contagionQt)) {
        return otherInfections.filter(item => {
            return item.code === data.contagionQt
        })[0]
    }
}
