Introduction
This project portfolio page’s purpose is to document my contributions to the project.
HealthBase is a desktop application designed to aid in clinic patient data management. It provides patient data input and management capabilities through a command line interface (CLI) for input and a graphical UI for data display. Its main features include (among others):
-
Management of check-in/check-out status of patients
-
Real-time management of the check-in/out status of patients
-
Patient medication, medical history, dietary restriction(s), and visitor history data entry and retrieval
-
Patient appointment management for doctors
HealthBase was designed and built by me and my team of NUS Year 2 Computer Science students for the CS2103T module. For more information about us, click here.
Summary of Contributions
This section’s purpose is to summarise my contributions to this project. For more details about the contributions, click the link to the corresponding pull request.
-
Major enhancement: Added
addmeds
command (Pull request(s): #20, #31, #32, #63, #82, #112)-
What it does: this command adds a medication entry to a given patient. The medication entry includes information about the drug name, the dosage, dosage unit, doses per day, and the duration of the prescription in days.
-
Justification: this command provides a core functionality of HealthBase (medication data entry and retrieval).
-
Highlights: this command affects existing internal representations of the Person class and required significant retooling of tests to fit the new member of the Person class. The implementation was somewhat challenging as it required an extension of the current Person data representation and storage functionality.
-
-
Major enhancement: Added
view
command (Pull request(s): #95, #127, #169)-
What it does: this command adds functionality for users to view patient-specific information in the right-side panel of the UI.
-
Justification: this command provides a core functionality of HealthBase (viewing patient data), while preventing UI clutter.
-
Highlights: this command was designed to be extensible and allows developers to design their own panels for data display without impacting other developers' data displays.
-
-
Minor enhancement:
-
Added
sort
command -
Added
gendata
command
-
-
Code contributions: my contributions
-
Other contributions:
-
Project management:
-
nil
-
-
Enhancements to existing features:
-
Documentation:
-
Updated User Guide and Developer Guide to reflect changes made (Pull request(s): #29, #75, #85, #109, #130, #140, #212)
-
Updated class diagrams in the User Guide (Pull request(s): #97)
-
Ordered commands in the User Guide in lexicographical order (Pull request(s): #97)
-
Standardised language in the User Guide and Developer Guide (Pull request(s): #97)
-
-
Community:
-
Contributions to the User Guide
Given below are (some) sections I contributed to the User Guide. For brevity, not all of the portions of the User Guide that I wrote have been included. They showcase my ability to write documentation targeting end-users. |
Sort user view : sort
Sort the current view, if it is sortable.
Format: sort SORT_TYPE SORT_ORDER
SORT_TYPE
refers to the order in which the sorting should be done (ascending, descending).
It can be either 'a' for ascending, or 'd' for descending.
SORT_ORDER
refers to the order in which the sorting should be done.
How this affects the sorting exactly depends on each view, and will be explained in greater detail below.
View Name |
Sortable? |
What |
Default |
No |
- |
Apppointment |
Yes |
The columns of the table in the view, one-indexed. |
Diet |
No |
- |
Medication |
Yes |
The columns of the table in the view, one-indexed. |
Medical History |
Yes |
The columns of the table in the view, one-indexed. |
Example(s):
-
sort a 123
where the current view is Medication-
Sorts the table in the medication view by the first column (Drug Name). Any entries with the same drug name will be further sorted by the second column (Dosage), with any entries with the same drug name and dosage being further sorted by the third column (Dosage Unit).
-
-
sort a 1
where the current view is the default view (blank view).-
Does nothing (the current view is not sortable).
-
Select patient: select
Select a patient through pure command-line functionality. The alternative is to click on the patient’s card.
Format: select INDEX
where INDEX refers to the index of the patient’s card (listed in the card)
Example(s):
-
select 1
Add patient medication: addmeds
Add to a patient’s medication history.
Format: addmeds ic/NRIC d/DRUG_NAME q/QUANTITY_PER_DOSE u/DOSAGE_UNIT n/DOSES_PER_DAY t/DURATION_IN_DAYS
Example(s):
-
addmeds ic/S1234567A d/Paracetamol q/2 u/tablets n/4 t/14
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Addmeds
Current implementation
The addmeds
command provides functionality for users to add prescription-related information for a given patient.
This is done by adding prescription-related information to a given person, represented by a Person
object.
This allows for a patient to build up a history of prescriptions for viewing at a later date.
The adding of prescription-related information is facilitated by the following classes:
-
PrescriptionList
, a list of-
Prescription
s, each of which have a-
Dose
and a -
Duration
.
-
-
A more detailed description of the classes follows below:
-
PrescriptionList
-
Every
Person
has aPrescriptionList
, the purpose of which is to store thePerson
'sPrescriptions
. -
A wrapper class around the internal representation of a list of prescriptions that exposes only a few select methods in its API.
-
The methods relevant for the
addmeds
command execution are:add
-
-
-
Prescription
-
Class encapsulating all the information about a given medication prescription.
-
More specifically, the
Prescription
class encapsulates the name of the drug prescribed, the dosage information (itself stored as aDose
object), and the duration of the prescription (as aDuration
object).
-
-
-
Dose
-
Class encapsulating all the information about a given medication dosage.
-
More specifically, the
Dose
class encapsulates the dose, dosage unit, and doses per day to administer.
-
-
-
Duration
-
Class encapsulating all the information about a given time period.
-
More specifically, the
Duration
class encapsulates the duration of the time period in milliseconds, and the calendar dates for the start and end of that time period.
-
-
Given below is an example usage scenario and how the relevant classes behave at each step.
At the end of the explanation is a sequence diagram of a typical addmeds
command execution.
The user executes addmeds ic/S1234567A d/Paracetamol q/2 u/tablets n/4 t/14
.
This command has the following intent: Prescribe the following medication to a patient with NRIC = S1234567A:
Drug Name |
Dosage |
Duration |
Paracetamol |
2 tablets, 4 times a day |
14 days, from current date to 14 days from now. |
The command text is passed to an instance of the LogicManager
class, which in turn executes HealthBaseParser::parse
.
The HealthBaseParser
parses the command word (addmeds
) and executes AddmedsCommandParser::parse
.
This causes the AddmedsCommandParser
to construct the following objects in the following order:
Index |
Information used |
Class instances used |
Class instance constructed |
1 |
Dosage, Dosage unit, Doses per day |
nil |
|
2 |
Duration in days |
nil |
|
3 |
NRIC |
nil |
|
4 |
Drug name |
|
|
5 |
nil |
|
|
The AddmedsCommandParser::parse
method returns an AddmedsCommand
object which encapsulates the necessary information to update the Person
's medication(s).
Control then passes back to the LogicManager
, which calls AddmedsCommand::execute
.
The AddmedsCommand::execute
method constructs a new Person
object using all the details of the old Person, with the sole difference being the PrescriptionList
used being a deep copy of the original Person
's PrescriptionList
with the new Prescription
added.
This updated Person
object is used to update the existing Person
object using the Model::updatePerson
method (or an overridden version) of the backing model.
Finally, the AddmedsCommand::execute
method terminates, returning a CommandResult
with a success message.
The LogicManager
then returns the same CommandResult
as the return value of the LogicManager::execute
method.
The command execution then ends.
The following sequence diagram shows the execution of the addmeds
command:
addmeds
commandDesign considerations
Aspect: Data structure to support the medication data storage
-
Alternative 1 (Current implementation): Store the data inside multiple POJO classes, with new classes being introduced as necessary to maintain high cohesion of individual classes. For example, the
Duration
class holds temporal information, whereas theDose
class holds medication dosage-related information.-
Pros: Maintains the Single Responsibility Principle (e.g. the
Prescription
class now changes only if there are changes to the structure of a physical prescription, and not due to (e.g.) changes in time representation, or the way that dosage-related information is stored. -
Cons: Increases the number of classes we will have to maintain.
-
-
Alternative 2: Store all the data directly as members inside a single
Prescription
class.-
Pros: Reduces the number of classes we will have to maintain.
-
Cons: Reduces the cohesion of the
Prescription
class as it now handles multiple different items e.g. dosage-related information and duration-related information.
-
Generating test data
-
Generating patients with mock data
-
Open the application.
-
Run the following commands in the following sequence:
-
dev-mode
(Enables developer mode; the next command requires developer mode to run.) -
gendata NUMBER_OF_PATIENTS
, whereNUMBER_OF_PATIENTS
is a positive integer value that indicates how many patients you wish to generate.
-
-
The application will then generate that number of patients with mock data for their:
-
Personal particulars
-
NRIC
-
Name
-
Phone number
-
Email address
-
Physical address
-
-
Drug allergies
-
Medications
-
Appointments
-
Dietary restrictions
-
Medical history
Details on the exact range of values that the mock data can take on can be found in the related .java
files.