Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sreynak/hospital

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Hospital Interface

##Learning Competencies

  • Create well-defined classes with a single responsibility
  • Implement clean and flexible interfaces between objects
  • Use effective naming conventions

##Summary

You'll be building an interface for a hospital. The main components are: the actual hospital, employees (janitors, receptionists, and doctors), and patients.

The goal of this challenge is to explore the utility of object-oriented design. You will be building multiple classes and will have to define their interfaces.

This is a fairly open-ended challenge. The expectations are loose, so you will be making most of the decisions about how to design and build your program. Talk it out with your pair. Go to the whiteboard. Argue about names. Have fun!

##Releases

###Release 0 : Basic Objects

####Create the Hospital

Write the code that will create a new hospital object.

What types of attributes or accessors will be needed?

For example, you'll definitely need a name for the hospital. You can also add its location, number of employees, and number of patients.

Create the Patients

Your patients will be stored in the hospital database. (Don't worry about creating a database - just have a way for the hospital to store the patient's records).

Can you think of anything they might inherit from the hospital, or is inheritance not needed here? These design decisions are up to you.

Create the Employees

There are multiple types of employees, and you're free to create your own.

A few obvious examples are doctors, receptionists, and janitors. What attributes and methods might they all share? What will be different for each?

###Release 1 : Build Authentication System

Now imagine you're delivering this software and it's going to run as a Ruby file in Terminal.

You're going to create a single administrator who can add employees and patients, and only this administrator is allowed to create these objects in the system.

You also want to allow the created employees and patients to login and access their medical records. However, a janitor logging in will not be able to access sensitive patient data.

An example of how this interface might look (this is just an idea - you are welcome to implement this feature however you think is best):

$ ruby hospital.rb
> Welcome to Misty River Hospital
> -------------------------------
> Please enter your username:
> ruby_tuesday
> Please enter your password:
> ********
> -------------------------------
> Welcome, ruby_tuesday.  Your access level is: DOCTOR
> -------------------------------
> What would you like to do?
> Options:
> - list_patients
> - view_records <patient_id>
> - add_record <patient_id>
> - remove_record <patient_id> <record_id>

##Optimize Your Learning

As you are coding, ask yourself...

  • How will I use this class?
  • How will this class interact with the other classes?
  • Does this attribute need to be private or public?
  • Are my methods and variables well named?

##Resources

About

hospital interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages