-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPatient.js
110 lines (98 loc) · 2.04 KB
/
Patient.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
* @author Korentin Massif
* @version 0.1
*
* @file Patient object manipulation
*/
class Patient
{
/** @private name of the patient */ #name;
/** @private forname of the patient */ #forname;
/** @private birthday of the patient */ #birthday;
/** @private useful information about the patient */ #about;
/** @private id of the patient in the database */ #id;
/**
* Create an instance of a patient
*
* @constructor
* @this {Patient}
* @param {string} name
* @param {string} forname
* @param {date} date the date is loaded into a table : {YEAR, MONTH, DAY}
* @param {string} about
* @param {number} id if the patient is newly created, let the id field empty
*/
constructor(name, forname, date, about, id = 0)
{
this.#name = name;
this.#forname = forname;
this.#birthday = new Date(date[0], date[1], date[2]);
this.#about = about;
this.#id = id;
}
/**
* Name getter
* @returns {string} #name
*/
getName()
{
return this.#name;
}
/**
* Name setter
* @param {string} name
*/
setName(name)
{
this.#name = name
}
/**
* Forname getter
* @returns {string} #forname
*/
getForname()
{
return this.#forname;
}
/**
* Forname setter
* @param {string} forname
*/
setForname(forname)
{
this.#forname = forname;
}
/**
* Birthday getter
* @returns {date} birtday
*/
getBirthday()
{
return this.#birthday;
}
/**
* about setter
* @param {string} about
*/
setAbout(about)
{
this.#about = about;
}
/**
* about getter
* @returns {string} about
*/
getAbout()
{
return this.#about;
}
/**
* Id getter
* @returns {number} #id
*/
getId()
{
return this.#id;
}
}
module.exports = Patient