forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from lyuanww/refactor-main-app-to-patient
refactor: change main app to new patient system
- Loading branch information
Showing
12 changed files
with
565 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package seedu.cc.model.util; | ||
|
||
import java.util.Arrays; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
import seedu.cc.model.ClinicBook; | ||
import seedu.cc.model.ReadOnlyClinicBook; | ||
import seedu.cc.model.patient.Nric; | ||
import seedu.cc.model.patient.Patient; | ||
import seedu.cc.model.person.Address; | ||
import seedu.cc.model.person.Email; | ||
import seedu.cc.model.person.Name; | ||
import seedu.cc.model.person.Phone; | ||
import seedu.cc.model.tag.Tag; | ||
|
||
/** | ||
* Contains utility methods for populating {@code AddressBook} with sample data. | ||
*/ | ||
public class NewSampleDataUtil { | ||
public static Patient[] getSamplePatients() { | ||
return new Patient[]{ | ||
new Patient(new Name("Alex Yeoh"), new Nric("S5323891B"), new Phone("87438807"), | ||
new Email("[email protected]"), new Address("Blk 30 Geylang Street 29, #06-40"), | ||
getTagSet("friends")), | ||
new Patient(new Name("Bernice Yu"), new Nric("S5323891B"), new Phone("99272758"), | ||
new Email("[email protected]"), new Address("Blk 30 Lorong 3 Serangoon Gardens, #07-18"), | ||
getTagSet("colleagues", "friends")), | ||
new Patient(new Name("Charlotte Oliveiro"), new Nric("S5323891B"), new Phone("93210283"), | ||
new Email("[email protected]"), new Address("Blk 11 Ang Mo Kio Street 74, #11-04"), | ||
getTagSet("neighbours")), | ||
new Patient(new Name("David Li"), new Nric("S5323891B"), new Phone("91031282"), | ||
new Email("[email protected]"), new Address("Blk 436 Serangoon Gardens Street 26, #16-43"), | ||
getTagSet("family")), | ||
new Patient(new Name("Irfan Ibrahim"), new Nric("S5323891B"), new Phone("92492021"), | ||
new Email("[email protected]"), new Address("Blk 47 Tampines Street 20, #17-35"), | ||
getTagSet("classmates")), | ||
new Patient(new Name("Roy Balakrishnan"), new Nric("S5323891B"), new Phone("92624417"), | ||
new Email("[email protected]"), new Address("Blk 45 Aljunied Street 85, #11-31"), | ||
getTagSet("colleagues")) | ||
}; | ||
} | ||
|
||
public static ReadOnlyClinicBook getSampleClinicBook() { | ||
ClinicBook sampleAb = new ClinicBook(); | ||
for (Patient samplePatient : getSamplePatients()) { | ||
sampleAb.addPatient(samplePatient); | ||
} | ||
return sampleAb; | ||
} | ||
|
||
/** | ||
* Returns a tag set containing the list of strings given. | ||
*/ | ||
public static Set<Tag> getTagSet(String... strings) { | ||
return Arrays.stream(strings) | ||
.map(Tag::new) | ||
.collect(Collectors.toSet()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.