// ignore_for_file: non_constant_identifier_names

import 'dart:math' as math;

import 'package:fis_measure/interfaces/enums/species.dart';
import 'package:fis_measure/process/calcuators/formulas/cardiac.dart';

abstract class GlobalPatientConfig {
  static double weight = 0;
  static double height = 0;

  /// 人体表面积
  ///
  /// - Mosteller 公式:一个最经常使用的公式,发布于1987年。BSA (m²) = ( [身高(cm) x 体重(kg) ]/ 3600 )^½。
  ///
  /// - https://blog.csdn.net/qq_15560295/article/details/105025073
  static double bsa = 0;

  static updateBSAbyWH() {
    if (weight == 0 || height == 0) {
      bsa = 0;
    }
    bsa = math.sqrt((height * weight) / 3600);
  }

  /// 心率
  static int? hr;

  /// 物种类型
  static SpeciesType speciesType = SpeciesType.animals;

  /// 切换物种
  static switchSpecies(SpeciesType type) {
    speciesType = type;
    CardiacFormulas.reinitialize();
  }
}