Create Discontinued Medication
Create a new discontinued medication.
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/discontinued_medications/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"is_documented": true,
"medication": {
"active_ndcs": [
"<string>"
],
"id": 123,
"is_controlled": false,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": [
"<string>"
],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"rxnorm_cuis": [
"<string>"
],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/discontinued_medications/"
payload = {
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"is_documented": True,
"medication": {
"active_ndcs": ["<string>"],
"id": 123,
"is_controlled": False,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": ["<string>"],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"rxnorm_cuis": ["<string>"],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
med_order: 123,
chart_date: '2023-11-07T05:31:56Z',
discontinue_date: '2023-12-25',
document_date: '2023-11-07T05:31:56Z',
documenting_personnel: 123,
is_documented: true,
medication: {
active_ndcs: ['<string>'],
id: 123,
is_controlled: false,
market_end_date: '2023-11-07T05:31:56Z',
name: '<string>',
ndcs: ['<string>'],
obsolete_date: '2023-11-07T05:31:56Z',
practice: 123,
rxnorm_cuis: ['<string>'],
strength: '<string>',
type: 'prescription'
},
patient: 123,
practice: 123,
prescribing_physician: 123,
reason: '<string>',
signed_date: '2023-11-07T05:31:56Z',
supervising_physician: 123,
thread: 123
})
};
fetch('https://sandbox.elationemr.com/api/2.0/discontinued_medications/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.elationemr.com/api/2.0/discontinued_medications/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'med_order' => 123,
'chart_date' => '2023-11-07T05:31:56Z',
'discontinue_date' => '2023-12-25',
'document_date' => '2023-11-07T05:31:56Z',
'documenting_personnel' => 123,
'is_documented' => true,
'medication' => [
'active_ndcs' => [
'<string>'
],
'id' => 123,
'is_controlled' => false,
'market_end_date' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'ndcs' => [
'<string>'
],
'obsolete_date' => '2023-11-07T05:31:56Z',
'practice' => 123,
'rxnorm_cuis' => [
'<string>'
],
'strength' => '<string>',
'type' => 'prescription'
],
'patient' => 123,
'practice' => 123,
'prescribing_physician' => 123,
'reason' => '<string>',
'signed_date' => '2023-11-07T05:31:56Z',
'supervising_physician' => 123,
'thread' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.elationemr.com/api/2.0/discontinued_medications/"
payload := strings.NewReader("{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.elationemr.com/api/2.0/discontinued_medications/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/discontinued_medications/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}"
response = http.request(request)
puts response.read_body{
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"id": 123,
"is_documented": true,
"last_medication_order": 123,
"medication": {
"active_ndcs": [
"<string>"
],
"brand_name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"creation_type": "user",
"form": "<string>",
"generic_name": "<string>",
"id": 123,
"is_controlled": false,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": [
"<string>"
],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"route": "<string>",
"rxnorm_cuis": [
"<string>"
],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}Requirements
Themed_order referenced in the request body must be a signed medication order (one created with is_doc_med: true). Medication orders created as unsigned drafts (is_doc_med: false) cannot be discontinued.
400 error:{
"med_order": "No signed medication order found to discontinue."
}
400 error:{
"med_order": "Med has already been discontinued!"
}
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
The id of the medication which we discontinued.
The timestamp at which this discontinue was available in the patient's chart
The date when the medication was discontinued.
The timestamp at which we've documented this discontinue occurred.
The user who documented this discontinue.
The medication that was discontinued.
Show child attributes
Show child attributes
The id of the patient chart.
The id of the practice.
The id of the physician who prescribed the medication.
The discontinue reason.
The timestamp at which a user signed off on the discontinue.
If the prescribing physician requires supervision, this will reference the physician who is in that role.
Response
The id of the medication which we discontinued.
The timestamp at which this discontinue was available in the patient's chart
The timestamp at which this discontinue was created in our database.
The timestamp at which the discontinue was marked as deleted, usually occurs when a user wants to 'undiscontinue' the medication.
The date when the medication was discontinued.
The timestamp at which we've documented this discontinue occurred.
The user who documented this discontinue.
The id of the discontinue medication.
The id of the last medication ordered before we discontinued this thread of med orders.
The medication that was discontinued.
Show child attributes
Show child attributes
The id of the patient chart.
The id of the practice.
The id of the physician who prescribed the medication.
The discontinue reason.
The timestamp at which a user signed off on the discontinue.
If the prescribing physician requires supervision, this will reference the physician who is in that role.
Was this page helpful?
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/discontinued_medications/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"is_documented": true,
"medication": {
"active_ndcs": [
"<string>"
],
"id": 123,
"is_controlled": false,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": [
"<string>"
],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"rxnorm_cuis": [
"<string>"
],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/discontinued_medications/"
payload = {
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"is_documented": True,
"medication": {
"active_ndcs": ["<string>"],
"id": 123,
"is_controlled": False,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": ["<string>"],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"rxnorm_cuis": ["<string>"],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
med_order: 123,
chart_date: '2023-11-07T05:31:56Z',
discontinue_date: '2023-12-25',
document_date: '2023-11-07T05:31:56Z',
documenting_personnel: 123,
is_documented: true,
medication: {
active_ndcs: ['<string>'],
id: 123,
is_controlled: false,
market_end_date: '2023-11-07T05:31:56Z',
name: '<string>',
ndcs: ['<string>'],
obsolete_date: '2023-11-07T05:31:56Z',
practice: 123,
rxnorm_cuis: ['<string>'],
strength: '<string>',
type: 'prescription'
},
patient: 123,
practice: 123,
prescribing_physician: 123,
reason: '<string>',
signed_date: '2023-11-07T05:31:56Z',
supervising_physician: 123,
thread: 123
})
};
fetch('https://sandbox.elationemr.com/api/2.0/discontinued_medications/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.elationemr.com/api/2.0/discontinued_medications/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'med_order' => 123,
'chart_date' => '2023-11-07T05:31:56Z',
'discontinue_date' => '2023-12-25',
'document_date' => '2023-11-07T05:31:56Z',
'documenting_personnel' => 123,
'is_documented' => true,
'medication' => [
'active_ndcs' => [
'<string>'
],
'id' => 123,
'is_controlled' => false,
'market_end_date' => '2023-11-07T05:31:56Z',
'name' => '<string>',
'ndcs' => [
'<string>'
],
'obsolete_date' => '2023-11-07T05:31:56Z',
'practice' => 123,
'rxnorm_cuis' => [
'<string>'
],
'strength' => '<string>',
'type' => 'prescription'
],
'patient' => 123,
'practice' => 123,
'prescribing_physician' => 123,
'reason' => '<string>',
'signed_date' => '2023-11-07T05:31:56Z',
'supervising_physician' => 123,
'thread' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.elationemr.com/api/2.0/discontinued_medications/"
payload := strings.NewReader("{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.elationemr.com/api/2.0/discontinued_medications/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/discontinued_medications/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"med_order\": 123,\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"discontinue_date\": \"2023-12-25\",\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"documenting_personnel\": 123,\n \"is_documented\": true,\n \"medication\": {\n \"active_ndcs\": [\n \"<string>\"\n ],\n \"id\": 123,\n \"is_controlled\": false,\n \"market_end_date\": \"2023-11-07T05:31:56Z\",\n \"name\": \"<string>\",\n \"ndcs\": [\n \"<string>\"\n ],\n \"obsolete_date\": \"2023-11-07T05:31:56Z\",\n \"practice\": 123,\n \"rxnorm_cuis\": [\n \"<string>\"\n ],\n \"strength\": \"<string>\",\n \"type\": \"prescription\"\n },\n \"patient\": 123,\n \"practice\": 123,\n \"prescribing_physician\": 123,\n \"reason\": \"<string>\",\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"supervising_physician\": 123,\n \"thread\": 123\n}"
response = http.request(request)
puts response.read_body{
"med_order": 123,
"chart_date": "2023-11-07T05:31:56Z",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"discontinue_date": "2023-12-25",
"document_date": "2023-11-07T05:31:56Z",
"documenting_personnel": 123,
"id": 123,
"is_documented": true,
"last_medication_order": 123,
"medication": {
"active_ndcs": [
"<string>"
],
"brand_name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"creation_type": "user",
"form": "<string>",
"generic_name": "<string>",
"id": 123,
"is_controlled": false,
"market_end_date": "2023-11-07T05:31:56Z",
"name": "<string>",
"ndcs": [
"<string>"
],
"obsolete_date": "2023-11-07T05:31:56Z",
"practice": 123,
"route": "<string>",
"rxnorm_cuis": [
"<string>"
],
"strength": "<string>",
"type": "prescription"
},
"patient": 123,
"practice": 123,
"prescribing_physician": 123,
"reason": "<string>",
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"supervising_physician": 123,
"thread": 123
}