Giter Site home page Giter Site logo

cli-doctor-consultation-project's Introduction

Doctor-Patient Interaction Simulation

Overview

This Ruby application simulates a doctor-patient interaction in a hospital setting. The program features the Patient class, which manages user input and simulates a dynamic conversation with a doctor, including providing basic prescriptions based on the patient's input.

Features

  • User Input for Patient Name: Users can input their name, which is used in the simulated consultation.
  • Handling Empty Input: The application prompts for a response if the user enters nothing, ensuring meaningful interaction.
  • Simulated Waiting Time: A brief wait is simulated before the user is invited to see the doctor.
  • Choice to Proceed or Leave: Users have the option to continue to the doctor's room or leave the simulation.
  • Dynamic Doctor-Patient Interaction: The conversation includes various greetings and responses, with the doctor providing basic prescriptions based on the patient's described symptoms.
  • Conversation Limit: The consultation automatically ends after five exchanges or if the user types 'exit'.

How to Use

  1. Start the Simulation: Run the Ruby script to initiate the simulation. You will be greeted and asked to enter the patient's name.
  2. Interaction with Receptionist: After entering the name, a simulated waiting period occurs, followed by an invitation to the doctor's room.
  3. Consultation with Doctor: Choose to enter the room or leave. Inside, engage in a conversation where the doctor responds to your symptoms and may provide basic prescription advice. If no input is entered, the program will prompt for a response.
  4. Ending the Consultation: The conversation ends automatically after five exchanges or can be manually ended by typing 'exit'.

Class: Patient

The Patient class is central to the application. It handles user interactions and simulates the doctor-patient dialogue.

Methods

  • patient_name: Manages initial greeting and name input.
  • doctor_greeting: Handles the main conversation flow with the doctor.
  • doctor_responses: Generates random doctor responses from a set list.
  • get_prescription: Provides basic prescription suggestions based on the patient's input.

Testing

The application includes tests for the Patient class to ensure its functionality, focusing on the correct assignment and retrieval of the patient's name and the effectiveness of the prescription feature.

cli-doctor-consultation-project's People

Contributors

joannarodriguez134 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.