SlideShare a Scribd company logo
1 of 18
Download to read offline
Below is my program, I just have some issues when I want to check out a patient and when I
want to print a specific patient. Please help. I think there is a minor error, but I can't find it.
PATIENT ID MUST BE "LASTNAMEFIRSTNAMEYEAR" example PattersonMathew2005.
Please read instructions help me solve the problem.
In this assignment, you will write a struct plus two simple classes and then write a program
that uses them all. The first class is a Date class. You are given code for this at the end of this
assignment, but you must make some modifications. The other is a Patient class; you are given
the class definition and you must write the implementation. The program will keep track of
patients at a walk-in clinic. For each patient, the clinic keeps a record of all procedures done.
This is a good candidate for a class, but to simplify the assignment, we will make a procedure
into a struct. We will assume that the clinic has assigned all care providers (doctors, nurses, lab
technicians) with IDs and each procedure (“office visit”, “physical exam”, “blood sample taken”,
etc.) also has an ID. Each patient will also have an ID, which is formed by the last name
concatenated with the first name and the year of birth. All other IDs (care providers, procedures)
will be just integers.
When the user runs the program at the start of the day, it first tries to read in from a binary file
calledCurrentPatients.dat. It will contain the number of patients(in binary format) followed by
binary copies of records for the patients at the clinic . This information should be read and stored
in an array of Patient objects. There will be a separate array, initially empty at the start of the
program that will store patient records for all patients who are currently checked in at the clinic.
It then asks the user to enter the current date and reads it in. It should then presents the user with
a simple menu: the letter N to check in a new patient, R for checking in a returning patient, O to
check out a patient, I to print out information on a particular patient, P to print the list of patients
who have checked in, but not yet checked out, and Q for quitting the program.
The following tasks are done when the appropriate letter is chosen.
N: The new patient’s first name, last name, and birthdate are asked for and entered. The new
patient ID will be the last name concatenated with the first name and the year of birth. (Example:
SmithJohn1998) The primary doctor’s ID is also entered. The new patient object is placed in
both arrays: one keeping all patients, and one keeping the patients who checked in today.
R: The returning patient’s ID is asked for, and the array holding all patients is searched for the
patient object. If found, a copy of the patient object is placed in the array for all currently
checked in patients. If not found, the user is returned to the main menu after asking them to
either try R again, making sure the correct ID was entered, or choose N to enter the patient as a
new patient.
O: Using the patient’s ID, the patient object is found in the array holding currently checked in
patients. (If not found, the user is returned to the main menu after asking them to either try O
again, making sure the correct ID was entered, or choose N or R to check in the patient as a new
or returing patient.) The procedure record is updated by entering a new entry, with the current
date, procedure ID, and provider ID. The up-dated patient object is then removed from the array
of currently checked in patients, and replaces the old patient object in the main array. If the
update fails, a message is output.
I: Using the patient’s ID, the main array holding all patients is searched for the patient object. If
found the information it holds: the names, birthdate, the primary doctor ID, and a list of all past
procedures done (date, procedure ID, procedure provider ID) is printed to the monitor.
P: From the array holding all patients currently checked in, a list is printed in nice readable form,
showing the patient ID, first and last names, and the primary doctor ID for each patient.
Q: If the list of patients currently checked in is not empty, the list is printed out and the user
asked to keep running the program so they can be checked out. If the list is empty, the program
will write the patient objects in the main array to the binary file CurrentPatients.dat. It should
overwrite all previous information in the file.
// Definition of class Date in date.h
#ifndef Date_h
#define Date_h
#include
#include
using namespace std;
class Date {
friend ostream &operator<<(ostream &, const Date &); // allows easy output to a ostream
public:
Date(int m = 1, int d = 1, int y = 1900); // constructor, note the default values
void setDate(int, int, int); // set the date
const Date &operator+=(int); // add days, modify object
bool leapYear(int) const; // is this a leap year?
bool endOfMonth(int) const; // is this end of month?
int getMonth() const // You need to implement this
{
return month;
}
int getDay() const // You need to implement this
{
return day;
}
int getYear() const // You need to implement this
{
return year;
}
string getMonthString() const; // You need to implement this
Date& operator=(Date other);//Added by Roberto
private:
int month;
int day;
int year;
static const int days[]; // array of days per month
static const string monthName[]; // array of month names
void helpIncrement(); // utility function
};
#endif
// Member function definitions for Date class in separate date.cpp file
#include
#include "Date.h"
#include
// Initialize static members at file scope;
// one class-wide copy.
const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30,
31, 31, 30, 31, 30, 31 };
const string Date::monthName[] = { "", "January",
"February", "March", "April", "May", "June",
"July", "August", "September", "October",
"November", "December" };
// Date constructor
Date::Date(int m, int d, int y) { setDate(m, d, y); }
// Set the date
void Date::setDate(int mm, int dd, int yy)
{
month = (mm >= 1 && mm <= 12) ? mm : 1;
year = (yy >= 1900 && yy <= 2100) ? yy : 1900;
// test for a leap year
if (month == 2 && leapYear(year))
day = (dd >= 1 && dd <= 29) ? dd : 1;
else
day = (dd >= 1 && dd <= days[month]) ? dd : 1;
}
// Add a specific number of days to a date
const Date &Date::operator+=(int additionalDays)
{
for (int i = 0; i < additionalDays; i++)
helpIncrement();
return *this; // enables cascading
}
// If the year is a leap year, return true;
// otherwise, return false
bool Date::leapYear(int testYear) const
{
if (testYear % 400 == 0 || (testYear % 100 != 0 && testYear % 4 == 0))
return true; // a leap year
else
return false; // not a leap year
}
// Determine if the day is the end of the month
bool Date::endOfMonth(int testDay) const
{
if (month == 2 && leapYear(year))
return (testDay == 29); // last day of Feb. in leap year
else
return (testDay == days[month]);
}
// Function to help increment the date
void Date::helpIncrement()
{
if (!endOfMonth(day)) { // date is not at the end of the month
day++;
}
else if (month < 12) { // date is at the end of the month, but month < 12
day = 1;
++month;
}
else // end of month and year: last day of the year
{
day = 1;
month = 1;
++year;
}
}
//class function added by Roberto
Date& Date :: operator=(Date other)
{
day = other.day;
month = other.month;
year = other.year;
return *this;
}
// Overloaded output operator
ostream &operator<<(ostream &output, const Date &d)
{
output << d.monthName[d.month] << ' '
<< d.day << ", " << d.year;
return output; // enables cascading
}
string Date::getMonthString() const // Added by Roberto
{
return monthName[month];
}
//patient.cpp
#include "Patient.h"
#include
using namespace std;
Patient::Patient()
{
//added after programmed was debugged
/*this->setID('0');
this->setFirstName('0');
this->setLastName('0');
this->setBirthDate(Date());
this->setPrimaryDoctorID(0);*/
}
Patient::Patient(const char *patientID, const char *fName, const char *lName, Date birthDate,
int doctorID)
{
this->setID(patientID);
this->setFirstName(fName);
this->setLastName(lName);
this->setBirthDate(birthDate);
this->setPrimaryDoctorID(doctorID);
}
Patient :: ~Patient()
{
}
Patient & Patient::setID(const char *patientID)
{
if (strlen(patientID) > 32)
strncpy_s(ID, patientID, 32);
else
strcpy_s(ID, patientID);
return(*this);
}
Patient & Patient::setFirstName(const char *fName)
{
if (strlen(fName) > 15)
{
strncpy_s(firstName, fName, 14);
}
else
{
strcpy_s(firstName, fName);
}
return(*this);
}
Patient & Patient::setLastName(const char *lName)
{
if (strlen(lName) > 15)
{
strncpy_s(lastName, lName, 14);
}
else
{
strcpy_s(lastName, lName);
}
return(*this);
}
Patient & Patient::setBirthDate(Date birthDate)
{
birthdate = birthDate;
return(*this);
}
Patient & Patient::setPrimaryDoctorID(int doctorID)
{
primaryDoctorID = doctorID;
return(*this);
}
const char * Patient::getID()
{
return ID;
}
const char * Patient::getFirstName()
{
return firstName;
}
const char * Patient::getLastName()
{
return lastName;
}
Date Patient::getBirthDate()
{
return birthdate;
}
int Patient::getPrimaryDoctorID()
{
return primaryDoctorID;
}
bool Patient::enterProcedure(Date procedureDate, int procedureID, int procedureProviderID)
{
if (currentCountOfProcedures > 500)
{
cout << "Cannot add any more procedures" << endl;
return 0;
}
else
{
procedure newProcedure;
newProcedure.dateOfProcedure = procedureDate;
newProcedure.procedureID = procedureID;
newProcedure.procedureProviderID = procedureProviderID;
//record[currentCountOfProcedures].dateOfProcedure = procedureDate;
// record[currentCountOfProcedures].procedureID = procedureID;
//record[currentCountOfProcedures].procedureProviderID = procedureProviderID;
currentCountOfProcedures++;
return 1;
}
}
void Patient::printAllProcedures()
{
cout << "Procedures of patient" << endl;
for (int i = 0; i < currentCountOfProcedures; i++)
{
cout << "Date of Procedure: " << record[i].dateOfProcedure.getDay() << endl;
cout << "Procedure of ID " << record[i].procedureID << endl;
cout << "Procedure Provider ID: " << record[i].procedureProviderID << endl;
}
}
//recently added
Patient& Patient::operator=(Patient other)
{
strcpy_s(ID, other.ID);
strcpy_s(firstName, other.firstName);
strcpy_s(lastName, other.lastName);
birthdate = other.birthdate;
primaryDoctorID = other.primaryDoctorID;
for (int i = 0; i < other.currentCountOfProcedures; i++)
{
record[i] = other.record[i];
}
currentCountOfProcedures = other.currentCountOfProcedures;
return *this;
}
//patient.h
#ifndef Patient_h
#define Patient_h
#include "Date.h"
#include
#include
struct procedure
{
Date dateOfProcedure;
int procedureID;
int procedureProviderID;
};
class Patient
{
private:
char ID[33];
char firstName[15];
char lastName[15];
Date birthdate;
int primaryDoctorID;
procedure record[100];
int currentCountOfProcedures = 0; //initialized to 0
public:
Patient(); //default constructor
Patient(const char *, const char *, const char *, Date, int);
//Put in default values just as in Date class
//Use the set functions so input values are checked
~Patient();
Patient & setID(const char *); //check if length of name string is < 32.
// if not, shorten to 32 letters.
Patient & setFirstName(const char *); //check if length of name string is <
// 15, if not, shorten to 14 letters.
Patient & setLastName(const char *); //check if length of name string is <
// 15, if not, shorten to 14 letters.
Patient & setBirthDate(Date);
Patient & setPrimaryDoctorID(int);
const char * getID();
const char * getFirstName();
const char * getLastName();
Date getBirthDate();
int getPrimaryDoctorID();
Patient& operator=(Patient other); //Added by Roberto
bool enterProcedure(Date procedureDate, int procedureID,
int procedureProviderID);//tries to add a new entry to record array, returns
//true if added, false if cannot be added
void printAllProcedures();
};
#endif
//main
#include
#include
#include
#include
#include
//Classes added
#include"Patient.h"
#include"Date.h"
using namespace std;
//functions added
void printMenu();
void RemovePatient(Patient checkIn[], int & count, int index);
//main function
int main(int argc, const char* argv[])
{
int procedureID = 0;
Patient checkIn[10];
Patient patient[20];
char userValue;
int i = 0;
char patientID[33];
int doctorID = 0;
int count = 0;
int countAll = 0;
int tempMonth = 0, tempDay = 0, tempYear = 0;
char fName[20], lName[30];
Date tempDate, birthDate;
bool patientFound = false;
//============================ binary to read file ===================
ifstream file;
file.open("PatientHospitalRecords.bin", ios::in | ios::binary);
if (file.is_open())
{
file.read((char*)&countAll, sizeof(int));
for (int i = 0; i < countAll; i++)
{
file.read((char*)&patient[i], sizeof(Patient));
}
file.close();
}
//=========================== Print welcome info =====================
cout << "Welcome to the Hospital Records Program " << endl;
cout << "Please enter the date in integers according to the following format mm dd yyyy: ";
cout << endl;
cin >> tempMonth;
cin.get(); // this will read /
cin >> tempDay;
cin.get(); // this will read the second /
cin >> tempYear;
tempDate.setDate(tempMonth, tempDay, tempYear);
//while statemtn for each letter the user choices.
do
{
printMenu();
cin >> userValue; //user enters value from menue
userValue = toupper(userValue); //Convertion from lowercase to upper case
switch (userValue)
{
case 'N': //Check in a new patient
//statement to check in a new patient fix
cout << "Check in a new patient " << endl;
cout << "First name: ";
cin >> fName;
checkIn[count].setFirstName(fName);
cout << "Last name: ";
cin >> lName;
checkIn[count].setLastName(lName);
cout << "Doctor ID: ";
cin >> doctorID;
checkIn[count].setPrimaryDoctorID(doctorID);
cout << "Patient birthdate: " << endl;
cout << "Day: ";
cin >> tempDay;
cout << "Month: ";
cin >> tempMonth;
cout << "Year: ";
cin >> tempYear;
//added code
//code added after program was debugged
/* char patientID1[33];
strncpy_s(patientID, lName, 14);
strncat_s(patientID, lName, 14);
strcat_s(patientID, fName);
char year[5];
sprintf_s(year, "%d", tempYear);
strcat_s(patientID1, year);
//return(*this);*/
//end of code added when programmed was debugged
checkIn[count].setFirstName(fName);
checkIn[count].setLastName(lName);
checkIn[count].setPrimaryDoctorID(doctorID);
birthDate.setDate(tempMonth, tempDay, tempYear);
checkIn[count].setBirthDate(birthDate);
char year[5];
strncpy_s(patientID, lName, ' ');
strcat_s(patientID, fName);
sprintf_s(year, "%d", tempYear);
strcat_s(patientID, year);
checkIn[count].setID(patientID);
count++;
countAll++;
cout << endl;
cout << " Checking in a patient. " << endl;
break;
case 'R': //check in a returning patient
cout << "Check In a returning patient" << endl;
patientFound = false;
i = 0;
do
{
cout << "Please, enter the patient ID: ";
cin >> patientID;
do
{
if (patient[i].getID() == patientID)
{
checkIn[count] = patient[i];
count++;
patientFound = true;
}
i++;
} while (!patientFound && i < countAll);
if (!patientFound)
{
cout << "Patient entered is not found on records" << endl;
cout << "Would you like to check in as a new Patient (Y/N): ";
cin >> userValue;
}
} while (!patientFound && userValue == toupper('N'));
break;
case 'O': //Check out a patient
patientFound = false;
cout << "Check out a patient: " << endl;
i = 0;
do
{
cout << "Enter Patient ID to proceed the check out: ";
cin >> patientID;
for (int i = 0; i < count; i++)
{
if ((checkIn[i].getID()) == patientID)
{
cout << "Enter doctor's ID: ";
cin >> doctorID;
cout << "Enter patient's ID: ";
cin >> patientID;
checkIn[i].enterProcedure(tempDate, procedureID, doctorID);
//use enterProcedure()
for (int j = 0; j < countAll; j++)
if (patient[j].getID() == checkIn[i].getID())
{
patient[j].enterProcedure(tempDate, tempDay, doctorID);
cout << j;
cout << "Patient ID: " << j + 1 << " has been chekced out " << endl
<< endl;
}
RemovePatient(checkIn, count, i);
patientFound = true;
cout << "Test " << endl;
checkIn[i].printAllProcedures();
}
i++;
}
if (!patientFound)
{
cout << "Patient ID is not in the records " << endl;
cout << "Would you like to check in as a new patient or returning patient? (Y/N):
";
cout << endl;
cout << checkIn[i].getID() << endl << patientID;
cin >> userValue;
}
} while (!patientFound && userValue == toupper('N'));
break;
case 'I': //Print information on particular patient
patientFound = false;
cout << "To display information of the patient, please enter the patient ID: ";
cin >> patientID;
i = 0;
do
{
if (patient[i].getID() == patientID)
{
cout << "Patient ID " << patient[i].getID() << endl;
cout << "Name: " << patient[i].getFirstName() << " " <<
patient[i].getLastName() << endl;
cout << "Birthdate: " << patient[i].getBirthDate() << endl;
cout << "Doctor ID: " << patient[i].getPrimaryDoctorID() << endl;
patient[i].printAllProcedures();
patientFound = true;
}
i++;
} while (!patientFound && i < countAll);
if (!patientFound)
{
cout << "Record not available " << endl;
}
break;
case 'P': //Print list of all patients.
//if statement to print out record of books
cout << "List of all patients still check in: " << endl;
if (count > 0)
{
for (int i = 0; i < count; i++)
{
cout << "Patient ID " << checkIn[i].getID() << endl;
cout << "Name: " << checkIn[i].getFirstName() << " " <<
checkIn[i].getLastName() << endl;
cout << "Birthdate " << checkIn[i].getBirthDate() << endl;
cout << "Doctor ID: " << checkIn[i].getPrimaryDoctorID() << endl;
}
}
else
{
cout << "All patients have been checked out " << endl;
}
break;
case 'Q':
if (count == 0)
{
//=================================== binary to write file
=============================
ofstream oFile;
oFile.open("PatientHospitalRecords.bin", ios::out | ios::binary);
if (oFile.is_open())
{
oFile.write((char*)&countAll, sizeof(int));
for (int i = 0; i < countAll; i++)
oFile.write((char*)&patient[i], sizeof(Patient));
oFile.close();
cout << "You chose to close the patient records program " << endl << "GOOD
BYE!!!";
}
}
else
{
for (int i = 0; i < count; i++)
{
cout << checkIn[i].getID() << endl;
cout << checkIn[i].getFirstName() << " " << checkIn[i].getLastName() << endl;
cout << checkIn[i].getBirthDate() << endl;
cout << checkIn[i].getPrimaryDoctorID() << endl;
}
userValue = 'A';
}
break;
default:
cout << "Error!!! You have entered an invalid value " << endl << "Please try again"
<< endl;
cout << endl;
cout << "Please select another option. ";
cin >> userValue;
userValue = toupper(userValue);
break;
}//end of switch statemnt
}while (userValue != 'Q');//end of do loop
return 0;
}
//void function to print out the menu.
void printMenu()
{
cout << "_________________________________________________" << endl;
cout << "Please enter your one letter choice as follows: " << endl;
cout << "N:tCheck in a new patient: "<< endl;
cout << "R:tCheck in a returning patient: "<< endl;
cout << "O:tChekc out a patient: " << endl;
cout << "I:tPrint out information about a particular patient: " << endl;
cout << "P:tPrint list of patients who have checked in: " << endl;
cout << "Q:tQuit the program" <
Solution
It is hard to let go of the thinking behind some of the management tools we still use today.
Designed for types of work that are no longer prevalent, these systems were designed for another
time.

More Related Content

Similar to Below is my program, I just have some issues when I want to check ou.pdf

Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfMALASADHNANI
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12Abhishek Sinha
 
Design various classes and write a program to computerize the billing.pdf
Design various classes and write a program to computerize the billing.pdfDesign various classes and write a program to computerize the billing.pdf
Design various classes and write a program to computerize the billing.pdfsktambifortune
 
ECE 263264                     Fall 2016 Final Project  .docx
ECE 263264                     Fall 2016 Final Project  .docxECE 263264                     Fall 2016 Final Project  .docx
ECE 263264                     Fall 2016 Final Project  .docxSALU18
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportMatthew Zackschewski
 
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdfstruct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdfanonaeon
 
Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Ritika sahu
 
web-application.pdf
web-application.pdfweb-application.pdf
web-application.pdfouiamouhdifa
 
Insurance Optimization
Insurance OptimizationInsurance Optimization
Insurance OptimizationAlbert Chu
 
In C++ 154 Define a base class called Person The .pdf
In C++ 154   Define a base class called Person The .pdfIn C++ 154   Define a base class called Person The .pdf
In C++ 154 Define a base class called Person The .pdfaayushmaany2k14
 
programming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfprogramming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfARCHANASTOREKOTA
 
Hospital management system
Hospital management systemHospital management system
Hospital management systemSouravdhoni
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdfannucommunication1
 
Implement in C++Create a class named Doctor that has three member .pdf
Implement in C++Create a class named Doctor that has three member .pdfImplement in C++Create a class named Doctor that has three member .pdf
Implement in C++Create a class named Doctor that has three member .pdfcronkwurphyb44502
 
Data Science Academy Student Demo day--Michael blecher,the importance of clea...
Data Science Academy Student Demo day--Michael blecher,the importance of clea...Data Science Academy Student Demo day--Michael blecher,the importance of clea...
Data Science Academy Student Demo day--Michael blecher,the importance of clea...Vivian S. Zhang
 
Tasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfTasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfacsmadurai
 
Java căn bản - Chapter10
Java căn bản - Chapter10Java căn bản - Chapter10
Java căn bản - Chapter10Vince Vo
 
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...IJCSES Journal
 

Similar to Below is my program, I just have some issues when I want to check ou.pdf (20)

Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdf
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12
 
Design various classes and write a program to computerize the billing.pdf
Design various classes and write a program to computerize the billing.pdfDesign various classes and write a program to computerize the billing.pdf
Design various classes and write a program to computerize the billing.pdf
 
ECE 263264                     Fall 2016 Final Project  .docx
ECE 263264                     Fall 2016 Final Project  .docxECE 263264                     Fall 2016 Final Project  .docx
ECE 263264                     Fall 2016 Final Project  .docx
 
CMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End ReportCMPSC 122 Project 1 Back End Report
CMPSC 122 Project 1 Back End Report
 
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdfstruct procedure {    Date dateOfProcedure;    int procedureID.pdf
struct procedure {    Date dateOfProcedure;    int procedureID.pdf
 
Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.Hospital management project_BY RITIKA SAHU.
Hospital management project_BY RITIKA SAHU.
 
web-application.pdf
web-application.pdfweb-application.pdf
web-application.pdf
 
Numerical data.
Numerical data.Numerical data.
Numerical data.
 
Insurance Optimization
Insurance OptimizationInsurance Optimization
Insurance Optimization
 
In C++ 154 Define a base class called Person The .pdf
In C++ 154   Define a base class called Person The .pdfIn C++ 154   Define a base class called Person The .pdf
In C++ 154 Define a base class called Person The .pdf
 
programming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdfprogramming Code in C thatloops requesting information about patie.pdf
programming Code in C thatloops requesting information about patie.pdf
 
OM Analytics.pdf
OM Analytics.pdfOM Analytics.pdf
OM Analytics.pdf
 
Hospital management system
Hospital management systemHospital management system
Hospital management system
 
#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf#include iostream #includeData.h #includePerson.h#in.pdf
#include iostream #includeData.h #includePerson.h#in.pdf
 
Implement in C++Create a class named Doctor that has three member .pdf
Implement in C++Create a class named Doctor that has three member .pdfImplement in C++Create a class named Doctor that has three member .pdf
Implement in C++Create a class named Doctor that has three member .pdf
 
Data Science Academy Student Demo day--Michael blecher,the importance of clea...
Data Science Academy Student Demo day--Michael blecher,the importance of clea...Data Science Academy Student Demo day--Michael blecher,the importance of clea...
Data Science Academy Student Demo day--Michael blecher,the importance of clea...
 
Tasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdfTasks In this assignment you are required to design and imp.pdf
Tasks In this assignment you are required to design and imp.pdf
 
Java căn bản - Chapter10
Java căn bản - Chapter10Java căn bản - Chapter10
Java căn bản - Chapter10
 
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...
THE IMPLICATION OF STATISTICAL ANALYSIS AND FEATURE ENGINEERING FOR MODEL BUI...
 

More from dhavalbl38

Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfImagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfdhavalbl38
 
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfIf a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfdhavalbl38
 
Help with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfHelp with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfdhavalbl38
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfdhavalbl38
 
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfEmperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfdhavalbl38
 
Even before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfEven before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfdhavalbl38
 
Do the following picSolutionHere is the solution for the .pdf
Do the following picSolutionHere is the solution for the .pdfDo the following picSolutionHere is the solution for the .pdf
Do the following picSolutionHere is the solution for the .pdfdhavalbl38
 
Can one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfCan one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfdhavalbl38
 
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfwhy is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfdhavalbl38
 
Which of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfWhich of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfdhavalbl38
 
What is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfWhat is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfdhavalbl38
 
what are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfwhat are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfdhavalbl38
 
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfWACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfdhavalbl38
 
Two particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfTwo particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfdhavalbl38
 
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
The forecast equation for mean wind in a turbulent flow is  U_it + .pdfThe forecast equation for mean wind in a turbulent flow is  U_it + .pdf
The forecast equation for mean wind in a turbulent flow is U_it + .pdfdhavalbl38
 
The image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfThe image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfdhavalbl38
 
The concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfThe concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfdhavalbl38
 
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfThe diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfdhavalbl38
 
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfaed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfdhavalbl38
 
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdft t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdfdhavalbl38
 

More from dhavalbl38 (20)

Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdfImagine a spherical balloon filled wild helium- the balloon itself is.pdf
Imagine a spherical balloon filled wild helium- the balloon itself is.pdf
 
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdfIf a substance has a pH of 4, is it acidic or basic. What type of io.pdf
If a substance has a pH of 4, is it acidic or basic. What type of io.pdf
 
Help with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdfHelp with answering these questions for my Human Health Class Biolog.pdf
Help with answering these questions for my Human Health Class Biolog.pdf
 
For each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdfFor each task, submit your source java code file.(1) Objective Im.pdf
For each task, submit your source java code file.(1) Objective Im.pdf
 
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdfEmperor penguins live on a diet of fish and crustaceans obtained fro.pdf
Emperor penguins live on a diet of fish and crustaceans obtained fro.pdf
 
Even before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdfEven before the Ownership Society programs of Presidents Clinton.pdf
Even before the Ownership Society programs of Presidents Clinton.pdf
 
Do the following picSolutionHere is the solution for the .pdf
Do the following picSolutionHere is the solution for the .pdfDo the following picSolutionHere is the solution for the .pdf
Do the following picSolutionHere is the solution for the .pdf
 
Can one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdfCan one mRNA be translated into more than one protein sequence Can .pdf
Can one mRNA be translated into more than one protein sequence Can .pdf
 
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdfwhy is there an uneven distribution of photosystem 1 and 2 on the th.pdf
why is there an uneven distribution of photosystem 1 and 2 on the th.pdf
 
Which of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdfWhich of the following are examples of cell signaling Choose all tha.pdf
Which of the following are examples of cell signaling Choose all tha.pdf
 
What is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdfWhat is the purpose of testing a program with different dataSol.pdf
What is the purpose of testing a program with different dataSol.pdf
 
what are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdfwhat are the factors contributing to the rise in global media Will .pdf
what are the factors contributing to the rise in global media Will .pdf
 
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdfWACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
WACC of Alibaba company WACC of Alibaba companySolutionTh.pdf
 
Two particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdfTwo particles A and B of equal mass have velocities as shown in the f.pdf
Two particles A and B of equal mass have velocities as shown in the f.pdf
 
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
The forecast equation for mean wind in a turbulent flow is  U_it + .pdfThe forecast equation for mean wind in a turbulent flow is  U_it + .pdf
The forecast equation for mean wind in a turbulent flow is U_it + .pdf
 
The image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdfThe image below is of a charged moving in a uniform magnetic field. I.pdf
The image below is of a charged moving in a uniform magnetic field. I.pdf
 
The concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdfThe concept of a sampling distributionA-Is essential for drawing c.pdf
The concept of a sampling distributionA-Is essential for drawing c.pdf
 
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdfThe diets common to some cultures emphasize meat. Meat, milk, and br.pdf
The diets common to some cultures emphasize meat. Meat, milk, and br.pdf
 
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdfaed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
aed by genes at two loci R. rand P. p). A walnut comb is at one Tocus.pdf
 
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdft t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
t t Deg g olthe year.) 4.9 An engineering construction firm is .pdf
 

Recently uploaded

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Below is my program, I just have some issues when I want to check ou.pdf

  • 1. Below is my program, I just have some issues when I want to check out a patient and when I want to print a specific patient. Please help. I think there is a minor error, but I can't find it. PATIENT ID MUST BE "LASTNAMEFIRSTNAMEYEAR" example PattersonMathew2005. Please read instructions help me solve the problem. In this assignment, you will write a struct plus two simple classes and then write a program that uses them all. The first class is a Date class. You are given code for this at the end of this assignment, but you must make some modifications. The other is a Patient class; you are given the class definition and you must write the implementation. The program will keep track of patients at a walk-in clinic. For each patient, the clinic keeps a record of all procedures done. This is a good candidate for a class, but to simplify the assignment, we will make a procedure into a struct. We will assume that the clinic has assigned all care providers (doctors, nurses, lab technicians) with IDs and each procedure (“office visit”, “physical exam”, “blood sample taken”, etc.) also has an ID. Each patient will also have an ID, which is formed by the last name concatenated with the first name and the year of birth. All other IDs (care providers, procedures) will be just integers. When the user runs the program at the start of the day, it first tries to read in from a binary file calledCurrentPatients.dat. It will contain the number of patients(in binary format) followed by binary copies of records for the patients at the clinic . This information should be read and stored in an array of Patient objects. There will be a separate array, initially empty at the start of the program that will store patient records for all patients who are currently checked in at the clinic. It then asks the user to enter the current date and reads it in. It should then presents the user with a simple menu: the letter N to check in a new patient, R for checking in a returning patient, O to check out a patient, I to print out information on a particular patient, P to print the list of patients who have checked in, but not yet checked out, and Q for quitting the program. The following tasks are done when the appropriate letter is chosen. N: The new patient’s first name, last name, and birthdate are asked for and entered. The new patient ID will be the last name concatenated with the first name and the year of birth. (Example: SmithJohn1998) The primary doctor’s ID is also entered. The new patient object is placed in both arrays: one keeping all patients, and one keeping the patients who checked in today. R: The returning patient’s ID is asked for, and the array holding all patients is searched for the patient object. If found, a copy of the patient object is placed in the array for all currently checked in patients. If not found, the user is returned to the main menu after asking them to either try R again, making sure the correct ID was entered, or choose N to enter the patient as a new patient. O: Using the patient’s ID, the patient object is found in the array holding currently checked in
  • 2. patients. (If not found, the user is returned to the main menu after asking them to either try O again, making sure the correct ID was entered, or choose N or R to check in the patient as a new or returing patient.) The procedure record is updated by entering a new entry, with the current date, procedure ID, and provider ID. The up-dated patient object is then removed from the array of currently checked in patients, and replaces the old patient object in the main array. If the update fails, a message is output. I: Using the patient’s ID, the main array holding all patients is searched for the patient object. If found the information it holds: the names, birthdate, the primary doctor ID, and a list of all past procedures done (date, procedure ID, procedure provider ID) is printed to the monitor. P: From the array holding all patients currently checked in, a list is printed in nice readable form, showing the patient ID, first and last names, and the primary doctor ID for each patient. Q: If the list of patients currently checked in is not empty, the list is printed out and the user asked to keep running the program so they can be checked out. If the list is empty, the program will write the patient objects in the main array to the binary file CurrentPatients.dat. It should overwrite all previous information in the file. // Definition of class Date in date.h #ifndef Date_h #define Date_h #include #include using namespace std; class Date { friend ostream &operator<<(ostream &, const Date &); // allows easy output to a ostream public: Date(int m = 1, int d = 1, int y = 1900); // constructor, note the default values void setDate(int, int, int); // set the date const Date &operator+=(int); // add days, modify object bool leapYear(int) const; // is this a leap year? bool endOfMonth(int) const; // is this end of month? int getMonth() const // You need to implement this { return month; } int getDay() const // You need to implement this { return day;
  • 3. } int getYear() const // You need to implement this { return year; } string getMonthString() const; // You need to implement this Date& operator=(Date other);//Added by Roberto private: int month; int day; int year; static const int days[]; // array of days per month static const string monthName[]; // array of month names void helpIncrement(); // utility function }; #endif // Member function definitions for Date class in separate date.cpp file #include #include "Date.h" #include // Initialize static members at file scope; // one class-wide copy. const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const string Date::monthName[] = { "", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; // Date constructor Date::Date(int m, int d, int y) { setDate(m, d, y); } // Set the date void Date::setDate(int mm, int dd, int yy) { month = (mm >= 1 && mm <= 12) ? mm : 1;
  • 4. year = (yy >= 1900 && yy <= 2100) ? yy : 1900; // test for a leap year if (month == 2 && leapYear(year)) day = (dd >= 1 && dd <= 29) ? dd : 1; else day = (dd >= 1 && dd <= days[month]) ? dd : 1; } // Add a specific number of days to a date const Date &Date::operator+=(int additionalDays) { for (int i = 0; i < additionalDays; i++) helpIncrement(); return *this; // enables cascading } // If the year is a leap year, return true; // otherwise, return false bool Date::leapYear(int testYear) const { if (testYear % 400 == 0 || (testYear % 100 != 0 && testYear % 4 == 0)) return true; // a leap year else return false; // not a leap year } // Determine if the day is the end of the month bool Date::endOfMonth(int testDay) const { if (month == 2 && leapYear(year)) return (testDay == 29); // last day of Feb. in leap year else return (testDay == days[month]); } // Function to help increment the date void Date::helpIncrement() {
  • 5. if (!endOfMonth(day)) { // date is not at the end of the month day++; } else if (month < 12) { // date is at the end of the month, but month < 12 day = 1; ++month; } else // end of month and year: last day of the year { day = 1; month = 1; ++year; } } //class function added by Roberto Date& Date :: operator=(Date other) { day = other.day; month = other.month; year = other.year; return *this; } // Overloaded output operator ostream &operator<<(ostream &output, const Date &d) { output << d.monthName[d.month] << ' ' << d.day << ", " << d.year; return output; // enables cascading } string Date::getMonthString() const // Added by Roberto { return monthName[month]; } //patient.cpp #include "Patient.h" #include
  • 6. using namespace std; Patient::Patient() { //added after programmed was debugged /*this->setID('0'); this->setFirstName('0'); this->setLastName('0'); this->setBirthDate(Date()); this->setPrimaryDoctorID(0);*/ } Patient::Patient(const char *patientID, const char *fName, const char *lName, Date birthDate, int doctorID) { this->setID(patientID); this->setFirstName(fName); this->setLastName(lName); this->setBirthDate(birthDate); this->setPrimaryDoctorID(doctorID); } Patient :: ~Patient() { } Patient & Patient::setID(const char *patientID) { if (strlen(patientID) > 32) strncpy_s(ID, patientID, 32); else strcpy_s(ID, patientID); return(*this); } Patient & Patient::setFirstName(const char *fName) { if (strlen(fName) > 15) {
  • 7. strncpy_s(firstName, fName, 14); } else { strcpy_s(firstName, fName); } return(*this); } Patient & Patient::setLastName(const char *lName) { if (strlen(lName) > 15) { strncpy_s(lastName, lName, 14); } else { strcpy_s(lastName, lName); } return(*this); } Patient & Patient::setBirthDate(Date birthDate) { birthdate = birthDate; return(*this); } Patient & Patient::setPrimaryDoctorID(int doctorID) { primaryDoctorID = doctorID; return(*this); } const char * Patient::getID() { return ID; } const char * Patient::getFirstName() {
  • 8. return firstName; } const char * Patient::getLastName() { return lastName; } Date Patient::getBirthDate() { return birthdate; } int Patient::getPrimaryDoctorID() { return primaryDoctorID; } bool Patient::enterProcedure(Date procedureDate, int procedureID, int procedureProviderID) { if (currentCountOfProcedures > 500) { cout << "Cannot add any more procedures" << endl; return 0; } else { procedure newProcedure; newProcedure.dateOfProcedure = procedureDate; newProcedure.procedureID = procedureID; newProcedure.procedureProviderID = procedureProviderID; //record[currentCountOfProcedures].dateOfProcedure = procedureDate; // record[currentCountOfProcedures].procedureID = procedureID; //record[currentCountOfProcedures].procedureProviderID = procedureProviderID; currentCountOfProcedures++; return 1; } } void Patient::printAllProcedures() {
  • 9. cout << "Procedures of patient" << endl; for (int i = 0; i < currentCountOfProcedures; i++) { cout << "Date of Procedure: " << record[i].dateOfProcedure.getDay() << endl; cout << "Procedure of ID " << record[i].procedureID << endl; cout << "Procedure Provider ID: " << record[i].procedureProviderID << endl; } } //recently added Patient& Patient::operator=(Patient other) { strcpy_s(ID, other.ID); strcpy_s(firstName, other.firstName); strcpy_s(lastName, other.lastName); birthdate = other.birthdate; primaryDoctorID = other.primaryDoctorID; for (int i = 0; i < other.currentCountOfProcedures; i++) { record[i] = other.record[i]; } currentCountOfProcedures = other.currentCountOfProcedures; return *this; } //patient.h #ifndef Patient_h #define Patient_h #include "Date.h" #include #include struct procedure { Date dateOfProcedure; int procedureID; int procedureProviderID; }; class Patient
  • 10. { private: char ID[33]; char firstName[15]; char lastName[15]; Date birthdate; int primaryDoctorID; procedure record[100]; int currentCountOfProcedures = 0; //initialized to 0 public: Patient(); //default constructor Patient(const char *, const char *, const char *, Date, int); //Put in default values just as in Date class //Use the set functions so input values are checked ~Patient(); Patient & setID(const char *); //check if length of name string is < 32. // if not, shorten to 32 letters. Patient & setFirstName(const char *); //check if length of name string is < // 15, if not, shorten to 14 letters. Patient & setLastName(const char *); //check if length of name string is < // 15, if not, shorten to 14 letters. Patient & setBirthDate(Date); Patient & setPrimaryDoctorID(int); const char * getID(); const char * getFirstName(); const char * getLastName(); Date getBirthDate(); int getPrimaryDoctorID(); Patient& operator=(Patient other); //Added by Roberto bool enterProcedure(Date procedureDate, int procedureID, int procedureProviderID);//tries to add a new entry to record array, returns //true if added, false if cannot be added void printAllProcedures(); }; #endif
  • 11. //main #include #include #include #include #include //Classes added #include"Patient.h" #include"Date.h" using namespace std; //functions added void printMenu(); void RemovePatient(Patient checkIn[], int & count, int index); //main function int main(int argc, const char* argv[]) { int procedureID = 0; Patient checkIn[10]; Patient patient[20]; char userValue; int i = 0; char patientID[33]; int doctorID = 0; int count = 0; int countAll = 0; int tempMonth = 0, tempDay = 0, tempYear = 0; char fName[20], lName[30]; Date tempDate, birthDate; bool patientFound = false; //============================ binary to read file =================== ifstream file; file.open("PatientHospitalRecords.bin", ios::in | ios::binary); if (file.is_open()) { file.read((char*)&countAll, sizeof(int)); for (int i = 0; i < countAll; i++)
  • 12. { file.read((char*)&patient[i], sizeof(Patient)); } file.close(); } //=========================== Print welcome info ===================== cout << "Welcome to the Hospital Records Program " << endl; cout << "Please enter the date in integers according to the following format mm dd yyyy: "; cout << endl; cin >> tempMonth; cin.get(); // this will read / cin >> tempDay; cin.get(); // this will read the second / cin >> tempYear; tempDate.setDate(tempMonth, tempDay, tempYear); //while statemtn for each letter the user choices. do { printMenu(); cin >> userValue; //user enters value from menue userValue = toupper(userValue); //Convertion from lowercase to upper case switch (userValue) { case 'N': //Check in a new patient //statement to check in a new patient fix cout << "Check in a new patient " << endl; cout << "First name: "; cin >> fName; checkIn[count].setFirstName(fName); cout << "Last name: "; cin >> lName; checkIn[count].setLastName(lName); cout << "Doctor ID: "; cin >> doctorID; checkIn[count].setPrimaryDoctorID(doctorID);
  • 13. cout << "Patient birthdate: " << endl; cout << "Day: "; cin >> tempDay; cout << "Month: "; cin >> tempMonth; cout << "Year: "; cin >> tempYear; //added code //code added after program was debugged /* char patientID1[33]; strncpy_s(patientID, lName, 14); strncat_s(patientID, lName, 14); strcat_s(patientID, fName); char year[5]; sprintf_s(year, "%d", tempYear); strcat_s(patientID1, year); //return(*this);*/ //end of code added when programmed was debugged checkIn[count].setFirstName(fName); checkIn[count].setLastName(lName); checkIn[count].setPrimaryDoctorID(doctorID); birthDate.setDate(tempMonth, tempDay, tempYear); checkIn[count].setBirthDate(birthDate); char year[5]; strncpy_s(patientID, lName, ' '); strcat_s(patientID, fName); sprintf_s(year, "%d", tempYear); strcat_s(patientID, year); checkIn[count].setID(patientID); count++; countAll++; cout << endl; cout << " Checking in a patient. " << endl; break;
  • 14. case 'R': //check in a returning patient cout << "Check In a returning patient" << endl; patientFound = false; i = 0; do { cout << "Please, enter the patient ID: "; cin >> patientID; do { if (patient[i].getID() == patientID) { checkIn[count] = patient[i]; count++; patientFound = true; } i++; } while (!patientFound && i < countAll); if (!patientFound) { cout << "Patient entered is not found on records" << endl; cout << "Would you like to check in as a new Patient (Y/N): "; cin >> userValue; } } while (!patientFound && userValue == toupper('N')); break; case 'O': //Check out a patient patientFound = false; cout << "Check out a patient: " << endl; i = 0; do { cout << "Enter Patient ID to proceed the check out: "; cin >> patientID; for (int i = 0; i < count; i++) {
  • 15. if ((checkIn[i].getID()) == patientID) { cout << "Enter doctor's ID: "; cin >> doctorID; cout << "Enter patient's ID: "; cin >> patientID; checkIn[i].enterProcedure(tempDate, procedureID, doctorID); //use enterProcedure() for (int j = 0; j < countAll; j++) if (patient[j].getID() == checkIn[i].getID()) { patient[j].enterProcedure(tempDate, tempDay, doctorID); cout << j; cout << "Patient ID: " << j + 1 << " has been chekced out " << endl << endl; } RemovePatient(checkIn, count, i); patientFound = true; cout << "Test " << endl; checkIn[i].printAllProcedures(); } i++; } if (!patientFound) { cout << "Patient ID is not in the records " << endl; cout << "Would you like to check in as a new patient or returning patient? (Y/N): "; cout << endl; cout << checkIn[i].getID() << endl << patientID; cin >> userValue; } } while (!patientFound && userValue == toupper('N')); break; case 'I': //Print information on particular patient patientFound = false;
  • 16. cout << "To display information of the patient, please enter the patient ID: "; cin >> patientID; i = 0; do { if (patient[i].getID() == patientID) { cout << "Patient ID " << patient[i].getID() << endl; cout << "Name: " << patient[i].getFirstName() << " " << patient[i].getLastName() << endl; cout << "Birthdate: " << patient[i].getBirthDate() << endl; cout << "Doctor ID: " << patient[i].getPrimaryDoctorID() << endl; patient[i].printAllProcedures(); patientFound = true; } i++; } while (!patientFound && i < countAll); if (!patientFound) { cout << "Record not available " << endl; } break; case 'P': //Print list of all patients. //if statement to print out record of books cout << "List of all patients still check in: " << endl; if (count > 0) { for (int i = 0; i < count; i++) { cout << "Patient ID " << checkIn[i].getID() << endl; cout << "Name: " << checkIn[i].getFirstName() << " " << checkIn[i].getLastName() << endl; cout << "Birthdate " << checkIn[i].getBirthDate() << endl; cout << "Doctor ID: " << checkIn[i].getPrimaryDoctorID() << endl; } }
  • 17. else { cout << "All patients have been checked out " << endl; } break; case 'Q': if (count == 0) { //=================================== binary to write file ============================= ofstream oFile; oFile.open("PatientHospitalRecords.bin", ios::out | ios::binary); if (oFile.is_open()) { oFile.write((char*)&countAll, sizeof(int)); for (int i = 0; i < countAll; i++) oFile.write((char*)&patient[i], sizeof(Patient)); oFile.close(); cout << "You chose to close the patient records program " << endl << "GOOD BYE!!!"; } } else { for (int i = 0; i < count; i++) { cout << checkIn[i].getID() << endl; cout << checkIn[i].getFirstName() << " " << checkIn[i].getLastName() << endl; cout << checkIn[i].getBirthDate() << endl; cout << checkIn[i].getPrimaryDoctorID() << endl; } userValue = 'A'; } break; default: cout << "Error!!! You have entered an invalid value " << endl << "Please try again"
  • 18. << endl; cout << endl; cout << "Please select another option. "; cin >> userValue; userValue = toupper(userValue); break; }//end of switch statemnt }while (userValue != 'Q');//end of do loop return 0; } //void function to print out the menu. void printMenu() { cout << "_________________________________________________" << endl; cout << "Please enter your one letter choice as follows: " << endl; cout << "N:tCheck in a new patient: "<< endl; cout << "R:tCheck in a returning patient: "<< endl; cout << "O:tChekc out a patient: " << endl; cout << "I:tPrint out information about a particular patient: " << endl; cout << "P:tPrint list of patients who have checked in: " << endl; cout << "Q:tQuit the program" < Solution It is hard to let go of the thinking behind some of the management tools we still use today. Designed for types of work that are no longer prevalent, these systems were designed for another time.