curl --request POST \
--url https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"electronic_prescription": {},
"order": {},
"patient": {},
"prescriber": {}
}
'import requests
url = "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite"
payload = {
"electronic_prescription": {},
"order": {},
"patient": {},
"prescriber": {}
}
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({electronic_prescription: {}, order: {}, patient: {}, prescriber: {}})
};
fetch('https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite', 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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite",
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([
'electronic_prescription' => [
],
'order' => [
],
'patient' => [
],
'prescriber' => [
]
]),
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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite"
payload := strings.NewReader("{\n \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite")
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 \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\n}"
response = http.request(request)
puts response.read_body{
"patient": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"created": true
},
"prescriber": {
"id": "987fcdeb-51a2-43d1-9f12-345678901234",
"created": false
},
"electronic_prescription": {
"id": "456789ab-cdef-1234-5678-90abcdef1234",
"created": true
},
"order": {
"id": "789abcde-f012-3456-7890-123456789abc",
"created": true
},
"summary": {
"entities_created": 3,
"entities_referenced": 1
}
}Single request creation of a prescription and order (and patient/prescriber)
The composite request is a convenience function that allows you to create an electronic prescription and order in a single request, and optionally also create a patient and/or prescriber. The request body can contain the following objects: patient, prescriber, electronic_prescription, order. While no single entity is required (the composite request can be used to create a standalone order or electronic prescription), it is designed to be comprehensive. If any single entity creation fails, the entire request will fail and no entities will be created.
curl --request POST \
--url https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"electronic_prescription": {},
"order": {},
"patient": {},
"prescriber": {}
}
'import requests
url = "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite"
payload = {
"electronic_prescription": {},
"order": {},
"patient": {},
"prescriber": {}
}
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({electronic_prescription: {}, order: {}, patient: {}, prescriber: {}})
};
fetch('https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite', 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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite",
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([
'electronic_prescription' => [
],
'order' => [
],
'patient' => [
],
'prescriber' => [
]
]),
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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite"
payload := strings.NewReader("{\n \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\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://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions/composite")
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 \"electronic_prescription\": {},\n \"order\": {},\n \"patient\": {},\n \"prescriber\": {}\n}"
response = http.request(request)
puts response.read_body{
"patient": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"created": true
},
"prescriber": {
"id": "987fcdeb-51a2-43d1-9f12-345678901234",
"created": false
},
"electronic_prescription": {
"id": "456789ab-cdef-1234-5678-90abcdef1234",
"created": true
},
"order": {
"id": "789abcde-f012-3456-7890-123456789abc",
"created": true
},
"summary": {
"entities_created": 3,
"entities_referenced": 1
}
}Authorizations
Query Parameters
Body
Response
Response from composite entity creation. Only includes keys for entities that were provided in the request. For example, if only patient and order were requested, only those keys (plus summary) will be present in the response.