Dosage¶
-
public class
Dosage
¶ The domain object representing a medicine dosage within a pill regimen.
Constructors¶
Methods¶
getDosageTime¶
-
public Time
getDosageTime
()¶ Returns: the time of day at which this dosage should be taken
getEndDate¶
getMedicines¶
getResponseLastCapturedDate¶
getStartDate¶
isTodaysDosageResponseCaptured¶
-
public boolean
isTodaysDosageResponseCaptured
()¶ Checks if there is a patient response captured for the last dosage time. This will check if the response was made today or yesterday, provided it’s still before today’s dosage time.
Returns: true if the response was captured, false otherwise
setDosageTime¶
-
public void
setDosageTime
(Time dosageTime)¶ Parameters: - dosageTime – the time of day at which this dosage should be taken
setMedicines¶
setResponseLastCapturedDate¶
todaysDosageTime¶
updateResponseLastCapturedDate¶
-
public void
updateResponseLastCapturedDate
(LocalDate lastCapturedDate)¶ Update this dosage with a new response date from the patient. If the provided date is null or before the currently set last capture date, it will be ignored.
Parameters: - lastCapturedDate – the date on which the response was captured
validate¶
-
public void
validate
()¶ Validates this dosage by calling
Medicine.validate()
on all medicines for this dosage.Throws: - ValidationException – if one of the medicines fails validation