Skip to content

Medications

Medications

For more information on the Medication History feature in general, visit our help center.

The Medication object

{
"id": "232132",
"active": true,
"comment": "Only when necessary",
"directions": "Inhale and hold",
"dosage": "55 mcg/inh",
"name": "Nasal spray"
}

Medications are Medication objects.

You can view the full list of available fields here.

Listing Medications

query medications($active: Boolean, $patient_id: ID) {
medications(active: $active, patient_id: $patient_id) {
id
name
active
directions
dosage
code
start_date
end_date
}
}

Listing Medications is done via the medications query.

You can view a full list of potential arguments here.

InputInfo
activeOptional. Fetch only active Medications.
patient_idOptional. ID of the Patient to fetch Medications for. If omitted, will return Medications for the current User.

Returns a list of Medication objects.

Creating a Medication

mutation createMedication(
$active: Boolean
$comment: String
$directions: String
$dosage: String
$end_date: String
$name: String
$start_date: String
$user_id: String
) {
createMedication(
input: {
active: $active
comment: $comment
directions: $directions
dosage: $dosage
end_date: $end_date
name: $name
start_date: $start_date
user_id: $user_id
}
) {
medication {
id
name
dosage
comment
}
messages {
field
message
}
}
}

To add a Medication to a Patient, use createMedication mutation.

You can view a full list of potential inputs here.

InputInfo
user_idRequired. ID of the Patient.
nameRequired. Name of the Medication.
activeOptional. Whether the Patient still takes the Medication.
dosageOptional. Medication dosage.
commentOptional. Additional comment.
start_dateOptional. Start date of taking the Medication. For example: July 16, 2023.
end_dateOptional. End date of taking the Medication. For example: July 16, 2023. Does not apply if active is set to true.

Returns a createMedicationPayload object.

Updating a Medication

mutation updateMedication(
$id: ID
$active: Boolean
$comment: String
$directions: String
$dosage: String
$end_date: String
$name: String
$start_date: String
) {
updateMedication(
input: {
id: $id
active: $active
comment: $comment
directions: $directions
dosage: $dosage
end_date: $end_date
name: $name
start_date: $start_date
}
) {
medication {
id
name
dosage
comment
}
messages {
field
message
}
}
}

The updateMedication has a very similar behavior to createMedication mutation.

You can view a full list of potential inputs here.

InputInfo
idRequired. The ID of the Medication to update.

Returns an updateMedicationPayload object.

Deleting a Medication

Medications can be deleted via the deleteMedication mutation.

You can view a full list of potential inputs here.

mutation deleteMedication($id: ID) {
deleteMedication(input: { id: $id }) {
medication {
id
}
messages {
field
message
}
}
}
InputInfo
idRequired. ID of the Medication to delete.

Returns a destroyMedicationPayload object.