Clinical Documents
Create Clinical Document
Create a new clinical document.
POST
/
api
/
2.0
/
clinical_documents
/
Create Clinical Document
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/clinical_documents/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
},
"allergies_imported": true,
"author_name": "<string>",
"demographics_imported": true,
"encounters_imported": true,
"immunizations_imported": true,
"labs_imported": true,
"medications_imported": true,
"problems_imported": true,
"procedures_imported": true,
"vitals_imported": true
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/clinical_documents/"
payload = {
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
},
"allergies_imported": True,
"author_name": "<string>",
"demographics_imported": True,
"encounters_imported": True,
"immunizations_imported": True,
"labs_imported": True,
"medications_imported": True,
"problems_imported": True,
"procedures_imported": True,
"vitals_imported": True
}
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({
authoring_practice: 123,
patient: 123,
xml_file: {
base64_content: '<string>',
content_type: '<string>',
document: '<string>',
external_content: '<unknown>',
original_filename: '<string>'
},
allergies_imported: true,
author_name: '<string>',
demographics_imported: true,
encounters_imported: true,
immunizations_imported: true,
labs_imported: true,
medications_imported: true,
problems_imported: true,
procedures_imported: true,
vitals_imported: true
})
};
fetch('https://sandbox.elationemr.com/api/2.0/clinical_documents/', 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/clinical_documents/",
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([
'authoring_practice' => 123,
'patient' => 123,
'xml_file' => [
'base64_content' => '<string>',
'content_type' => '<string>',
'document' => '<string>',
'external_content' => '<unknown>',
'original_filename' => '<string>'
],
'allergies_imported' => true,
'author_name' => '<string>',
'demographics_imported' => true,
'encounters_imported' => true,
'immunizations_imported' => true,
'labs_imported' => true,
'medications_imported' => true,
'problems_imported' => true,
'procedures_imported' => true,
'vitals_imported' => true
]),
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/clinical_documents/"
payload := strings.NewReader("{\n \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\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/clinical_documents/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/clinical_documents/")
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 \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\n}"
response = http.request(request)
puts response.read_body{
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"id": 123,
"original_filename": "<string>"
},
"allergies_imported": true,
"author_name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"demographics_imported": true,
"encounters_imported": true,
"id": 123,
"immunizations_imported": true,
"labs_imported": true,
"medications_imported": true,
"problems_imported": true,
"procedures_imported": true,
"vitals_imported": true
}File Uploading
Base64-encode the CCDA, CCR, or QRDA file and pass it asxml_file.base64_content. Set xml_file.content_type to application/octet-stream, regardless of the underlying document’s format. Elation determines how to process the file from data_format, not from xml_file.content_type.Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
The xml file to be used as clinical document.
Show child attributes
Show child attributes
Maximum string length:
255The format of the clinical document data.
Available options:
ccda, ccr, qrda_1 Response
201 - application/json
The xml file to be used as clinical document.
Show child attributes
Show child attributes
Maximum string length:
255The format of the clinical document data.
Available options:
ccda, ccr, qrda_1 Was this page helpful?
⌘I
Create Clinical Document
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/clinical_documents/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
},
"allergies_imported": true,
"author_name": "<string>",
"demographics_imported": true,
"encounters_imported": true,
"immunizations_imported": true,
"labs_imported": true,
"medications_imported": true,
"problems_imported": true,
"procedures_imported": true,
"vitals_imported": true
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/clinical_documents/"
payload = {
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"original_filename": "<string>"
},
"allergies_imported": True,
"author_name": "<string>",
"demographics_imported": True,
"encounters_imported": True,
"immunizations_imported": True,
"labs_imported": True,
"medications_imported": True,
"problems_imported": True,
"procedures_imported": True,
"vitals_imported": True
}
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({
authoring_practice: 123,
patient: 123,
xml_file: {
base64_content: '<string>',
content_type: '<string>',
document: '<string>',
external_content: '<unknown>',
original_filename: '<string>'
},
allergies_imported: true,
author_name: '<string>',
demographics_imported: true,
encounters_imported: true,
immunizations_imported: true,
labs_imported: true,
medications_imported: true,
problems_imported: true,
procedures_imported: true,
vitals_imported: true
})
};
fetch('https://sandbox.elationemr.com/api/2.0/clinical_documents/', 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/clinical_documents/",
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([
'authoring_practice' => 123,
'patient' => 123,
'xml_file' => [
'base64_content' => '<string>',
'content_type' => '<string>',
'document' => '<string>',
'external_content' => '<unknown>',
'original_filename' => '<string>'
],
'allergies_imported' => true,
'author_name' => '<string>',
'demographics_imported' => true,
'encounters_imported' => true,
'immunizations_imported' => true,
'labs_imported' => true,
'medications_imported' => true,
'problems_imported' => true,
'procedures_imported' => true,
'vitals_imported' => true
]),
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/clinical_documents/"
payload := strings.NewReader("{\n \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\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/clinical_documents/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/clinical_documents/")
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 \"authoring_practice\": 123,\n \"patient\": 123,\n \"xml_file\": {\n \"base64_content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"document\": \"<string>\",\n \"external_content\": \"<unknown>\",\n \"original_filename\": \"<string>\"\n },\n \"allergies_imported\": true,\n \"author_name\": \"<string>\",\n \"demographics_imported\": true,\n \"encounters_imported\": true,\n \"immunizations_imported\": true,\n \"labs_imported\": true,\n \"medications_imported\": true,\n \"problems_imported\": true,\n \"procedures_imported\": true,\n \"vitals_imported\": true\n}"
response = http.request(request)
puts response.read_body{
"authoring_practice": 123,
"patient": 123,
"xml_file": {
"base64_content": "<string>",
"content_type": "<string>",
"document": "<string>",
"external_content": "<unknown>",
"id": 123,
"original_filename": "<string>"
},
"allergies_imported": true,
"author_name": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"demographics_imported": true,
"encounters_imported": true,
"id": 123,
"immunizations_imported": true,
"labs_imported": true,
"medications_imported": true,
"problems_imported": true,
"procedures_imported": true,
"vitals_imported": true
}