Create Lab Order
Create a new lab order.
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/lab_orders/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [
123
],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": false,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"
]
}
]
},
"facility": {
"active": true,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"compendium": 123,
"description": "<string>",
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": true
},
"follow_up_method": "<string>",
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"fax": "<string>",
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>"
},
"sequence": 32767,
"specimen": 123
}
],
"test": 123,
"description": "<string>"
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [
123
],
"test_date": "2023-12-25",
"vendor": 123
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/lab_orders/"
payload = {
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [123],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": False,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"]
}
]
},
"facility": {
"active": True,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"compendium": 123,
"description": "<string>",
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": True
},
"follow_up_method": "<string>",
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"fax": "<string>",
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>"
},
"sequence": 32767,
"specimen": 123
}
],
"test": 123,
"description": "<string>"
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [123],
"test_date": "2023-12-25",
"vendor": 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({
document_date: '2023-11-07T05:31:56Z',
ordering_physician: 123,
patient: 123,
practice: 123,
answers: [{question: 123, test: 123, value: '<string>'}],
ccs: [123],
chart_date: '2023-11-07T05:31:56Z',
confidential: false,
content: {
collection_datetime: '2023-11-07T05:31:56Z',
icd10_codes: [{code: '<string>', description: '<string>'}],
patient_instructions: '<string>',
standing_order_end_date: '2023-12-25',
standing_order_frequency: '<string>',
test_center_notes: '<string>',
tests: [
{
icd10_codes: [{code: '<string>', description: '<string>'}],
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>']
}
]
},
facility: {
active: true,
lab_facility: '<string>',
practice: 123,
practice_facility: '<string>',
vendor: {display_name: '<string>', id: 123, name: '<string>'},
compendium: 123,
description: '<string>',
lab_connection: 123,
practice_secondary_id: '<string>',
user_facing: true
},
follow_up_method: '<string>',
printable_view: '<string>',
requisition: 123,
resolution: {note: '<string>', resolving_document: 123},
signed_by: 123,
signed_date: '2023-11-07T05:31:56Z',
site: {
name: '<string>',
address: '<string>',
city: '<string>',
fax: '<string>',
phone: '<string>',
practice_created: 123,
state: '<string>',
suite: '<string>',
vendor: {},
zip: '<string>'
},
special_insurance: {code: '<string>', name: '<string>'},
specimens: [
{
body_site: {code: '<string>', text: '<string>'},
container_id: '<string>',
modifiers: [
{modifier: {code: '<string>', text: '<string>'}, sequence: 32767, specimen: 123}
],
test: 123,
description: '<string>'
}
],
submissions: [
{
time_submitted: '2023-11-07T05:31:56Z',
state: '<string>',
state_metadata: '<string>',
time_acknowledged: '2023-11-07T05:31:56Z'
}
],
tags: [123],
test_date: '2023-12-25',
vendor: 123
})
};
fetch('https://sandbox.elationemr.com/api/2.0/lab_orders/', 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_orders/",
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([
'document_date' => '2023-11-07T05:31:56Z',
'ordering_physician' => 123,
'patient' => 123,
'practice' => 123,
'answers' => [
[
'question' => 123,
'test' => 123,
'value' => '<string>'
]
],
'ccs' => [
123
],
'chart_date' => '2023-11-07T05:31:56Z',
'confidential' => false,
'content' => [
'collection_datetime' => '2023-11-07T05:31:56Z',
'icd10_codes' => [
[
'code' => '<string>',
'description' => '<string>'
]
],
'patient_instructions' => '<string>',
'standing_order_end_date' => '2023-12-25',
'standing_order_frequency' => '<string>',
'test_center_notes' => '<string>',
'tests' => [
[
'icd10_codes' => [
[
'code' => '<string>',
'description' => '<string>'
]
],
'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>'
]
]
]
],
'facility' => [
'active' => true,
'lab_facility' => '<string>',
'practice' => 123,
'practice_facility' => '<string>',
'vendor' => [
'display_name' => '<string>',
'id' => 123,
'name' => '<string>'
],
'compendium' => 123,
'description' => '<string>',
'lab_connection' => 123,
'practice_secondary_id' => '<string>',
'user_facing' => true
],
'follow_up_method' => '<string>',
'printable_view' => '<string>',
'requisition' => 123,
'resolution' => [
'note' => '<string>',
'resolving_document' => 123
],
'signed_by' => 123,
'signed_date' => '2023-11-07T05:31:56Z',
'site' => [
'name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'fax' => '<string>',
'phone' => '<string>',
'practice_created' => 123,
'state' => '<string>',
'suite' => '<string>',
'vendor' => [
],
'zip' => '<string>'
],
'special_insurance' => [
'code' => '<string>',
'name' => '<string>'
],
'specimens' => [
[
'body_site' => [
'code' => '<string>',
'text' => '<string>'
],
'container_id' => '<string>',
'modifiers' => [
[
'modifier' => [
'code' => '<string>',
'text' => '<string>'
],
'sequence' => 32767,
'specimen' => 123
]
],
'test' => 123,
'description' => '<string>'
]
],
'submissions' => [
[
'time_submitted' => '2023-11-07T05:31:56Z',
'state' => '<string>',
'state_metadata' => '<string>',
'time_acknowledged' => '2023-11-07T05:31:56Z'
]
],
'tags' => [
123
],
'test_date' => '2023-12-25',
'vendor' => 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/lab_orders/"
payload := strings.NewReader("{\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 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/lab_orders/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/lab_orders/")
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 \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 123\n}"
response = http.request(request)
puts response.read_body{
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [
123
],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": false,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"id": 123,
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"
]
}
]
},
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"facility": {
"active": true,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"bidi_connection": {
"alias": "<string>",
"enabled": true,
"id": 123,
"priority": 32767,
"protocol": "<string>"
},
"compendium": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": 123,
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": true
},
"follow_up_method": "<string>",
"id": 123,
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"document": 123,
"id": 123,
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"fax": "<string>",
"id": 123,
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>",
"deleted_date": "2023-11-07T05:31:56Z"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>",
"deleted_date": "2023-11-07T05:31:56Z"
},
"sequence": 32767,
"specimen": 123,
"deleted_date": "2023-11-07T05:31:56Z"
}
],
"test": 123,
"description": "<string>",
"id": 123,
"lab_order": 123
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"id": 123,
"lab_order": 123,
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [
123
],
"test_date": "2023-12-25",
"vendor": 123
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Time at which this order was created in whichever system created it. Could be historical or same as the create_date.
The id of the physician who created the order.
The id of the patient.
The id of the practice.
List of the answers provided for the Ask on Entry (AOE) questions if required by any lab order tests.
Show child attributes
Show child attributes
Who is financially responsible for the order.
thirdparty- Third Party (e.g. Insurance)patient- Patientclient- Clientworkerscomp- Worker's Compspecialbilling- Special Billing
thirdparty, patient, client, workerscomp, specialbilling List of physician ids who should be cc'd on any reports.
Date at which this order was first seen in the patient's chart.
Whether the provider has marked the order as confidential. Should not be shared with a patient.
Represents the content of the lab order report.
Show child attributes
Show child attributes
An identifier that represents the facility placing the order. Usually assigned by the lab vendor.
Show child attributes
Show child attributes
Freetext field communicating how the patient should receive their results.
The requisition id of the order. Can be different from the order id if and when the order was created outside of Elation.
The current state of the order's resolution.
Show child attributes
Show child attributes
The id of the physician who signed off on the order.
The time when the order was signed.
The location where the patient will have the lab performed. Sites are specific to their lab vendor.
Show child attributes
Show child attributes
Used primarily to support specific electronic lab order integrations.
Show child attributes
Show child attributes
Record of any specimens collected when creating the order.
Show child attributes
Show child attributes
Record of the attempts to submit.
Show child attributes
Show child attributes
Any tags associated with the lab order.
The date on which the tests should be performed, or were performed. Can be different than document_date, create_date.
Response
Time at which this order was created in whichever system created it. Could be historical or same as the create_date.
The id of the physician who created the order.
The id of the patient.
The id of the practice.
List of the answers provided for the Ask on Entry (AOE) questions if required by any lab order tests.
Show child attributes
Show child attributes
Who is financially responsible for the order.
thirdparty- Third Party (e.g. Insurance)patient- Patientclient- Clientworkerscomp- Worker's Compspecialbilling- Special Billing
thirdparty, patient, client, workerscomp, specialbilling List of physician ids who should be cc'd on any reports.
Date at which this order was first seen in the patient's chart.
Whether the provider has marked the order as confidential. Should not be shared with a patient.
Represents the content of the lab order report.
Show child attributes
Show child attributes
Time at which elation created this order. Can be different from chart_date when the order was imported into a chart from a different source and document_date when documenting an order that happened at some other time.
An identifier that represents the facility placing the order. Usually assigned by the lab vendor.
Show child attributes
Show child attributes
Freetext field communicating how the patient should receive their results.
The requisition id of the order. Can be different from the order id if and when the order was created outside of Elation.
The current state of the order's resolution.
Show child attributes
Show child attributes
The id of the physician who signed off on the order.
The time when the order was signed.
The location where the patient will have the lab performed. Sites are specific to their lab vendor.
Show child attributes
Show child attributes
Used primarily to support specific electronic lab order integrations.
Show child attributes
Show child attributes
Record of any specimens collected when creating the order.
Show child attributes
Show child attributes
Record of the attempts to submit.
Show child attributes
Show child attributes
Any tags associated with the lab order.
The date on which the tests should be performed, or were performed. Can be different than document_date, create_date.
Was this page helpful?
curl --request POST \
--url https://sandbox.elationemr.com/api/2.0/lab_orders/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [
123
],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": false,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"
]
}
]
},
"facility": {
"active": true,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"compendium": 123,
"description": "<string>",
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": true
},
"follow_up_method": "<string>",
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"fax": "<string>",
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>"
},
"sequence": 32767,
"specimen": 123
}
],
"test": 123,
"description": "<string>"
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [
123
],
"test_date": "2023-12-25",
"vendor": 123
}
'import requests
url = "https://sandbox.elationemr.com/api/2.0/lab_orders/"
payload = {
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [123],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": False,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"]
}
]
},
"facility": {
"active": True,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"compendium": 123,
"description": "<string>",
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": True
},
"follow_up_method": "<string>",
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"fax": "<string>",
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>"
},
"sequence": 32767,
"specimen": 123
}
],
"test": 123,
"description": "<string>"
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [123],
"test_date": "2023-12-25",
"vendor": 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({
document_date: '2023-11-07T05:31:56Z',
ordering_physician: 123,
patient: 123,
practice: 123,
answers: [{question: 123, test: 123, value: '<string>'}],
ccs: [123],
chart_date: '2023-11-07T05:31:56Z',
confidential: false,
content: {
collection_datetime: '2023-11-07T05:31:56Z',
icd10_codes: [{code: '<string>', description: '<string>'}],
patient_instructions: '<string>',
standing_order_end_date: '2023-12-25',
standing_order_frequency: '<string>',
test_center_notes: '<string>',
tests: [
{
icd10_codes: [{code: '<string>', description: '<string>'}],
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>']
}
]
},
facility: {
active: true,
lab_facility: '<string>',
practice: 123,
practice_facility: '<string>',
vendor: {display_name: '<string>', id: 123, name: '<string>'},
compendium: 123,
description: '<string>',
lab_connection: 123,
practice_secondary_id: '<string>',
user_facing: true
},
follow_up_method: '<string>',
printable_view: '<string>',
requisition: 123,
resolution: {note: '<string>', resolving_document: 123},
signed_by: 123,
signed_date: '2023-11-07T05:31:56Z',
site: {
name: '<string>',
address: '<string>',
city: '<string>',
fax: '<string>',
phone: '<string>',
practice_created: 123,
state: '<string>',
suite: '<string>',
vendor: {},
zip: '<string>'
},
special_insurance: {code: '<string>', name: '<string>'},
specimens: [
{
body_site: {code: '<string>', text: '<string>'},
container_id: '<string>',
modifiers: [
{modifier: {code: '<string>', text: '<string>'}, sequence: 32767, specimen: 123}
],
test: 123,
description: '<string>'
}
],
submissions: [
{
time_submitted: '2023-11-07T05:31:56Z',
state: '<string>',
state_metadata: '<string>',
time_acknowledged: '2023-11-07T05:31:56Z'
}
],
tags: [123],
test_date: '2023-12-25',
vendor: 123
})
};
fetch('https://sandbox.elationemr.com/api/2.0/lab_orders/', 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_orders/",
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([
'document_date' => '2023-11-07T05:31:56Z',
'ordering_physician' => 123,
'patient' => 123,
'practice' => 123,
'answers' => [
[
'question' => 123,
'test' => 123,
'value' => '<string>'
]
],
'ccs' => [
123
],
'chart_date' => '2023-11-07T05:31:56Z',
'confidential' => false,
'content' => [
'collection_datetime' => '2023-11-07T05:31:56Z',
'icd10_codes' => [
[
'code' => '<string>',
'description' => '<string>'
]
],
'patient_instructions' => '<string>',
'standing_order_end_date' => '2023-12-25',
'standing_order_frequency' => '<string>',
'test_center_notes' => '<string>',
'tests' => [
[
'icd10_codes' => [
[
'code' => '<string>',
'description' => '<string>'
]
],
'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>'
]
]
]
],
'facility' => [
'active' => true,
'lab_facility' => '<string>',
'practice' => 123,
'practice_facility' => '<string>',
'vendor' => [
'display_name' => '<string>',
'id' => 123,
'name' => '<string>'
],
'compendium' => 123,
'description' => '<string>',
'lab_connection' => 123,
'practice_secondary_id' => '<string>',
'user_facing' => true
],
'follow_up_method' => '<string>',
'printable_view' => '<string>',
'requisition' => 123,
'resolution' => [
'note' => '<string>',
'resolving_document' => 123
],
'signed_by' => 123,
'signed_date' => '2023-11-07T05:31:56Z',
'site' => [
'name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'fax' => '<string>',
'phone' => '<string>',
'practice_created' => 123,
'state' => '<string>',
'suite' => '<string>',
'vendor' => [
],
'zip' => '<string>'
],
'special_insurance' => [
'code' => '<string>',
'name' => '<string>'
],
'specimens' => [
[
'body_site' => [
'code' => '<string>',
'text' => '<string>'
],
'container_id' => '<string>',
'modifiers' => [
[
'modifier' => [
'code' => '<string>',
'text' => '<string>'
],
'sequence' => 32767,
'specimen' => 123
]
],
'test' => 123,
'description' => '<string>'
]
],
'submissions' => [
[
'time_submitted' => '2023-11-07T05:31:56Z',
'state' => '<string>',
'state_metadata' => '<string>',
'time_acknowledged' => '2023-11-07T05:31:56Z'
]
],
'tags' => [
123
],
'test_date' => '2023-12-25',
'vendor' => 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/lab_orders/"
payload := strings.NewReader("{\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 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/lab_orders/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.elationemr.com/api/2.0/lab_orders/")
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 \"document_date\": \"2023-11-07T05:31:56Z\",\n \"ordering_physician\": 123,\n \"patient\": 123,\n \"practice\": 123,\n \"answers\": [\n {\n \"question\": 123,\n \"test\": 123,\n \"value\": \"<string>\"\n }\n ],\n \"ccs\": [\n 123\n ],\n \"chart_date\": \"2023-11-07T05:31:56Z\",\n \"confidential\": false,\n \"content\": {\n \"collection_datetime\": \"2023-11-07T05:31:56Z\",\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\n \"patient_instructions\": \"<string>\",\n \"standing_order_end_date\": \"2023-12-25\",\n \"standing_order_frequency\": \"<string>\",\n \"test_center_notes\": \"<string>\",\n \"tests\": [\n {\n \"icd10_codes\": [\n {\n \"code\": \"<string>\",\n \"description\": \"<string>\"\n }\n ],\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 }\n ]\n },\n \"facility\": {\n \"active\": true,\n \"lab_facility\": \"<string>\",\n \"practice\": 123,\n \"practice_facility\": \"<string>\",\n \"vendor\": {\n \"display_name\": \"<string>\",\n \"id\": 123,\n \"name\": \"<string>\"\n },\n \"compendium\": 123,\n \"description\": \"<string>\",\n \"lab_connection\": 123,\n \"practice_secondary_id\": \"<string>\",\n \"user_facing\": true\n },\n \"follow_up_method\": \"<string>\",\n \"printable_view\": \"<string>\",\n \"requisition\": 123,\n \"resolution\": {\n \"note\": \"<string>\",\n \"resolving_document\": 123\n },\n \"signed_by\": 123,\n \"signed_date\": \"2023-11-07T05:31:56Z\",\n \"site\": {\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"fax\": \"<string>\",\n \"phone\": \"<string>\",\n \"practice_created\": 123,\n \"state\": \"<string>\",\n \"suite\": \"<string>\",\n \"vendor\": {},\n \"zip\": \"<string>\"\n },\n \"special_insurance\": {\n \"code\": \"<string>\",\n \"name\": \"<string>\"\n },\n \"specimens\": [\n {\n \"body_site\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"container_id\": \"<string>\",\n \"modifiers\": [\n {\n \"modifier\": {\n \"code\": \"<string>\",\n \"text\": \"<string>\"\n },\n \"sequence\": 32767,\n \"specimen\": 123\n }\n ],\n \"test\": 123,\n \"description\": \"<string>\"\n }\n ],\n \"submissions\": [\n {\n \"time_submitted\": \"2023-11-07T05:31:56Z\",\n \"state\": \"<string>\",\n \"state_metadata\": \"<string>\",\n \"time_acknowledged\": \"2023-11-07T05:31:56Z\"\n }\n ],\n \"tags\": [\n 123\n ],\n \"test_date\": \"2023-12-25\",\n \"vendor\": 123\n}"
response = http.request(request)
puts response.read_body{
"document_date": "2023-11-07T05:31:56Z",
"ordering_physician": 123,
"patient": 123,
"practice": 123,
"answers": [
{
"question": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"id": 123,
"test": 123,
"value": "<string>"
}
],
"ccs": [
123
],
"chart_date": "2023-11-07T05:31:56Z",
"confidential": false,
"content": {
"collection_datetime": "2023-11-07T05:31:56Z",
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"id": 123,
"patient_instructions": "<string>",
"standing_order_end_date": "2023-12-25",
"standing_order_frequency": "<string>",
"test_center_notes": "<string>",
"tests": [
{
"icd10_codes": [
{
"code": "<string>",
"description": "<string>"
}
],
"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>"
]
}
]
},
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"facility": {
"active": true,
"lab_facility": "<string>",
"practice": 123,
"practice_facility": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"bidi_connection": {
"alias": "<string>",
"enabled": true,
"id": 123,
"priority": 32767,
"protocol": "<string>"
},
"compendium": 123,
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"description": "<string>",
"id": 123,
"lab_connection": 123,
"practice_secondary_id": "<string>",
"user_facing": true
},
"follow_up_method": "<string>",
"id": 123,
"printable_view": "<string>",
"requisition": 123,
"resolution": {
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"document": 123,
"id": 123,
"note": "<string>",
"resolving_document": 123
},
"signed_by": 123,
"signed_date": "2023-11-07T05:31:56Z",
"site": {
"name": "<string>",
"address": "<string>",
"city": "<string>",
"created_date": "2023-11-07T05:31:56Z",
"deleted_date": "2023-11-07T05:31:56Z",
"fax": "<string>",
"id": 123,
"phone": "<string>",
"practice_created": 123,
"state": "<string>",
"suite": "<string>",
"vendor": {
"display_name": "<string>",
"id": 123,
"name": "<string>"
},
"zip": "<string>"
},
"special_insurance": {
"code": "<string>",
"name": "<string>"
},
"specimens": [
{
"body_site": {
"code": "<string>",
"text": "<string>",
"deleted_date": "2023-11-07T05:31:56Z"
},
"container_id": "<string>",
"modifiers": [
{
"modifier": {
"code": "<string>",
"text": "<string>",
"deleted_date": "2023-11-07T05:31:56Z"
},
"sequence": 32767,
"specimen": 123,
"deleted_date": "2023-11-07T05:31:56Z"
}
],
"test": 123,
"description": "<string>",
"id": 123,
"lab_order": 123
}
],
"submissions": [
{
"time_submitted": "2023-11-07T05:31:56Z",
"id": 123,
"lab_order": 123,
"state": "<string>",
"state_metadata": "<string>",
"time_acknowledged": "2023-11-07T05:31:56Z"
}
],
"tags": [
123
],
"test_date": "2023-12-25",
"vendor": 123
}