package com.zj365.health.fragment.bloodlipid

import com.xty.network.model.BloodFatType
import com.xty.network.model.BloodLipidDataBean
import com.xty.network.model.ValueMap

object BloodLipidDataDealWithList {

    val tcContentStr by lazy {
        arrayOf("日期", "平均总胆固醇", "正常次数", "偏高次数")
    }
    val tcOtherContentStr by lazy {
        arrayOf(
            "日期",
            "平均总胆固醇",
            "最高总胆固醇",
            "最低总胆固醇",
            "正常次数",
            "偏高次数",
            "累计次数"
        )
    }


    val tgContentStr by lazy {
        arrayOf("日期", "平均甘油三酯", "正常次数", "偏高次数")
    }
    val tgOtherContentStr by lazy {
        arrayOf(
            "日期",
            "平均甘油三酯",
            "最高甘油三酯",
            "最低甘油三酯",
            "正常次数",
            "偏高次数",
            "累计次数"
        )
    }

    val hdlContentStr by lazy {
        arrayOf("日期", "平均高密度脂蛋白", "正常次数", "偏低次数")
    }
    val hdlOtherContentStr by lazy {
        arrayOf(
            "日期",
            "平均甘油三酯",
            "最高高密度脂蛋白",
            "最低高密度脂蛋白",
            "正常次数",
            "偏高次数",
            "累计次数"
        )
    }


    val ldlContentStr by lazy {
        arrayOf("日期", "平均低密度脂蛋白", "正常次数", "偏高次数")
    }
    val ldlOtherContentStr by lazy {
        arrayOf(
            "日期",
            "平均甘油三酯",
            "最高低密度脂蛋白",
            "最低低密度脂蛋白",
            "正常次数",
            "偏高次数",
            "累计次数"
        )
    }

    fun setDataList(
        valueData: BloodLipidDataBean.ValueCompare,
        compareValueData: BloodLipidDataBean.ValueCompare,
        hideData: String,
        showData: String,
        type: Int, //1，日，2，周，3，月，4，年
        dataType: BloodFatType, //
        list: MutableList<ValueMap>
    ): MutableList<ValueMap> {
        // 标题头
        val data0 = ValueMap().apply {
            when (dataType) {
                BloodFatType.Tc -> {
                    title = tcContentStr[0]
                }

                BloodFatType.Tg -> {
                    title = tgContentStr[0]

                }

                BloodFatType.Hdl -> {
                    title = hdlContentStr[0]

                }

                BloodFatType.Ldl -> {
                    title = ldlContentStr[0]
                }
            }
            if (type == 2) {
                var tv1 = hideData
                var tvarray = tv1.split("至")
                tv1 = tvarray[0].substring(5, tvarray[0].length)
                valueCompare = "对比周\n$tv1"
                tv1 = tvarray[1].substring(5, tvarray[0].length)
                valueCompare += "至$tv1"

                tv1 = showData
                tvarray = tv1.split("至")
                tv1 = tvarray[0].substring(5, tvarray[0].length)
                value = "选择周\n$tv1"
                tv1 = tvarray[1].substring(5, tvarray[0].length)
                value += "至$tv1"
            } else {
                when (type) {
                    3 -> {//月
                        valueCompare = "对比月\n$hideData"
                        value = "选择月\n$showData"
                    }

                    4 -> {//年
                        valueCompare = "对比年\n$hideData"
                        value = "选择年\n$showData"
                    }

                    else -> {//日
                        valueCompare = "对比日期\n$hideData"
                        value = "选择日期\n$showData"
                    }
                }
            }
            state = 0
        }
        list.add(data0)
        if (type == 1) {  //日对比数据只有两项
            //平均总胆固醇
            val data1 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgTc > compareValueData.avgTc) {
                                1
                            } else if (valueData.avgTc < compareValueData.avgTc) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Tg -> {
                        title = tgContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgTg > compareValueData.avgTg) {
                                1
                            } else if (valueData.avgTg < compareValueData.avgTg) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Hdl -> {
                        title = hdlContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgHdl > compareValueData.avgHdl) {
                                1
                            } else if (valueData.avgHdl < compareValueData.avgHdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Ldl -> {
                        title = ldlContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgLdl > compareValueData.avgLdl) {
                                1
                            } else if (valueData.avgLdl < compareValueData.avgLdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }
                }
            }
            list.add(data1)

