Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/AboutUs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# About us

Display | Name | Github Profile | Portfolio
--------|:----:|:--------------:|:---------:
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md)
Binary file added docs/ByeCommand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/ByeCommand.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@startuml
'https://plantuml.com/sequence-diagram


User -> ":Duke": bye
":Duke" -> ":parser": getCommand()
":parser" --> ":Duke": fullCommand
":Duke" -> ":Ui": sayGoodbye()
":Ui" --> ":Duke": Goodbye message
":Duke" --> User: Goodbye message


@enduml
40 changes: 40 additions & 0 deletions docs/ClassDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@startuml
'https://plantuml.com/class-diagram

abstract class AbstractList
abstract AbstractCollection
interface List
interface Collection

List <|-- AbstractList
Collection <|-- AbstractCollection

Collection <|- List
AbstractCollection <|- AbstractList
AbstractList <|-- ArrayList

class DoctorList {
doctors: ArrayList<Doctor>
size: Integer
DoctorList()
getDoctor(index: Integer): Person
addDoctor(doctor: Doctor)
deleteDoctor(index: Integer)
toString(): String
}

class Person {

}

class Doctor {

}

enum TimeUnit {
DAYS
HOURS
MINUTES
}

@enduml
47 changes: 47 additions & 0 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Developer Guide

## Acknowledgements

{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}

## Design & implementation

{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.}

### Exit program
Step 1: User type "bye" as input to exit the program. Duke will call Parser#getCommand()
to return the user command received.

Step 2: After checking the user command is "bye", Duke will
call Ui#sayGoodbye to print Goodbye message

The following sequence diagram shows how the exit operation works:
![](ByeCommand.png)

## Product scope
### Target user profile
Hospital admin staff

### Value proposition
IHospital is a desktop application meant for staff in hospitals. Its main purpose is to manage patients,
doctors, nurses, appointments and operation rooms data, and it’s optimised for use via a Command Line Interface (CLI).
If you can type fast, this application allows you to access relevant hospital information faster than traditional GUI applications.

## User Stories

|Version| As a ... | I want to ... | So that I can ...|
|--------|----------|---------------|------------------|
|v1.0|new user|see usage instructions|refer to them when I forget how to use the application|
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list|

## Non-Functional Requirements

{Give non-functional requirements}

## Glossary

* *glossary item* - Definition

## Instructions for manual testing

{Give instructions on how to do a manual product testing e.g., how to load sample data to be used for testing}
33 changes: 6 additions & 27 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
# User Guide
# IHospital

## Features
{Give product intro here}

### Feature-ABC

Description of the feature.

### Feature-XYZ

Description of the feature.

## Usage

### `Keyword` - Describe action

Describe the action and its outcome.

Example of usage:

`keyword (optional arguments)`

Expected outcome:

Description of the outcome.

```
expected output
```
Useful links:
* [User Guide](UserGuide.md)
* [Developer Guide](DeveloperGuide.md)
* [About Us](AboutUs.md)
42 changes: 42 additions & 0 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# User Guide

## Introduction

{Give a product intro}

## Quick Start

{Give steps to get started quickly}

