diff --git a/docs/api.rst b/docs/api.rst index 92590da..02ea0ac 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,10 +1,35 @@ API Reference ============= -This page contains the auto-generated API reference for the MedicalLib C++ library. +This section provides a detailed, auto-generated reference for every class, struct, and function in the MedicalLib library. -.. doxygenfile:: MedicalLib/MedicalLib.h - :project: MedicalLib +.. toctree:: + :caption: Core + :maxdepth: 1 -.. doxygenfile:: MedicalLib/Patient.h - :project: MedicalLib + api/patient + api/organ + +.. toctree:: + :caption: Organs + :maxdepth: 1 + + api/heart + api/lungs + api/brain + api/liver + api/kidneys + api/stomach + api/intestines + api/pancreas + api/spleen + api/gallbladder + api/bladder + api/esophagus + api/spinalcord + +.. toctree:: + :caption: General + :maxdepth: 1 + + api/general diff --git a/docs/api/bladder.rst b/docs/api/bladder.rst new file mode 100644 index 0000000..eb2f6a4 --- /dev/null +++ b/docs/api/bladder.rst @@ -0,0 +1,13 @@ +Bladder +======= + +.. doxygenclass:: Bladder + :project: MedicalLib + :members: + :undoc-members: + +Related Enums +------------- + +.. doxygenenum:: MicturitionState + :project: MedicalLib diff --git a/docs/api/brain.rst b/docs/api/brain.rst new file mode 100644 index 0000000..9bccfad --- /dev/null +++ b/docs/api/brain.rst @@ -0,0 +1,14 @@ +Brain +===== + +.. doxygenclass:: Brain + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: BrainRegion + :project: MedicalLib + :members: diff --git a/docs/api/esophagus.rst b/docs/api/esophagus.rst new file mode 100644 index 0000000..0df37d8 --- /dev/null +++ b/docs/api/esophagus.rst @@ -0,0 +1,20 @@ +Esophagus +========= + +.. doxygenclass:: Esophagus + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: Bolus + :project: MedicalLib + :members: + +Related Enums +------------- + +.. doxygenenum:: PeristalsisState + :project: MedicalLib diff --git a/docs/api/gallbladder.rst b/docs/api/gallbladder.rst new file mode 100644 index 0000000..ed1e6b4 --- /dev/null +++ b/docs/api/gallbladder.rst @@ -0,0 +1,13 @@ +Gallbladder +=========== + +.. doxygenclass:: Gallbladder + :project: MedicalLib + :members: + :undoc-members: + +Related Enums +------------- + +.. doxygenenum:: GallbladderState + :project: MedicalLib diff --git a/docs/api/general.rst b/docs/api/general.rst new file mode 100644 index 0000000..b70847a --- /dev/null +++ b/docs/api/general.rst @@ -0,0 +1,7 @@ +General Functions +================= + +This page documents general utility functions provided by the library. + +.. doxygenfile:: MedicalLib/MedicalLib.h + :project: MedicalLib diff --git a/docs/api/heart.rst b/docs/api/heart.rst new file mode 100644 index 0000000..7ca2ff3 --- /dev/null +++ b/docs/api/heart.rst @@ -0,0 +1,28 @@ +Heart +===== + +.. doxygenclass:: Heart + :project: MedicalLib + :members: + :protected-members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: Valve + :project: MedicalLib + :members: + +.. doxygenstruct:: Chamber + :project: MedicalLib + :members: + +Related Enums +------------- + +.. doxygenenum:: ValveStatus + :project: MedicalLib + +.. doxygenenum:: ChamberState + :project: MedicalLib diff --git a/docs/api/intestines.rst b/docs/api/intestines.rst new file mode 100644 index 0000000..262f4bf --- /dev/null +++ b/docs/api/intestines.rst @@ -0,0 +1,14 @@ +Intestines +========== + +.. doxygenclass:: Intestines + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: IntestinalSegment + :project: MedicalLib + :members: diff --git a/docs/api/kidneys.rst b/docs/api/kidneys.rst new file mode 100644 index 0000000..68b6bbc --- /dev/null +++ b/docs/api/kidneys.rst @@ -0,0 +1,14 @@ +Kidneys +======= + +.. doxygenclass:: Kidneys + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: Nephron + :project: MedicalLib + :members: diff --git a/docs/api/liver.rst b/docs/api/liver.rst new file mode 100644 index 0000000..7bcdb4a --- /dev/null +++ b/docs/api/liver.rst @@ -0,0 +1,14 @@ +Liver +===== + +.. doxygenclass:: Liver + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: HepaticLobule + :project: MedicalLib + :members: diff --git a/docs/api/lungs.rst b/docs/api/lungs.rst new file mode 100644 index 0000000..6794ab3 --- /dev/null +++ b/docs/api/lungs.rst @@ -0,0 +1,24 @@ +Lungs +===== + +.. doxygenclass:: Lungs + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: Lobe + :project: MedicalLib + :members: + +.. doxygenstruct:: Bronchus + :project: MedicalLib + :members: + +Related Enums +------------- + +.. doxygenenum:: RespiratoryState + :project: MedicalLib diff --git a/docs/api/organ.rst b/docs/api/organ.rst new file mode 100644 index 0000000..5448195 --- /dev/null +++ b/docs/api/organ.rst @@ -0,0 +1,9 @@ +Organ (Base Class) +================== + +This page documents the abstract base class for all organs in the simulation. + +.. doxygenclass:: Organ + :project: MedicalLib + :members: + :undoc-members: diff --git a/docs/api/pancreas.rst b/docs/api/pancreas.rst new file mode 100644 index 0000000..51913bb --- /dev/null +++ b/docs/api/pancreas.rst @@ -0,0 +1,14 @@ +Pancreas +======== + +.. doxygenclass:: Pancreas + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: DigestiveEnzymes + :project: MedicalLib + :members: diff --git a/docs/api/patient.rst b/docs/api/patient.rst new file mode 100644 index 0000000..a76df6b --- /dev/null +++ b/docs/api/patient.rst @@ -0,0 +1,26 @@ +Patient +======= + +This page documents the main `Patient` struct and related functions that manage the overall simulation state. + +.. doxygenstruct:: Patient + :project: MedicalLib + :members: + +Related Structures +------------------ + +.. doxygenstruct:: BloodPressure + :project: MedicalLib + :members: + +.. doxygenstruct:: Blood + :project: MedicalLib + :members: + +Helper Functions +---------------- + +.. doxygenfile:: MedicalLib/Patient.h + :project: MedicalLib + :sections: func diff --git a/docs/api/spinalcord.rst b/docs/api/spinalcord.rst new file mode 100644 index 0000000..190d935 --- /dev/null +++ b/docs/api/spinalcord.rst @@ -0,0 +1,20 @@ +Spinal Cord +=========== + +.. doxygenclass:: SpinalCord + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: SpinalTract + :project: MedicalLib + :members: + +Related Enums +------------- + +.. doxygenenum:: SignalStatus + :project: MedicalLib diff --git a/docs/api/spleen.rst b/docs/api/spleen.rst new file mode 100644 index 0000000..53c8d17 --- /dev/null +++ b/docs/api/spleen.rst @@ -0,0 +1,18 @@ +Spleen +====== + +.. doxygenclass:: Spleen + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: RedPulp + :project: MedicalLib + :members: + +.. doxygenstruct:: WhitePulp + :project: MedicalLib + :members: diff --git a/docs/api/stomach.rst b/docs/api/stomach.rst new file mode 100644 index 0000000..7112d58 --- /dev/null +++ b/docs/api/stomach.rst @@ -0,0 +1,20 @@ +Stomach +======= + +.. doxygenclass:: Stomach + :project: MedicalLib + :members: + :undoc-members: + +Related Structures +------------------ + +.. doxygenstruct:: Chyme + :project: MedicalLib + :members: + +Related Enums +------------- + +.. doxygenenum:: GastricState + :project: MedicalLib diff --git a/include/MedicalLib/Brain.h b/include/MedicalLib/Brain.h index b5ba489..9f1aa0a 100644 --- a/include/MedicalLib/Brain.h +++ b/include/MedicalLib/Brain.h @@ -10,9 +10,9 @@ * @brief Represents a specific region of the brain. */ struct BrainRegion { - std::string name; - double activityLevel; // 0.0 to 1.0 - double bloodFlow_ml_100g_min; + std::string name; ///< The name of the brain region. + double activityLevel; ///< Metabolic activity level, normalized [0.0, 1.0]. + double bloodFlow_ml_100g_min; ///< Blood flow in mL per 100g of tissue per minute. }; /** diff --git a/include/MedicalLib/Esophagus.h b/include/MedicalLib/Esophagus.h index 665f0a7..4289fbe 100644 --- a/include/MedicalLib/Esophagus.h +++ b/include/MedicalLib/Esophagus.h @@ -17,8 +17,8 @@ enum class PeristalsisState { * @brief Represents a small mass of chewed food. */ struct Bolus { - double volume_mL; - double position_cm; // Position from the top of the esophagus + double volume_mL; ///< The volume of the bolus in mL. + double position_cm; ///< Position from the top of the esophagus in cm. }; /** diff --git a/include/MedicalLib/Heart.h b/include/MedicalLib/Heart.h index 08c06ac..50e7329 100644 --- a/include/MedicalLib/Heart.h +++ b/include/MedicalLib/Heart.h @@ -15,10 +15,10 @@ enum class ValveStatus { OPEN, CLOSED }; * @brief Represents a single heart valve and its potential pathologies. */ struct Valve { - std::string name; - ValveStatus status = ValveStatus::CLOSED; - double stenosis = 0.0; // Degree of narrowing [0, 1] - double regurgitation = 0.0; // Degree of leakage [0, 1] + std::string name; ///< The name of the valve (e.g., "Mitral"). + ValveStatus status = ValveStatus::CLOSED; ///< The current status of the valve (OPEN or CLOSED). + double stenosis = 0.0; ///< Degree of narrowing, normalized [0, 1]. + double regurgitation = 0.0; ///< Degree of leakage, normalized [0, 1]. }; /** @@ -30,12 +30,12 @@ enum class ChamberState { SYSTOLE, DIASTOLE }; * @brief Represents a single chamber of the heart. */ struct Chamber { - std::string name; - ChamberState state = ChamberState::DIASTOLE; - double volume_mL = 0.0; - double pressure_mmHg = 0.0; - double endDiastolicVolume_mL = 120.0; - double endSystolicVolume_mL = 50.0; + std::string name; ///< The name of the chamber (e.g., "Left Ventricle"). + ChamberState state = ChamberState::DIASTOLE;///< The current state of the chamber (SYSTOLE or DIASTOLE). + double volume_mL = 0.0; ///< The current volume of blood in the chamber in mL. + double pressure_mmHg = 0.0; ///< The current pressure in the chamber in mmHg. + double endDiastolicVolume_mL = 120.0; ///< The volume of blood at the end of diastole (filling). + double endSystolicVolume_mL = 50.0; ///< The volume of blood at the end of systole (contraction). }; /** @@ -64,12 +64,35 @@ public: std::string getSummary() const override; // --- Electrical Properties --- + /** + * @brief Sets the baseline heart rate. + * @param newRate_bpm The new heart rate in beats per minute. + */ void setHeartRate(double newRate_bpm); + + /** + * @brief Gets the current measured heart rate. + * @return The heart rate in beats per minute. + */ double getHeartRate() const; + + /** + * @brief Gets the simulated EKG data for all leads. + * @return A constant reference to the map of EKG data. + */ const std::map>& getEkgData() const; // --- Mechanical Properties --- + /** + * @brief Calculates and returns the left ventricular ejection fraction. + * @return The ejection fraction as a percentage [0, 100]. + */ double getEjectionFraction() const; + + /** + * @brief Gets the simulated aortic pressure, representing systemic blood pressure. + * @return The aortic pressure in mmHg. + */ double getAorticPressure() const; // Represents systemic blood pressure private: diff --git a/include/MedicalLib/Intestines.h b/include/MedicalLib/Intestines.h index fd6aba0..395b6d8 100644 --- a/include/MedicalLib/Intestines.h +++ b/include/MedicalLib/Intestines.h @@ -11,11 +11,11 @@ struct DigestiveEnzymes; * @brief Represents a segment of the intestines. */ struct IntestinalSegment { - std::string name; - double length_m; - double motility; // Rate of chyme movement - double nutrientAbsorptionRate; - double waterAbsorptionRate; + std::string name; ///< The name of the segment (e.g., "Duodenum"). + double length_m; ///< The length of the segment in meters. + double motility; ///< The rate of chyme movement. + double nutrientAbsorptionRate; ///< The rate at which nutrients are absorbed. + double waterAbsorptionRate; ///< The rate at which water is absorbed. }; /** diff --git a/include/MedicalLib/Kidneys.h b/include/MedicalLib/Kidneys.h index f82bb9e..be7b972 100644 --- a/include/MedicalLib/Kidneys.h +++ b/include/MedicalLib/Kidneys.h @@ -8,9 +8,9 @@ * @brief Represents a functional unit of the kidney. */ struct Nephron { - std::string id; - double filtrationEfficiency; // 0.0 to 1.0 - bool isDamaged; + std::string id; ///< The unique ID of the nephron. + double filtrationEfficiency; ///< The filtration efficiency, normalized [0.0, 1.0]. + bool isDamaged; ///< True if the nephron has sustained damage. }; /** diff --git a/include/MedicalLib/Liver.h b/include/MedicalLib/Liver.h index 82b0f24..392d0b7 100644 --- a/include/MedicalLib/Liver.h +++ b/include/MedicalLib/Liver.h @@ -8,9 +8,9 @@ * @brief Represents a functional unit of the liver. */ struct HepaticLobule { - std::string id; - double metabolicActivity; // A factor from 0.0 to 1.0+ - bool isDamaged; + std::string id; ///< The unique ID of the lobule. + double metabolicActivity; ///< A factor representing the metabolic activity [0.0, 1.0+]. + bool isDamaged; ///< True if the lobule has sustained damage. }; /** diff --git a/include/MedicalLib/Lungs.h b/include/MedicalLib/Lungs.h index ca8a6a1..854564e 100644 --- a/include/MedicalLib/Lungs.h +++ b/include/MedicalLib/Lungs.h @@ -18,17 +18,17 @@ enum class RespiratoryState { * @brief Represents a single lobe of the lung. */ struct Lobe { - std::string name; - double volume_mL; - double compliance; // How easily it inflates + std::string name; ///< The name of the lobe. + double volume_mL; ///< The current volume of air in the lobe in mL. + double compliance; ///< The measure of the lung's ability to stretch and expand. }; /** * @brief Represents a major airway. */ struct Bronchus { - std::string name; - double resistance; // Airflow resistance + std::string name; ///< The name of the bronchus. + double resistance; ///< The resistance to airflow. }; /** diff --git a/include/MedicalLib/Pancreas.h b/include/MedicalLib/Pancreas.h index f316a6f..c8f4a44 100644 --- a/include/MedicalLib/Pancreas.h +++ b/include/MedicalLib/Pancreas.h @@ -7,9 +7,9 @@ * @brief Represents the mix of enzymes released by the pancreas for digestion. */ struct DigestiveEnzymes { - double volume_mL = 0.0; - double amylase_U_per_L = 0.0; - double lipase_U_per_L = 0.0; + double volume_mL = 0.0; ///< The volume of the secreted fluid in mL. + double amylase_U_per_L = 0.0; ///< The concentration of amylase in Units/Liter. + double lipase_U_per_L = 0.0; ///< The concentration of lipase in Units/Liter. }; /** diff --git a/include/MedicalLib/Patient.h b/include/MedicalLib/Patient.h index 6efcb34..364b8a2 100644 --- a/include/MedicalLib/Patient.h +++ b/include/MedicalLib/Patient.h @@ -11,29 +11,29 @@ class Organ; * @brief Represents blood pressure values. */ struct BloodPressure { - double systolic_mmHg = 120.0; - double diastolic_mmHg = 80.0; + double systolic_mmHg = 120.0; ///< Systolic pressure in mmHg. + double diastolic_mmHg = 80.0; ///< Diastolic pressure in mmHg. }; /** * @brief Represents the composition of the patient's blood. */ struct Blood { - BloodPressure bloodPressure; - double oxygenSaturation = 98.0; // Normal SpO2 - double co2PartialPressure_mmHg = 40.0; // Normal PaCO2 - double glucose_mg_per_dL = 100.0; // Normal fasting glucose - double angiotensin_au = 0.0; // Hormone for BP control - double toxins_au = 0.0; // Arbitrary units, 0 is clean + BloodPressure bloodPressure; ///< The patient's blood pressure. + double oxygenSaturation = 98.0; ///< Peripheral oxygen saturation (SpO2) as a percentage. + double co2PartialPressure_mmHg = 40.0; ///< Partial pressure of CO2 in arterial blood (PaCO2). + double glucose_mg_per_dL = 100.0; ///< Blood glucose level in mg/dL. + double angiotensin_au = 0.0; ///< Concentration of angiotensin, a hormone for BP control, in arbitrary units. + double toxins_au = 0.0; ///< Concentration of toxins in the blood, in arbitrary units. }; /** * @brief Holds all the vital signs and other medical information for a patient. */ struct Patient { - int patientId; - Blood blood; - std::vector> organs; + int patientId; ///< The unique ID for the patient. + Blood blood; ///< The patient's blood composition and vitals. + std::vector> organs; ///< A collection of all the patient's simulated organs. }; // Define MEDICAL_LIB_EXPORT for exporting symbols from the DLL diff --git a/include/MedicalLib/SpinalCord.h b/include/MedicalLib/SpinalCord.h index 90200e3..2c11c4b 100644 --- a/include/MedicalLib/SpinalCord.h +++ b/include/MedicalLib/SpinalCord.h @@ -17,9 +17,9 @@ enum class SignalStatus { * @brief Represents a major bundle of nerve fibers in the spinal cord. */ struct SpinalTract { - std::string name; - SignalStatus status; - double conductionVelocity_m_per_s; + std::string name; ///< The name of the tract (e.g., "Corticospinal"). + SignalStatus status; ///< The functional status of the neural pathway. + double conductionVelocity_m_per_s; ///< The speed of signal travel in meters/sec. }; /** diff --git a/include/MedicalLib/Spleen.h b/include/MedicalLib/Spleen.h index 805f083..4939381 100644 --- a/include/MedicalLib/Spleen.h +++ b/include/MedicalLib/Spleen.h @@ -7,16 +7,16 @@ * @brief Represents the red pulp, responsible for filtering blood. */ struct RedPulp { - double filtrationRate; // Arbitrary units - double rbcBreakdownRate; // Rate of old red blood cell removal + double filtrationRate; ///< The rate of blood filtration, in arbitrary units. + double rbcBreakdownRate; ///< The rate of old red blood cell removal. }; /** * @brief Represents the white pulp, part of the immune system. */ struct WhitePulp { - double lymphocyteCount; // in millions - double macrophageCount; // in millions + double lymphocyteCount; ///< The number of lymphocytes, in millions. + double macrophageCount; ///< The number of macrophages, in millions. }; /** diff --git a/include/MedicalLib/Stomach.h b/include/MedicalLib/Stomach.h index b6d9690..cc8f0cb 100644 --- a/include/MedicalLib/Stomach.h +++ b/include/MedicalLib/Stomach.h @@ -18,8 +18,8 @@ enum class GastricState { * @brief Represents the mixture of partially digested food and gastric juices. */ struct Chyme { - double volume_mL; - double acidity_pH; + double volume_mL; ///< The volume of chyme in mL. + double acidity_pH; ///< The pH of the chyme. }; /**