-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDoctor.java
108 lines (92 loc) · 2.76 KB
/
Doctor.java
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
package bbtrial.nl.logicgate.ace;
import java.util.HashMap;
/**
* Doctor is a container object for information about an individual doctor.
* @author skmedlock
*
*/
public class Doctor {
private String doctorID;
private String salutation;
private String email;
private HashMap<String, PatientCategoryPreference> patientCategoryPreferences; //one letterDueCalculator per patient type
private NextReminderCalculator nrc; //next reminder date can be calculated on object creation
public Doctor(String doctorID){
this.doctorID = doctorID;
}
/**
* Determines the date that the letter for this visit is due,
* according to the doctor's preferences for this patient category.
* @param patient
*/
public void patientLetterDueDate(Patient patient) {
RCalendar r = patientCategoryPreferences.get(patient.getCategory()).calculateLetterDueDate(patient);
patient.setLetterDueDate(r);
}
/**
* Determines the first possible reminder date for this patient.
* If the doctor does not want reminders for this patient category,
* firstPossibleReminderDate will be set to null.
* @param patient
*/
public void firstPossibleReminderDate(Patient patient) {
//TODO simplify this by dynamically loading a PCP based on the name of the
//category pref in the database. Then we don't have to have a default and local,
//we can just have a couple defaults and the option to make more.
PatientCategoryPreference pcp = patientCategoryPreferences.get(patient.getCategory());
if(pcp != null){
RCalendar r = pcp.calculateFirstAllowedReminderDate(patient);
patient.setFirstPossibleReminderDate(r);
}
//TODO test that remindBase is loaded as "null" and not empty string or string "NULL"
}
/**
* @return the salutation
*/
public String getSalutation() {
return salutation;
}
/**
* @param salutation the salutation to set
*/
public void setSalutation(String salutation) {
this.salutation = salutation;
}
/**
* @return the email
*/
public String getEmail() {
return email;
}
/**
* @param email the email to set
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return the doctorID
*/
public String getDoctorID() {
return doctorID;
}
/**
* @param patientCategoryPreferences the patientCategoryPreferences to set
*/
public void setPatientCategoryPreferences(
HashMap<String, PatientCategoryPreference> patientCategoryPreferences) {
this.patientCategoryPreferences = patientCategoryPreferences;
}
/**
* @param nrc the nrc to set
*/
public void setNrc(NextReminderCalculator nrc) {
this.nrc = nrc;
}
/**
* @return the nrc
*/
public NextReminderCalculator getNrc() {
return nrc;
}
}