@Unstable public final class Medication extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.xwiki.model.reference.EntityReference |
CLASS_REFERENCE
The XClass used for storing medication data.
|
static String |
DOSE |
static String |
DURATION |
static String |
EFFECT |
static String |
FREQUENCY |
static String |
GENERIC_NAME |
static String |
NAME |
static String |
NOTES |
| Constructor and Description |
|---|
Medication(net.sf.json.JSONObject json)
Constructor parsing back a JSON, in the same format as
toJSON() produces. |
Medication(String name,
String genericName,
String dose,
String frequency,
org.joda.time.Period duration,
String effect,
String notes)
Basic constructor receiving all the required information.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDose()
The dose administered.
|
org.joda.time.Period |
getDuration()
The amount of time that this medicine has been given.
|
MedicationEffect |
getEffect()
The effect observed for this medicine.
|
String |
getFrequency()
The frequency of the doses.
|
String |
getGenericName()
The generic name of the main ingredient.
|
String |
getName()
The brand name of the medicine.
|
String |
getNotes()
Custom notes about the medication.
|
net.sf.json.JSONObject |
toJSON()
Serialize as JSON, in the following format.
|
public static final org.xwiki.model.reference.EntityReference CLASS_REFERENCE
public static final String NAME
getName(),
Constant Field Valuespublic static final String GENERIC_NAME
getGenericName(),
Constant Field Valuespublic static final String DOSE
getDose(),
Constant Field Valuespublic static final String FREQUENCY
getFrequency(),
Constant Field Valuespublic static final String DURATION
getDuration(),
Constant Field Valuespublic static final String EFFECT
getEffect(),
Constant Field Valuespublic static final String NOTES
getNotes(),
Constant Field Valuespublic Medication(String name, String genericName, String dose, String frequency, org.joda.time.Period duration, String effect, String notes)
name - see getName(), may be nullgenericName - see getGenericName(), may be nulldose - see getDose(), may be nullfrequency - see getFrequency(), may be nullduration - see getDuration(), may be nulleffect - see getEffect(), may be nullnotes - see getNotes(), may be nullpublic Medication(net.sf.json.JSONObject json)
toJSON() produces.json - a JSON object in the format produced by toJSON(); must not be nullIllegalArgumentException - if json is nullpublic net.sf.json.JSONObject toJSON()
{
"name": "Nurofen",
"genericName: "ibuprofen",
"dose": "200mg",
"frequency": "8h",
"duration": "2Y6M",
"effect": "slightImprovement",
"notes": "Makes the patient's headaches a lot more bearable"
}
public String getName()
null or emptypublic String getGenericName()
null or emptypublic String getDose()
null or emptypublic String getFrequency()
null or emptypublic org.joda.time.Period getDuration()
nullpublic MedicationEffect getEffect()
nullpublic String getNotes()
null or emptyCopyright © 2011–2015 University of Toronto, Computational Biology Lab. All rights reserved.