1. Ensure that you have Java 11 or above installed.
1. Down the latest version of `Duke` from [here](http://link.to/duke).

## Features

{Give detailed description of each feature}

### Adding a todo: `todo`
Adds a new item to the list of todo items.

Format: `todo n/TODO_NAME d/DEADLINE`

* The `DEADLINE` can be in a natural language format.
* The `TODO_NAME` cannot contain punctuation.

Example of usage:

`todo n/Write the rest of the User Guide d/next week`

`todo n/Refactor the User Guide to remove passive voice d/13/04/2020`

## FAQ

**Q**: How do I transfer my data to another computer?

**A**: {your answer here}

## Command Summary

{Give a 'cheat sheet' of commands here}

* Add todo `todo n/TODO_NAME d/DEADLINE`
10 changes: 0 additions & 10 deletions src/main/java/Duke.java

This file was deleted.

36 changes: 36 additions & 0 deletions src/main/java/seedu/duke/Duke.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package seedu.duke;

import tp.DoctorList;
import tp.Parser;
import tp.PatientList;
import tp.Ui;
import tp.AppointmentList;
import tp.Storage;
import tp.IHospitalException;
import tp.Command;
import tp.person.Patient;

import java.util.Scanner;

public class Duke {
/**
* Main entry-point for the java.duke.Duke application.
*/
private static final Ui ui = new Ui();
private static final Parser parser = new Parser();
private static PatientList patientList = new PatientList();
private static DoctorList doctorList = new DoctorList();
private static AppointmentList appointmentList = new AppointmentList();
private static Storage storage = new Storage();

public static void main(String[] args) throws IHospitalException {
ui.sayHello();
String fullCommand = parser.getCommand();
while (!fullCommand.equals("bye")) {
Command command = parser.parse(fullCommand);
command.execute(doctorList, patientList, appointmentList, ui, storage);
fullCommand = parser.getCommand();
}
ui.sayGoodbye();
}
}
31 changes: 31 additions & 0 deletions src/main/java/tp/AddAppointmentCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package tp;

import tp.person.Doctor;
import tp.person.Patient;

import java.time.LocalDateTime;

public class AddAppointmentCommand extends Command {
protected int doctorIndex;
protected int patientIndex;
protected LocalDateTime time;

public AddAppointmentCommand() {

}

public AddAppointmentCommand(int doctorIndex, int patientIndex, String time) {
this.doctorIndex = doctorIndex;
this.patientIndex = patientIndex;
this.time = LocalDateTime.parse(time);
}


@Override
public void execute(DoctorList doctorList, PatientList patientList,
AppointmentList appointmentList, Ui ui, Storage storage) throws IHospitalException {
Doctor doctor = (Doctor) doctorList.getDoctor(doctorIndex);
Patient patient = (Patient) patientList.getPatient(patientIndex);
appointmentList.addAppointment(doctor, patient, time);
}
}
29 changes: 29 additions & 0 deletions src/main/java/tp/AddDoctorCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package tp;

import tp.person.Doctor;

public class AddDoctorCommand extends Command {
protected String id;
protected String name;
protected String phoneNumber;
protected String email;
protected boolean isOnDuty;

public AddDoctorCommand() {
}

public AddDoctorCommand(String id, String name, String phoneNumber, String email, boolean isOnDuty) {
this.id = id;
this.name = name;
this.phoneNumber = phoneNumber;
this.email = email;
this.isOnDuty = isOnDuty;
}

@Override
public void execute(DoctorList doctorList, PatientList patientList,
AppointmentList appointmentList, Ui ui, Storage storage) throws IHospitalException {
Doctor doctor = new Doctor(id, name, phoneNumber, email);
doctorList.addDoctor(doctor);
}
}
28 changes: 28 additions & 0 deletions src/main/java/tp/AddPatientCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package tp;

import tp.person.Doctor;
import tp.person.Patient;

public class AddPatientCommand extends Command {
protected String id;
protected String name;
protected String phoneNumber;
protected String email;

public AddPatientCommand() {
}

public AddPatientCommand(String id, String name, String phoneNumber, String email) {
this.id = id;
this.name = name;
this.phoneNumber = phoneNumber;
this.email = email;
}

@Override
public void execute(DoctorList doctorList, PatientList patientList,
AppointmentList appointmentList, Ui ui, Storage storage) throws IHospitalException {
Patient patient = new Patient(id, name, phoneNumber, email);
patientList.addPatient(patient);
}
}
24 changes: 24 additions & 0 deletions src/main/java/tp/Appointment.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package tp;

import tp.person.Doctor;
import tp.person.Patient;

import java.time.LocalDateTime;

public class Appointment {
protected Doctor doctor;
protected Patient patient;
protected LocalDateTime time;

public Appointment(Doctor doctor, Patient patient, LocalDateTime time) {
this.doctor = doctor;
this.patient = patient;
this.time = time;
}

@Override
public String toString() {
return "Doctor: " + doctor.getName() + " || Patient: "
+ patient.getName() + " || Appointment time: " + time;
}
}
Loading