Medications
Create
Section titled “Create”To add a medication to a patient, make a request to:
HTTP Request
Section titled “HTTP Request”POST {server_url}/api/v2/patients/{patient_id}/medications
This request must include a valid User JWT token, please see our documentation.
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer example.jwttoken |
The following parameters are required when creating a medication. To search for the medication and retrieve needed parameter values, reference medications - search.
URL Parameters
Section titled “URL Parameters”| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
Request Body
Section titled “Request Body”| Attribute | Required | Description |
|---|---|---|
| medication | true | Parent attribute for medication |
| ↳ name | true | Name of the medication (string) |
| ↳ current | false | Permitted values are true, false |
| ↳ dosage | false | Dosage of the medication (string) |
| ↳ frequency | false | Frequency of the medication (string) |
| ↳ med_id | false | Unique ID of the medication |
| ↳ ndc_id | false | NDC ID of the medication |
Example Request
Section titled “Example Request”curl -X POST {server_url}/api/v2/patients/{patient_id}/medications \ -H "Content-type: application/json" \ -H "Authorization: Bearer {jwt_token}" \ -H 'Accept: application/json' \ -d '{ "medication": { "name": "Ibuprofen PM 200 mg-25 mg capsule", "current": true, "dosage": "1", "frequency": "Once Daily", "ndc_id": "00363061121" } }'RestClient::Request.new( :method => :post, :url => "{server_url}/api/v2/patients/{patient_id}/medications", :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json' }, :payload => { medication: { name: "Ibuprofen PM 200 mg-25 mg capsule", current: true, dosage: "1", frequency: "Once Daily", ndc_id: "00363061121" } }).executeExample Response
Section titled “Example Response”{ "medication": { "id": 29, "name": "Ibuprofen PM 200 mg-25 mg capsule", "dosage": "1", "frequency": "Once Daily", "quantity": 1, "source": "Self Reported", "current": true, "ndc_id": "00363061121" }}Delete
Section titled “Delete”To remove a medication from a patient’s list of medications, make a request to:
HTTP Request
Section titled “HTTP Request”DELETE {server_url}/api/v1/patients/{patient_id}/medications/{medication_id}
This request must include a valid User JWT token, please see our documentation.
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
Example Request
Section titled “Example Request”curl -X DELETE {server_url}/api/v1/patients/{patient_id}/medications/{medication_id} \ -H "Content-type: application/json" \ -H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :delete, :url => "{server_url}/api/v1/patients/{patient_id}/medications/{medication_id}", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executeDelete Using NDC
Section titled “Delete Using NDC”To remove a medication from a patient’s list of medications using the NDC Id, make a request to:
HTTP Request
Section titled “HTTP Request”DELETE {server_url}/api/v1/patients/{patient_id}/medications/ndc/{ndc_id}
This request must include a valid User JWT token, please see our documentation.
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
The following parameters are required when removing an allergy.
URL Parameter
Section titled “URL Parameter”| Attribute | Required | Description |
|---|---|---|
| patient_id | true | MD Live ID for patient |
| ndc_id | true | NDC Id of medication |
Example Request
Section titled “Example Request”curl -X DELETE {server_url}/api/v1/patients/{patient_id}/medications/ndc/{ndc_id} \ -H "Content-type: application/json" \ -H "Authorization: Bearer {jwt_token}"RestClient::Request.new( :method => :delete, :url => "{server_url}/api/v1/patients/{patient_id}/medications/ndc/{ndc_id}", :headers => { "Content-type" => "application/json", "Authorization" => "Bearer {jwt_token}" }).executeTo retrieve the list of patient’s current active medications, make a request to:
HTTP Request
Section titled “HTTP Request”GET {server_url}/api/v1/patients/{patient_id}/medications
This request must include a valid User JWT token, please see our documentation.
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
Example Request
Section titled “Example Request”curl -X GET {server_url}/api/v1/patients/{patient_id}/medications \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-type: application/json' \ -H 'Accept: application/json' \RestClient::Request.new( :method => :get, :url => "{server_url}/api/v1/patients/{patient_id}/medications", :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json' }).executeExample Response
Section titled “Example Response”{ "medications": [ { "id":2, "name": "Ibuprofen PM 200 mg-25 mg capsule", "dosage": "1", "frequency": "Once Daily", "quantity":1, "source": "Self Reported", "current":false, "ndc_id": "00363061121" } ]}Search
Section titled “Search”Searches for medications starting with term. Results must not exceed limit.
HTTP Request
Section titled “HTTP Request”POST {server_url}/api/v2/medications/search
This request must include a valid JWT token, please see our documentation.
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
| Authorization | Bearer {jwt_token} |
Request Body
Section titled “Request Body”The following parameters can be used to search for a medication.
| Attribute | Required | Description |
|---|---|---|
| search | true | Parent attribute for search criteria |
| ↳ term | true | The term to match (string) |
| ↳ limit | false | Limit size of the result set, default size is 10, max size is 50 |
Example Request
Section titled “Example Request”curl -X POST {server_url}/api/v2/medications/search \ -H 'Authorization: Bearer {jwt_token}' \ -H 'Content-type: application/json' \ -H 'Accept: application/json' \ -d '{ "search": { "term": "ibuprofen 50", "limit": 10 } }'RestClient::Request.new( :method => :post, :url => "{server_url}/api/v2/medications/search", :headers => { 'Authorization' => 'Bearer {jwt_token}', 'Content-type' => 'application/json', 'Accept' => 'application/json' }, :payload => { search: { term: "ibuprofen 50", limit: 10 } }).executeExample Response
Section titled “Example Response”{ "medications": [ { "id": 82465, "name": "ibuprofen 50 mg chewable tablet", "description": "ibuprofen 50 mg chewable tablet", "med_id": 82465 }, { "id": 78829, "name": "ibuprofen 50 mg/1.25 mL oral drops,suspension", "description": "ibuprofen 50 mg/1.25 mL oral drops,suspension", "med_id": 78829 } ]}