The examination room is freed

Assignment Help C/C++ Programming
Reference no: EM13766536

The local medical clinic has decided to automate its scheduling services. You have been assigned to design the initial version of the schedules. The basic functions that the clinic has in mind are doctor check-in and check-out and patient check-in and check-out.

A doctor checks in by telling the scheduler his or her name, an examination room number, and a medical specialty code. Each doctor has a favorite room. The scheduler checks to see whether the room is free. If so, it assigns this doctor to the room; if not, it rejects the request with a message, and the doctor can try again to check in. When a doctor checks out, the examination room is freed.

A patient checking in gives a name, age, specialist code, and emergency indication. The scheduler tries to match up the patient with a doctor according to a set of rules that are described here. If there is a match, the patient is seen by the assigned doctor. If this doctor is currently seeing a patient, the new patient is queued to see the doctor. 

The rules for assigning doctors to patients are as follows:

Any patient under age 16 is assigned to see a pediatrician.

Patients age 16 and older are assigned a doctor according to the specialty requested. If there is no doctor in the clinic with the requested specialty, the patient is assigned to a general practitioner (GP). If there is no GP, the patient can be assigned to any doctor.

If there is more than one doctor of the requested specialty, the patient is assigned to the doctor with the shortest waiting list.

When a patient checks out, the doctor he or she was assigned to is available to see the next patient, if there is anyone in the waiting list.

Input

Because this is an interactive system, your program should prompt the users to input the correct information. The initial prompt is

' Type D for Doctor or P for Patient: '


The next prompt is


Type I for check-in or O for checkout:


According to the request, your program should prompt the user for any other needed information, as indicated in the following table:

Action

Additional Information

Doctor check-in

Doctor check-out

Patient check-in

Patient check-out

Doctor's name

Room number

Specialty code

Doctor's name

Patient's name

Age

Specialty (code requested)

Patient's name

Room number




You may define the format for the input processed by your program.

Output

The output for each request is in the form of messages to the user, according to the request, as indicated in the following table.

Action

Message

Doctor check-in

Doctor check-out

Patient check-in

Patient check-out

Confirmation that room is available or Error message if room is in use.

Good-bye message

Message telling patient which room to go to and which doctor has been assigned. If no doctor is available, apologetic message.

Good-bye message. At a later time we may add billing information at this point.

In addition to printing the messages on the screen, you should also write the requests and messages to a transaction file (trans.out), to be turned in with your program listing.

Details and Assumptions

There are l 00 examination rooms at the clinic, each with a waiting room attached.

Specialty codes are as follows: 

Pediatrics PED

General practice GEN

Internal medicine INT

Cardiology CAR

Surgeon SUR

Obstetrics OBS

Psychiatry PSY

Neurology NEU

Orthopedics ORT

Dermatology DET

Ophthalmology OPT

Ear, Nose, and Throat ENT

You may assume that no patient leaves without checking out. (That is, every doctor becomes free eventually.)

No one leaves before he or she sees the assigned doctor. (That is, no one has to be taken out of the waiting queue.) The clinic is open 24 hours a day, 7 days a week.

If a doctor checks out while there is still a waiting list of patients assigned to him or her, the patients must be reassigned to other doctors.


Data Structures

The basic data structure is a list of examination rooms with waiting lists attached to each. Because the number of rooms is fixed, you may use an array of records to represent it. It is the waiting list attached to each examination room that is of interest to us. We have seen that patients are seen in the order in which they are added to the list (a simple queue). 

Deliverables

Your design including CRC cards for each class

A listing of your source program including all included files

A listing of your test plan as input to the program

A listing of your output from the test plan 

Reference no: EM13766536

Questions Cloud

System analyst and design-business process-functional model : Advanced Business Systems (ABS) is a consulting and staffing company providing specialized staffing and consulting services to clients in a variety of different industries. It has offices in major U.S. metro areas and has ongoing relationships wit..
Write a paper analyzing laws and policies of child protectio : Write a paper analyzing laws and policies of child protection. Answer the following questions: What protections do they provide currently? What are the benefits of these protections
True or false questions of profit & loss : Some industries commonly use two-part pricing, breaking the price down into a fixed fee and a fixed usage rate.( )
Analyze the key ethical challenges of privatization : Analyze the key ethical challenges of privatization. Take a position on whether the private sector should be responsible for program outcomes of a public program or service.
The examination room is freed : A doctor checks in by telling the scheduler his or her name, an examination room number, and a medical specialty code. Each doctor has a favorite room. The scheduler checks to see whether the room is free. If so, it assigns this doctor to the room; i..
What response can you legally expect to receive from owner : What are the ramifications of this situation? What response can you legally expect to receive from the owner? Why? Justify your answers using examples and reasoning
What are common stereotypes of the specific minority groups : What are common stereotypes of the specific minority groups explained in the training guide? How may one differentiate those stereotypes from accurate descriptions of the minority groups?
Discuss the differences between treatment and rehabilitation : How have things changed with the way professionals deal with mental illness? There have been significant changes in the way inmates are treated. Discuss the differences between treatment and rehabilitation verses incarceration. Is there room for b..
Research paper on arrays and use single dimension arrays : Create codes for the following problem/s. Compile, test run, and edit them if necessary. Include your original .cpp and related file(s) (if any) in a single folder. Compress (zip) the folder and submit the single zipped folder.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  The first will be a structure called point

Create two structures. The first will be a structure called Point and will have as its data members an x and y coordinate. The second will be called Line and will have two Point structures as its data members.

  Question 1the figure given is an example of select onea

question 1the figure given is an example of select onea. class adapter pattern b. observer pattern c. composite

  Searching f and removing certain states from the hash table

use the class hashT, ''Hashing: Implementation Using Quadratic Probing,'' which uses quadratic probing to resolve collision, to create a hash table to keep track of each state's information. Use the state's name as the key to determine the hash addre..

  Write a program in which the program prints out

Use (switch statement) to write a program in which the program prints out the input (single character) if the character is not '2','t', or 'w'. Use 'default' and 'break' wisely.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Write a function named putinorder

Write a function named "PutInOrder" that has 2 double reference parameters (say a and b). The function rearranges the values pointed to by a and b such that a points to the smallest value and b to the largest value.

  Write function to accept character array

Write down the C++ function which will accept the character array of at most 30 cells. Your function must return true if string and its reverse are identical;

  Write a prototype for a function named triple

Write a prototype for a function named triple that returns a double and has one integer parameter and

  Write the class definition for a class called complex

. Write the class definition for a class called complex.

  Grab the tokens from the token vector and find single quot

There is segmentation fault in this code and I don't know where or how to fix it. The purpose of this code right here is to grab the tokens from the token vecctor and find single quotes.

  Determining the volume of the unit sphere

Write a C program for determining the volume of the unit sphere by the Monte Carlo Method      \(x^{2}+ y^{2} + z^{2} 0, y > 0, z > 0.\)    : This is what I have so far, but it's not working.

  Operating system and cpu scheduling

Operating System and CPU Scheduling

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd