update
This commit is contained in:
parent
f711240faa
commit
2de88b9beb
|
@ -27,9 +27,7 @@ pub fn calculate_sustenance_ingestion_amounts(sustenance: &mut SustenanceIngesti
|
||||||
|
|
||||||
calculate_sustenance_ingestion_amounts(ingestion)
|
calculate_sustenance_ingestion_amounts(ingestion)
|
||||||
}
|
}
|
||||||
IngestionKind::Hydration(hydration) => {
|
IngestionKind::Hydration(hydration) => hydration.amount_ml *= sustenance.amount,
|
||||||
hydration.amount_ml *= sustenance.amount
|
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,18 +45,17 @@ pub fn calculate_sustenance_contents(root: SustenanceIngestion) -> CalculatedVal
|
||||||
match ingestion {
|
match ingestion {
|
||||||
IngestionKind::Unknown => {}
|
IngestionKind::Unknown => {}
|
||||||
IngestionKind::Substance(substance) => {
|
IngestionKind::Substance(substance) => {
|
||||||
let substance_ingestion = values
|
let substance_ingestion =
|
||||||
.substances
|
values.substances.get(&substance.id).cloned().unwrap_or(
|
||||||
.get(&substance.id)
|
SubstanceIngestion {
|
||||||
.cloned()
|
|
||||||
.unwrap_or(SubstanceIngestion {
|
|
||||||
id: substance.id.clone(),
|
id: substance.id.clone(),
|
||||||
substance: None,
|
substance: None,
|
||||||
dose: Dose::new_precise(0.0),
|
dose: Dose::new_precise(0.0),
|
||||||
custom_unit_id: None,
|
custom_unit_id: None,
|
||||||
roa: AdministrationRoute::Oral,
|
roa: AdministrationRoute::Oral,
|
||||||
stomach_fullness: None,
|
stomach_fullness: None,
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
values.substances.insert(
|
values.substances.insert(
|
||||||
substance.id.clone(),
|
substance.id.clone(),
|
||||||
|
@ -85,7 +82,7 @@ pub fn calculate_sustenance_contents(root: SustenanceIngestion) -> CalculatedVal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IngestionKind::Hydration(hydration) => {
|
IngestionKind::Hydration(hydration) => {
|
||||||
values.hydration.amount_ml += hydration.amount_ml;
|
values.hydration.amount_ml *= hydration.amount_ml;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue