This commit introduces a major enhancement to the heart simulation, adding a detailed mechanical model of the cardiac cycle that is synchronized with the existing EKG waveform.
Key features:
- The Heart class is refactored to include data structures for the four chambers (atria and ventricles) and four valves (mitral, tricuspid, aortic, pulmonary).
- The `update` method now simulates the phases of the cardiac cycle, including atrial and ventricular systole and diastole.
- Chamber pressures and volumes are dynamically updated based on the phase of the cycle.
- Valve statuses (open/closed) are determined by pressure gradients between chambers.
- Ejection Fraction is now calculated based on the simulated end-diastolic and end-systolic volumes of the left ventricle.
- The example program has been updated to display a live, detailed summary of the heart's mechanical status, showing pressures, volumes, and valve states as they change over time.
- Adds `getOrganSummary` and `getPatientSummary` to retrieve human-readable string summaries of organ vitals.
- Adds a templated function `getOrgan<T>` which allows for type-safe, direct access to specific organ objects. This enables calling organ-specific methods to retrieve raw data values (e.g., `heart->getHeartRate()`).
The example `main.cpp` has been updated to demonstrate the usage of all new functions.
This commit significantly expands the patient simulation by adding models
for the full digestive and urinary systems, as well as the spleen and
spinal cord.
This builds on the polymorphic organ framework by adding 9 new organ
classes:
- Kidneys
- Bladder
- Stomach
- Intestines
- Gallbladder
- Pancreas
- Esophagus
- Spleen
- SpinalCord
Each new organ has its own header, a source file with simplified
simulation logic for its unique physiological properties, and is
integrated into the main patient model and simulation loop.
The build system and example application have been updated to include
and demonstrate this new, more comprehensive set of organs.
This commit introduces the initial framework for a medical simulation library.
It adds a `Patient` struct to hold vital signs, including:
- Blood Pressure (Systolic and Diastolic)
- Heart Rate
- Respiration Rate
- Body Temperature
- Oxygen Saturation
It also includes:
- An `initializePatient` function to create a patient with baseline healthy vitals.
- A placeholder `updatePatient` function for future simulation logic.
- An updated example to demonstrate the new functionality.
- Rename all files, directories, and internal project names to "MedicalLib".
- Replace the generic `add` function with a more domain-specific `calculateBMI` function as an initial example of the library's capabilities.
- Update the `AGENTS.md` file to describe the new purpose and scope of the MedicalLib library.
This commit introduces build scripts for both Windows (`build.bat`) and Linux/macOS (`build.sh`) to simplify the build process.
It also updates the `.gitignore` file to a more comprehensive version that includes common patterns for C++ projects and various IDEs.