// Programmer: Jennifer Leopold date: November 5, 2014
// File: hw8.h
// Purpose: This file contains the header info for the program
// that makes a medical diagnosis for a patient's
// complaint.
#ifndef H8_H
#define H8_H
using namespace std;
// ***********************************************************
// Constants
// Parameter for cin.ignore of '\n'
const short NUM_CHARS_TO_IGNORE_UNTIL_NEWLINE = 500;
// Constraints on number of words in the complaint, how long
// each word will be, and number of words doctor will respond to
const short MAX_COMPLAINT_WORDS = 100;
const short MAX_COMPLAINT_WORD_LENGTH = 20;
const short MAX_WORDS_TO_RESPOND_TO = 5;
// Number of words in a prescription and mg size of dosage
const short NUM_RX_WORDS = 4;
const short RX_DOSAGE = 20;
// Percentage of time sugeries are done
const int HOW_OFTEN_SURGERY_DONE = 75;
// The names of the files containing prescription prefixes
// and surgical procedures
const char PRESCRIPTIONS_FILE[] = "scripts.dat";
const char SURGERIES_FILE[] = "surgeries.dat";
// The particular body parts of interest
const short NUM_BODY_PARTS = 5;
const string BODY_PARTS[] = {"head", "torso", "hand",
"nose", "leg"};
// ***********************************************************
// Function prototypes
// Prompts the user to enter a complaint and builds an array
// of the words uttered in the complaint.
// Preconditions: None
// Postconditions: Returns true if one of the body parts of
// interest was mentioned in the complaint; otherwise, returns
// false. Parameter complaintWords will contain the words
// uttered by the user in his/her complaint (in the order
// uttered). Parameter numWords will be the number of words in
// the user's complaint. Parameter whichBodyPart will be the
// (string) body part of interest mentioned by the user in the
// complaint (if one was mentioned); otherwise, it will be the
// empty string.
bool getHealthComplaint(string complaintWords[],
short &numWords,
string &whichBodyPart);
// Output a few of the words from the user's complaint.
// Preconditions: Parameter complaintWords contains the
// words in positions 0..numWords-1 where numWords is >= 0.
// Postconditions: A randomly selected number of words from
// complaintWords is output.
void respondToComplaint(const string complaintWords[],
const short numWords);
// Output a diagnosis appropriate for the specified body
// part.
// Preconditions: Parameter whichBodyPart is one of the
// entries in BODY_PARTS[].
// Postconditions: A diagnois is output for the specified
// body part where the diagnosis is randomly selected from
// the data file named for the body part.
void decideDiagnosis(const string whichBodyPart);
// Output a prescription for as many pills as there are
// words in the user's complaint.
// Preconditions: Parameter numWords is >= 0.
// Postconditions: A prescription is output for numWords
// many pills where the medication name is constructed from
// randomly selected words in the prescription data file.
void recommendPrescription(const short numWords);
// Output a surgical procedure that the user should have.
// This will only be done HOW_OFTEN_SURGERY_DONE percentage
// of the time.
// Preconditions: None.
// Postconditions: A surgical procedure is output, randomly
// selected from the surgeries data file.
void decideOnSurgery();
#endif