            //正常次数
            val data2 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tcNormal > compareValueData.tcNormal) {
                                1
                            } else if (valueData.tcNormal < compareValueData.tcNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tcNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tcNormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Tg -> {
                        title = tgContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tgNormal > compareValueData.tgNormal) {
                                1
                            } else if (valueData.tgNormal < compareValueData.tgNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tgNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tgNormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Hdl -> {
                        title = hdlContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.hdlNormal > compareValueData.hdlNormal) {
                                1
                            } else if (valueData.hdlNormal < compareValueData.hdlNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.hdlNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.hdlNormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Ldl -> {
                        title = ldlContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.ldlNormal > compareValueData.ldlNormal) {
                                1
                            } else if (valueData.ldlNormal < compareValueData.ldlNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.ldlNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.ldlNormal
                            } else {
                                "--"
                            }
                        }次"
                    }
                }
            }
            list.add(data2)

            //偏高次数
            val data3 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tcAbnormal > compareValueData.tcAbnormal) {
                                1
                            } else if (valueData.tcAbnormal < compareValueData.tcAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tcAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tcAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Tg -> {
                        title = tgContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tgAbnormal > compareValueData.tgAbnormal) {
                                1
                            } else if (valueData.tgAbnormal < compareValueData.tgAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tgAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tgAbnormal
                            } else {
                                "--"
                            }
                        }次"

                    }

                    BloodFatType.Hdl -> {
                        title = hdlContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.hdlAbnormal > compareValueData.hdlAbnormal) {
                                1
                            } else if (valueData.hdlAbnormal < compareValueData.hdlAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.hdlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.hdlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Ldl -> {
                        title = ldlContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.ldlAbnormal > compareValueData.ldlAbnormal) {
                                1
                            } else if (valueData.ldlAbnormal < compareValueData.ldlAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.ldlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.ldlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }
                }
            }
            list.add(data3)
        } else {
            //累计次数
            val data6 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[6]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.count > compareValueData.count) {
                                1
                            } else if (valueData.count < compareValueData.count) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.count
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.count
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Tg -> {
                        title = tcOtherContentStr[6]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.count > compareValueData.count) {
                                1
                            } else if (valueData.count < compareValueData.count) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.count
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.count
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Hdl -> {
                        title = tcOtherContentStr[6]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.count > compareValueData.count) {
                                1
                            } else if (valueData.count < compareValueData.count) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.count
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.count
                            } else {
                                "--"
                            }
                        }次"

                    }

                    BloodFatType.Ldl -> {
                        title = tcOtherContentStr[6]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.count > compareValueData.count) {
                                1
                            } else if (valueData.count < compareValueData.count) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.count
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.count
                            } else {
                                "--"
                            }
                        }次"
                    }
                }
            }
            list.add(data6)

            //平均数
            val data1 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgTc > compareValueData.avgTc) {
                                1
                            } else if (valueData.avgTc < compareValueData.avgTc) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Tg -> {
                        title = tgOtherContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgTg > compareValueData.avgTg) {
                                1
                            } else if (valueData.avgTg < compareValueData.avgTg) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Hdl -> {
                        title = hdlOtherContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgHdl > compareValueData.avgHdl) {
                                1
                            } else if (valueData.avgHdl < compareValueData.avgHdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Ldl -> {
                        title = ldlOtherContentStr[1]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.avgLdl > compareValueData.avgLdl) {
                                1
                            } else if (valueData.avgLdl < compareValueData.avgLdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.avgLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.avgLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }
                }
            }
            list.add(data1)

            val data4 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.maxTc > compareValueData.maxTc) {
                                1
                            } else if (valueData.maxTc < compareValueData.maxTc) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.maxTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.maxTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Tg -> {
                        title = tgOtherContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.maxTg > compareValueData.maxTg) {
                                1
                            } else if (valueData.maxTg < compareValueData.maxTg) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.maxTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.maxTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Hdl -> {
                        title = hdlOtherContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.maxHdl > compareValueData.maxHdl) {
                                1
                            } else if (valueData.maxHdl < compareValueData.maxHdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.maxHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.maxHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Ldl -> {
                        title = ldlOtherContentStr[2]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.maxLdl > compareValueData.maxLdl) {
                                1
                            } else if (valueData.maxLdl < compareValueData.maxLdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.maxLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.maxLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }
                }
            }
            list.add(data4)

            val data5 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.minTc > compareValueData.minTc) {
                                1
                            } else if (valueData.minTc < compareValueData.minTc) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.minTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.minTc
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }

                    BloodFatType.Tg -> {
                        title = tgOtherContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.minTg > compareValueData.minTg) {
                                1
                            } else if (valueData.minTg < compareValueData.minTg) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.minTg
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.minTg
                            } else {
                                "--"
                            }
                        }mmol/L"

                    }

                    BloodFatType.Hdl -> {
                        title = hdlOtherContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.minHdl > compareValueData.minHdl) {
                                1
                            } else if (valueData.minHdl < compareValueData.minHdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.minHdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.minHdl
                            } else {
                                "--"
                            }
                        }mmol/L"

                    }

                    BloodFatType.Ldl -> {
                        title = ldlOtherContentStr[3]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.minLdl > compareValueData.minLdl) {
                                1
                            } else if (valueData.minLdl < compareValueData.minLdl) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.minLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.minLdl
                            } else {
                                "--"
                            }
                        }mmol/L"
                    }
                }
            }
            list.add(data5)

            //正常次数
            val data2 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[4]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tcNormal > compareValueData.tcNormal) {
                                1
                            } else if (valueData.tcNormal < compareValueData.tcNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tcNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tcNormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Tg -> {
                        title = tgOtherContentStr[4]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tgNormal > compareValueData.tgNormal) {
                                1
                            } else if (valueData.tgNormal < compareValueData.tgNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tgNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tgNormal
                            } else {
                                "--"
                            }
                        }次"

                    }

                    BloodFatType.Hdl -> {
                        title = hdlOtherContentStr[4]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.hdlNormal > compareValueData.hdlNormal) {
                                1
                            } else if (valueData.hdlNormal < compareValueData.hdlNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.hdlNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.hdlNormal
                            } else {
                                "--"
                            }
                        }次"

                    }

                    BloodFatType.Ldl -> {
                        title = ldlOtherContentStr[4]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.ldlNormal > compareValueData.ldlNormal) {
                                1
                            } else if (valueData.ldlNormal < compareValueData.ldlNormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.ldlNormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.ldlNormal
                            } else {
                                "--"
                            }
                        }次"
                    }
                }
            }
            list.add(data2)

            //偏高次数
            val data3 = ValueMap().apply {
                when (dataType) {
                    BloodFatType.Tc -> {
                        title = tcOtherContentStr[5]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tcAbnormal > compareValueData.tcAbnormal) {
                                1
                            } else if (valueData.tcAbnormal < compareValueData.tcAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tcAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tcAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Tg -> {
                        title = tgOtherContentStr[5]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.tgAbnormal > compareValueData.tgAbnormal) {
                                1
                            } else if (valueData.tgAbnormal < compareValueData.tgAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.tgAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.tgAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }

                    BloodFatType.Hdl -> {
                        title = hdlOtherContentStr[5]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.hdlAbnormal > compareValueData.hdlAbnormal) {
                                1
                            } else if (valueData.hdlAbnormal < compareValueData.hdlAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.hdlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.hdlAbnormal
                            } else {
                                "--"
                            }
                        }次"

                    }

                    BloodFatType.Ldl -> {
                        title = ldlOtherContentStr[5]
                        state = if (valueData.count > 0 && compareValueData.count > 0) {
                            if (valueData.ldlAbnormal > compareValueData.ldlAbnormal) {
                                1
                            } else if (valueData.ldlAbnormal < compareValueData.ldlAbnormal) {
                                2
                            } else {
                                0
                            }
                        } else {
                            3
                        }
                        valueCompare = "${
                            if (compareValueData.count > 0) {
                                compareValueData.ldlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                        value = "${
                            if (valueData.count > 0) {
                                valueData.ldlAbnormal
                            } else {
                                "--"
                            }
                        }次"
                    }
                }
            }
            list.add(data3)
        }
        return list
    }
}