5a79cc45cd
- Broke out the Patient struct and its related functions (initializePatient, updatePatient) into their own files (Patient.h, Patient.cpp) for better organization. - Implemented the initial UpdateState logic in the updatePatient function using a mean-reverting model. This ensures that vital signs fluctuate realistically around a healthy baseline. - Updated CMakeLists.txt to include the new Patient.cpp file in the build.
40 lines
1.1 KiB
C
40 lines
1.1 KiB
C
#pragma once
|
|
|
|
/**
|
|
* @brief Holds all the vital signs and other medical information for a patient.
|
|
*/
|
|
struct Patient {
|
|
int patientId;
|
|
double bloodPressureSystolic;
|
|
double bloodPressureDiastolic;
|
|
double heartRate;
|
|
double respirationRate;
|
|
double bodyTemperature;
|
|
double oxygenSaturation;
|
|
};
|
|
|
|
// Define MEDICAL_LIB_EXPORT for exporting symbols from the DLL
|
|
#if defined(_WIN32)
|
|
#if defined(MEDICAL_LIB_EXPORT)
|
|
#define MEDICAL_LIB_API __declspec(dllexport)
|
|
#else
|
|
#define MEDICAL_LIB_API __declspec(dllimport)
|
|
#endif
|
|
#else
|
|
#define MEDICAL_LIB_API
|
|
#endif
|
|
|
|
/**
|
|
* @brief Initializes a new patient with baseline vital signs.
|
|
* @param patientId The ID for the new patient.
|
|
* @return A Patient struct with default healthy values.
|
|
*/
|
|
MEDICAL_LIB_API Patient initializePatient(int patientId);
|
|
|
|
/**
|
|
* @brief Updates the patient's vital signs based on the time elapsed.
|
|
* @param patient The patient to update.
|
|
* @param deltaTime_s The time elapsed in seconds.
|
|
*/
|
|
MEDICAL_LIB_API void updatePatient(Patient& patient, double deltaTime_s);
|