feat(organs): add bloodstream organ and patient coupling
Introduce OrganType::Bloodstream and new organ module, exporting
Bloodstream, PerfusionState, and MetabolicState.
- Patient:
- initialize_default now attaches a bloodstream model
- add with_bloodstream() builder and with_organ support
- update() couples bloodstream with heart, lungs, brain, spinal cord,
kidneys, liver, pancreas, stomach, intestines, gallbladder,
esophagus, bladder, and spleen
- bloodstream ingests hemodynamics, respiratory exchange, renal,
hepatic, splenic, and nutrient feedback; propagates perfusion and
metabolic signals back to organs
- blood metrics (SpO2, hemoglobin, hematocrit, glucose) can be driven
by bloodstream
- Signals:
- Lungs: add O2 delivery, CO2 elimination, V/Q ratio
- Liver: add detox and ammonia clearance
- Kidneys: add plasma volume, urea excretion, erythropoietin
- FFI:
- add ML_ORGAN_BLOODSTREAM (Rust and C header) and mapping in
ml_patient_organ_summary
- Examples/Tests:
- demo monitors "Bloodstream"
- add tests for bloodstream coupling and organ discovery
- lib tests updated to include Bloodstream
Rationale: centralize systemic transport and inter-organ homeostasis for
richer physiology simulation and expose it to C consumers via FFI.
This commit is contained in:
@@ -91,6 +91,11 @@
|
||||
*/
|
||||
#define ML_ORGAN_SPLEEN 12
|
||||
|
||||
/**
|
||||
* Organ code for `OrganType::Bloodstream`.
|
||||
*/
|
||||
#define ML_ORGAN_BLOODSTREAM 13
|
||||
|
||||
/**
|
||||
* Opaque patient handle type for C consumers. Wraps a heap-allocated `Patient`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user