Computerizing health records makes it easier for patients to share their health
ID: 3723978 • Letter: C
Question
Computerizing health records makes it easier for patients to share their health profiles and histories among their various health care professionals. Write a program that maintains computerized health records for several patients. This includes designing several classes: HealthRecords, Patient, and Checkup. All class attributes must be private and accessed through public member functions. The attributes of each class are summarized below: Health Records class has the following private attributes: Patient class has the following private attributes: vector patientsRecords: const long patientAccountNum;nextPatientAccountNum string firstName; string lastName; long SSN char gender string birthDate vector patientCheckups static long nextPatientAccountNum;initialize it to 5000 and incremen it by 2 l as you create a new object Checkup class has at least the following private attributes: string checkupDate; double height; double weight int cholestcrol: int hdlCholesterol; int triglycerides; int glucose; string bloodPressure; ll in feet ll in pounds /l/ total cholesterol HDL cholesterol Il Triglycerides concentration /l glucose level ll blood pressure For each class, you need to write the following: an appropriate constructor, set and get functions as needed, and print functions to print the values of the attributes on the screen. The main member functions for the HealthRecords class are summarized below void HealthRecords:createNewPatient (string JName, string IName, long pSSN, char gender, string birthDate) This function creates a new Patient object by calling the appropriate constructor. You should validate the given patient's data before creating a new object. You should not create a new object if pSSN matches an existing patient's SSN; just print an error message. Otherwise, you should create an object and add it to the patientsRecords vector and display a message that the patient object was successfully added.Explanation / Answer
My Header File:
class HealthProfile
{
struct birth
{
int month, day, year;
};
struct Patient
{
string Fname;
string Lname;
char gender;
birth b; //-| Struct previously defined data type
float inches, weight;
};
public:
//-| Accessor Functions
string get_Fname();
string get_Lname();
char get_gender();
float get_height();
float get_weight();
birth get_bday();
birth get_bmonth();
birth get_byear();
//-| Calculation Functions
int person_age(); // Calculate Person's age;
int max_heartrate(int age); // Calculate Max Heart Rate
float body_mass(); // calculate BMI
int targetheartrate(int heart_rate);
//-| Mutator Functions
void set_Fname(string namef);
void set_Lname(string namel);
void set_gender(char a);
void set_height(float inches);
void set_weight(float weights);
void set_bday(int days);
void set_bmonth(int months);
void set_byear(int years);
};
#include "Fields_HealthProfile.cpp"
my implementation file:
//-| Accessor Functions
string get_Fname()
{
return Patient.Fname;
}
string get_Lname()
{
return Patient.Lname;
}
char get_gender()
{
return Patient.gender;
}
float get_height()
{
return Patient.inches;
}
float get_weight()
{
return Patient.weight;
}
birth get_bday()
{
return Patient.b.day;
}
birth get_bmonth();
{
return Patient.b.month;
}
birth get_byear();
{
return Patient.b.year;
}
//-| Mutator Functions
void set_Fname(string namef)
{
Patient.Fname = namef;
}
void set_Lname(string namel)
{
Patient.Lname = namel;
}
void set_gender(char a)
{
Patient.gender = a;
}
void set_height(float inches)
{
Patient.inches = inches;
}
void set_weight(float weights
{
Patient.weight = weights;
}
void set_bday(int days)
{
Patient.b.day = days;
}
void set_bmonth(int months)
{
Patient.b.month = months;
}
void set_byear(int years)
{
Patient.b.year = years;
}
//-| Calculation Functions
int person_age() // Calculate Person's age;
{
int month;
int day;
int year;
cout << "What is the month (in form ex. 01) ?" << endl;
cin >> month;
cout << "What is the day (in form ex. 05) ?" << endl;
cin >> day;
cout << "What is the year (in form ex. 1992) ?" << endl;
cin >> year;
return Patient.b.year - year;
}
int maxheartrate(int age) // Calculate Max Heart Rate
{
return 220 - age;
}
int targetheartrate(int heart_rate) // Calculate Target Heart Rate 50 - 85% of max
{
int target;
target = heart_rate*.6;
return target;
}
float body_mass() // calculate BMI
{
float mass;
float height2;
mass = weight*730;
height2 = Patient.inches * Patient.inches;
mass = mass/height2;
return mass;
}
my main program
#include <iostream>
#include <iomanip>
#include <string>
#include "Fields_HealthProfile.h"
using namespace std;
int main()
{
string a;
char b;
int c;
float e;
//-| Collecting Person's Name
cout << "Enter the person's First Name" << endl;
cin >> a;
set_Fname(a);
cout << "Enter the person's Last Name" << endl;
cin >> a;
set_Lname(a);
//-| Collecting Male or Female
cout << "Enter the person's Gender" << endl;
cin >> b;
set_gender(b);
//-| Collectiong Birth Information
cout << "What is the birth month (in form ex. 01) ?" << endl;
cin >> c;
set_bmonth(c);
cout << "What is the birth day (in form ex. 05) ?" << endl;
cin >> c;
set_bday(c);
cout << "What is the birth year (in form ex. 1992) ?" << endl;
cin >> c;
set_byear(c);
//-| Collecting Height and Weight
cout << "What is the Person's Height in inches?" << endl;
cin >> e;
set_height(e);
cout << "What is the Person's Weight in pounds?" << endl;
cin >> e;
set_weight(e);
//-| Calculating and Printing: Age, BMI, Max Heart Rate, and Target Heart Rate.
int age;
age = person_age();
float bodymass;
bodymass = body_mass();
int mheart;
int theart;
mheart = max_heartrate(age);
theart = targetheartrate(mheart);
cout << "The Person's Age is: " << age << " their BMI is: " << bodymass << " their Maximum Heart Rate is: " << mheart << " and their Target Heart Rate is: " << theart << '.' << endl;
return 0;
}
Edit & Run
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.