|
@@ -1,10 +1,10 @@
|
|
|
import 'package:fis_measure/configs/patient.dart';
|
|
|
+import 'package:fis_measure/interfaces/process/calculators/values.dart';
|
|
|
import 'package:fis_measure/interfaces/process/items/terms.dart';
|
|
|
+import 'package:fis_measure/process/calcuators/unit_formulas/index.dart';
|
|
|
import 'package:fis_measure/process/primitives/combos/lv_mass.dart';
|
|
|
-import 'package:vid/us/vid_us_unit.dart';
|
|
|
|
|
|
import 'calculator.dart';
|
|
|
-import 'formulas/cardiac.dart';
|
|
|
|
|
|
class LvdMassALCal extends Calculator<LVMass, double> {
|
|
|
LvdMassALCal(super.ref);
|
|
@@ -15,30 +15,36 @@ class LvdMassALCal extends Calculator<LVMass, double> {
|
|
|
|
|
|
final feature = ref.feature!;
|
|
|
|
|
|
- double? epi = pickChildFloatValue(ref.epi);
|
|
|
- double? endo = pickChildFloatValue(ref.endo);
|
|
|
- double? l = pickChildFloatValue(ref.l);
|
|
|
+ UnitFloatValue? epi = pickChildToFloatValue(ref.epi)?.toUnitFloatValue();
|
|
|
+ UnitFloatValue? endo = pickChildToFloatValue(ref.endo)?.toUnitFloatValue();
|
|
|
+ UnitFloatValue? l = pickChildToFloatValue(ref.l)?.toUnitFloatValue();
|
|
|
|
|
|
- double? lvdmass;
|
|
|
- double? lvdMassIndex;
|
|
|
+ UnitFloatValue? lvdmass;
|
|
|
+ UnitFloatValue? lvdMassIndex;
|
|
|
if (epi != null && endo != null && l != null) {
|
|
|
- lvdmass = CardiacFormulas.lvdMassAL(epi, endo, l);
|
|
|
+ lvdmass = UnitFormulas.cardiac.lvdMassAL(epi, endo, l);
|
|
|
}
|
|
|
if (lvdmass != null && GlobalPatientConfig.bsa > 0) {
|
|
|
- lvdMassIndex =
|
|
|
- CardiacFormulas.lvdMassIndex(lvdmass, GlobalPatientConfig.bsa);
|
|
|
+ lvdMassIndex = UnitFormulas.cardiac.lvdMassIndex(
|
|
|
+ lvdmass,
|
|
|
+ bsa: GlobalPatientConfig.bsa,
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
for (var output in ref.meta.outputs) {
|
|
|
switch (output.name) {
|
|
|
case MeasureTerms.LVdMass:
|
|
|
if (lvdmass != null) {
|
|
|
- feature.updateFloatValue(output, lvdmass, VidUsUnit.kg);
|
|
|
+ feature.updateFloatValue(output, lvdmass.value, lvdmass.unit);
|
|
|
}
|
|
|
break;
|
|
|
case MeasureTerms.LVdMassIndex:
|
|
|
if (lvdMassIndex != null) {
|
|
|
- feature.updateFloatValue(output, lvdMassIndex, VidUsUnit.gm2);
|
|
|
+ feature.updateFloatValue(
|
|
|
+ output,
|
|
|
+ lvdMassIndex.value,
|
|
|
+ lvdMassIndex.unit,
|
|
|
+ );
|
|
|
}
|
|
|
break;
|
|
|
}
|