PillRegimen¶
-
public class
PillRegimen
¶ The domain object representing a pill regimen. This is the top level entity in this module.
Constructors¶
PillRegimen¶
-
public
PillRegimen
(String externalId, Set<Dosage> dosages, DailyScheduleDetails scheduleDetails)¶ Constructs a pill regimen.
Parameters: - externalId – the external ID tied to this pill regimen, used for tying patients with the regimen.
- dosages – medicine dosages belonging to this pill regimen
- scheduleDetails – the schedule details for this pill regimen
Methods¶
getDosage¶
getDosages¶
getExternalId¶
getScheduleDetails¶
-
public DailyScheduleDetails
getScheduleDetails
()¶ Returns: the schedule details for this pill regimen
isFirstReminderFor¶
numberOfTimesPillRemindersSentFor¶
-
public int
numberOfTimesPillRemindersSentFor
(Dosage dosage)¶ Returns the number of times a pill reminder was set for the given dosage. This is done using only a calculation based on the schedule for this regimen and the details from the dosage.
Parameters: - dosage – the dosage to check
Returns: the number of time a pill reminder was sent for the dosage
setDosages¶
setExternalId¶
setScheduleDetails¶
-
public void
setScheduleDetails
(DailyScheduleDetails scheduleDetails)¶ Parameters: - scheduleDetails – the schedule details for this pill regimen
timesPillRemainderWillBeSent¶
-
public int
timesPillRemainderWillBeSent
()¶ Calculates the total number of times the pill reminder for this regimen will be sent, in case the patient does not provide an adherence response.
Returns: the maximum number of reminders that will be sent for this regimen
validate¶
-
public void
validate
()¶ Validates the dosages for this regimen. Will call
Dosage.validate()
on every medicine dosage in this regimen.Throws: - ValidationException – if any of the dosages fails validation