Create Lab Order Test
Create a new lab order test.
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/lab_order_tests/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": [
"<string>"
],
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>"
}
],
"code": "<string>",
"value": "<string>",
"example_format": "<string>",
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": true
}
],
"synonyms": [
"<string>"
]
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/lab_order_tests/"
payload = {
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": ["<string>"],
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>"
}
],
"code": "<string>",
"value": "<string>",
"example_format": "<string>",
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": True
}
],
"synonyms": ["<string>"]
}
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({
name: '<string>',
code: '<string>',
compendium: 123,
cpts: ['<string>'],
lab_vendor: 123,
practice_created: 123,
procedure_class: '<string>',
questions: [
{
question: {
choices: [{code: '<string>', value: '<string>'}],
code: '<string>',
value: '<string>',
example_format: '<string>',
max_length: 32767,
secondary_code: '<string>'
},
sequence: 32767,
required: true
}
],
synonyms: ['<string>']
})
};
fetch('https://sandbox.elationemr.com/api/2.0/lab_order_tests/', 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/lab_order_tests/",
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([
'name' => '<string>',
'code' => '<string>',
'compendium' => 123,
'cpts' => [
'<string>'
],
'lab_vendor' => 123,
'practice_created' => 123,
'procedure_class' => '<string>',
'questions' => [
[
'question' => [
'choices' => [
[
'code' => '<string>',
'value' => '<string>'
]
],
'code' => '<string>',
'value' => '<string>',
'example_format' => '<string>',
'max_length' => 32767,
'secondary_code' => '<string>'
],
'sequence' => 32767,
'required' => true
]
],
'synonyms' => [
'<string>'
]
]),
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/lab_order_tests/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\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/lab_order_tests/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/lab_order_tests/")
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 \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": [
"<string>"
],
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123,
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123
}
],
"code": "<string>",
"value": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"example_format": "<string>",
"id": 123,
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": true,
"test": 123
}
],
"synonyms": [
"<string>"
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
The name of the Lab Order Test.
255Any code associated with the test, usually provided by the lab vendor's compendium.
50The id of the compendium provided the lab vendor that provides the lab order test. All tests in the same order MUST share the same compendium.
A list of CPT codes associated with the lab order test.
The id of the lab vendor who provides the lab order test.
The id of the practice that created the test if practice created.
Code provided by specific compendiums that indicate the "class" of test, e.g. histology vs cytology. Some lab vendors require that tests with specific procedure classes need to ordered separately.
50A list of Ask on Entry (AOE) Questions that need to be answered by the orderer when creating the order.
Show child attributes
Show child attributes
A list of synonyms that are useful when searching for a specific test.
Response
The name of the Lab Order Test.
255Any code associated with the test, usually provided by the lab vendor's compendium.
50The id of the compendium provided the lab vendor that provides the lab order test. All tests in the same order MUST share the same compendium.
A list of CPT codes associated with the lab order test.
Time at which Elation created this Lab Order Test.
Time at which this Lab Order Test was deleted. Can happen when a lab order compendium update deprecates a test.
The id of the lab vendor who provides the lab order test.
The id of the practice that created the test if practice created.
Code provided by specific compendiums that indicate the "class" of test, e.g. histology vs cytology. Some lab vendors require that tests with specific procedure classes need to ordered separately.
50A list of Ask on Entry (AOE) Questions that need to be answered by the orderer when creating the order.
Show child attributes
Show child attributes
A list of synonyms that are useful when searching for a specific test.
Was this page helpful?
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/lab_order_tests/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": [
"<string>"
],
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>"
}
],
"code": "<string>",
"value": "<string>",
"example_format": "<string>",
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": true
}
],
"synonyms": [
"<string>"
]
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/lab_order_tests/"
payload = {
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": ["<string>"],
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>"
}
],
"code": "<string>",
"value": "<string>",
"example_format": "<string>",
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": True
}
],
"synonyms": ["<string>"]
}
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({
name: '<string>',
code: '<string>',
compendium: 123,
cpts: ['<string>'],
lab_vendor: 123,
practice_created: 123,
procedure_class: '<string>',
questions: [
{
question: {
choices: [{code: '<string>', value: '<string>'}],
code: '<string>',
value: '<string>',
example_format: '<string>',
max_length: 32767,
secondary_code: '<string>'
},
sequence: 32767,
required: true
}
],
synonyms: ['<string>']
})
};
fetch('https://sandbox.elationemr.com/api/2.0/lab_order_tests/', 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/lab_order_tests/",
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([
'name' => '<string>',
'code' => '<string>',
'compendium' => 123,
'cpts' => [
'<string>'
],
'lab_vendor' => 123,
'practice_created' => 123,
'procedure_class' => '<string>',
'questions' => [
[
'question' => [
'choices' => [
[
'code' => '<string>',
'value' => '<string>'
]
],
'code' => '<string>',
'value' => '<string>',
'example_format' => '<string>',
'max_length' => 32767,
'secondary_code' => '<string>'
],
'sequence' => 32767,
'required' => true
]
],
'synonyms' => [
'<string>'
]
]),
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/lab_order_tests/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\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/lab_order_tests/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/lab_order_tests/")
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 \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"compendium\": 123,\n \"cpts\": [\n \"<string>\"\n ],\n \"lab_vendor\": 123,\n \"practice_created\": 123,\n \"procedure_class\": \"<string>\",\n \"questions\": [\n {\n \"question\": {\n \"choices\": [\n {\n \"code\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"code\": \"<string>\",\n \"value\": \"<string>\",\n \"example_format\": \"<string>\",\n \"max_length\": 32767,\n \"secondary_code\": \"<string>\"\n },\n \"sequence\": 32767,\n \"required\": true\n }\n ],\n \"synonyms\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"code": "<string>",
"compendium": 123,
"cpts": [
"<string>"
],
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123,
"lab_vendor": 123,
"practice_created": 123,
"procedure_class": "<string>",
"questions": [
{
"question": {
"choices": [
{
"code": "<string>",
"value": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123
}
],
"code": "<string>",
"value": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"example_format": "<string>",
"id": 123,
"max_length": 32767,
"secondary_code": "<string>"
},
"sequence": 32767,
"required": true,
"test": 123
}
],
"synonyms": [
"<string>"
]
}