Building Medical Digital Twins with Pulse: Open Source Simulation Tools for Developers and Researchers
×
BloodChemistryModel.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 
6 #include "engine/common/system/Model.h"
7 #include "engine/common/system/Systems.h"
8 
14 
15 namespace pulse
16 {
17  class PBPhysiology;
18  class EngineTest;
27  class PULSE_DECL BloodChemistryModel : public BloodChemistrySystem, public Model
28  {
29  friend PBPhysiology;//friend the serialization class
30  friend EngineTest;
31  public:
32  BloodChemistryModel(Data& data);
33  virtual ~BloodChemistryModel();
34 
35  void Clear() override;
36 
37  // Set members to a stable homeostatic state
38  void Initialize() override;
39  // Set pointers and other member varialbes common to both homeostatic initialization and loading a state
40  void SetUp() override;
41 
42  void AtSteadyState() override;
43  void PreProcess() override;
44  void Process(bool solve_and_transport = true) override;
45  void PostProcess(bool solve_and_transport = true) override;
46 
47  bool CalculateArterialBloodGasTest(SEArterialBloodGasTest& abg) const;
48  bool CalculateCompleteBloodCount(SECompleteBloodCount& cbc) const;
49  bool CalculateComprehensiveMetabolicPanel(SEComprehensiveMetabolicPanel& cmp) const;
50 
51  protected:
52  void ComputeExposedModelParameters() override;
53 
54  void CheckBloodSubstanceLevels();
55  // Serializable member variables (Set in Initialize and in schema)
56  SERunningAverage* m_ArterialOxygen_mmHg;
57  SERunningAverage* m_ArterialCarbonDioxide_mmHg;
58 
59  // Stateless member variable (Set in SetUp())
60  double m_RedBloodCellVolume_mL;
61  double m_HbPerRedBloodCell_ug_Per_ct;
62  SELiquidCompartment* m_Aorta;
63  SELiquidSubstanceQuantity* m_AortaO2;
64  SELiquidSubstanceQuantity* m_AortaCO2;
65  SELiquidSubstanceQuantity* m_AortaHCO3;
66  SELiquidSubstanceQuantity* m_BrainO2;
67  SELiquidSubstanceQuantity* m_MyocardiumO2;
68  SELiquidCompartment* m_PulmonaryArteries;
69  SELiquidSubstanceQuantity* m_PulmonaryArteriesO2;
70  SELiquidSubstanceQuantity* m_PulmonaryArteriesCO2;
71  SELiquidCompartment* m_PulmonaryVeins;
72  SELiquidSubstanceQuantity* m_PulmonaryVeinsO2;
73  SELiquidSubstanceQuantity* m_PulmonaryVeinsCO2;
74  SELiquidCompartment* m_LeftPulmonaryCapillaries;
75  SELiquidSubstanceQuantity* m_LeftPulmonaryCapillariesO2;
76  SELiquidCompartment* m_RightPulmonaryCapillaries;
77  SELiquidSubstanceQuantity* m_RightPulmonaryCapillariesO2;
78  SELiquidCompartment* m_RightArm;
79  SELiquidSubstanceQuantity* m_RightArmO2;
80  SELiquidSubstanceQuantity* m_RightArmCO;
81  SELiquidCompartment* m_VenaCava;
82  SELiquidSubstanceQuantity* m_VenaCavaO2;
83  SELiquidSubstanceQuantity* m_VenaCavaCO2;
84  SEGasCompartment* m_Alveoli;
85  };
86 END_NAMESPACE
Definition: PBPhysiology.h:24
Definition: SEArterialBloodGasTest.h:8
Definition: SECompleteBloodCount.h:8
Definition: SEComprehensiveMetabolicPanel.h:8
Definition: SEGasCompartment.h:14
Definition: SELiquidCompartment.h:11
Definition: SELiquidSubstanceQuantity.h:12
Definition: SERunningAverage.h:8
Definition: Logger.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.