/// 尿液检查数据
class UrineExamData {
  /// 中性粒细胞
  ///
  /// - 白细胞的一种
  ///
  /// - 是炎症指标
  ///
  /// - 示例：`2+`
  final String leu;

  /// 红细胞 / 潜血
  ///
  /// - 示例：`-`
  final String bld;

  /// 尿亚硝酸盐
  ///
  /// - 是否感染
  ///
  /// - 示例：`+`
  final String nit;

  /// 酮体
  ///
  /// - 示例：`3+`
  final String ket;

  /// 尿胆原
  ///
  /// - 示例：`Norm`
  final String ubg;

  /// 胆红素
  ///
  /// - 示例：`2+`
  final String bil;

  /// 蛋白质
  ///
  /// - 示例：`-`
  final String pro;

  /// 葡萄糖
  ///
  /// - 示例：`-`
  final String glu;

  /// 酸碱度
  ///
  /// - 示例：`6`
  final double ph;

  /// 尿比重
  ///
  /// - 示例：`1.010`
  final double sg;

  /// 维生素C
  ///
  /// - 示例：`-`
  final String vc;

  UrineExamData({
    required this.leu,
    required this.bld,
    required this.nit,
    required this.ket,
    required this.ubg,
    required this.bil,
    required this.pro,
    required this.glu,
    required this.ph,
    required this.sg,
    required this.vc,
  });

  factory UrineExamData.fromEventData(Map<String, dynamic> jsonMap) {
    return UrineExamData(
      leu: jsonMap["LEU"],
      bld: jsonMap["BLD"],
      nit: jsonMap["NIT"],
      ket: jsonMap["KET"],
      ubg: jsonMap["UBG"],
      bil: jsonMap["BIL"],
      pro: jsonMap["PRO"],
      glu: jsonMap["GLU"],
      ph: double.parse(jsonMap["PH"]),
      sg: double.parse(jsonMap["SG"]),
      vc: jsonMap["VC"],
    );
  }
}
