Raw FHIR patch
curl --request PATCH \
--url https://api.clinikapi.com/v1/fhir/{path} \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"path": "<string>",
"value": "<unknown>"
}
]
'import requests
url = "https://api.clinikapi.com/v1/fhir/{path}"
payload = [
{
"path": "<string>",
"value": "<unknown>"
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify([{path: '<string>', value: '<unknown>'}])
};
fetch('https://api.clinikapi.com/v1/fhir/{path}', 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.clinikapi.com/v1/fhir/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'path' => '<string>',
'value' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"x-api-key: <api-key>"
],
]);
$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.clinikapi.com/v1/fhir/{path}"
payload := strings.NewReader("[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.clinikapi.com/v1/fhir/{path}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/fhir/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]"
response = http.request(request)
puts response.read_bodyFHIR Passthrough
Patch (FHIR)
Update a FHIR R4 resource using JSON Patch.
PATCH
/
v1
/
fhir
/
{path}
Raw FHIR patch
curl --request PATCH \
--url https://api.clinikapi.com/v1/fhir/{path} \
--header 'Content-Type: application/json-patch+json' \
--header 'x-api-key: <api-key>' \
--data '
[
{
"path": "<string>",
"value": "<unknown>"
}
]
'import requests
url = "https://api.clinikapi.com/v1/fhir/{path}"
payload = [
{
"path": "<string>",
"value": "<unknown>"
}
]
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json-patch+json'},
body: JSON.stringify([{path: '<string>', value: '<unknown>'}])
};
fetch('https://api.clinikapi.com/v1/fhir/{path}', 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.clinikapi.com/v1/fhir/{path}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
[
'path' => '<string>',
'value' => '<unknown>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json-patch+json",
"x-api-key: <api-key>"
],
]);
$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.clinikapi.com/v1/fhir/{path}"
payload := strings.NewReader("[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.clinikapi.com/v1/fhir/{path}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json-patch+json")
.body("[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clinikapi.com/v1/fhir/{path}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json-patch+json'
request.body = "[\n {\n \"path\": \"<string>\",\n \"value\": \"<unknown>\"\n }\n]"
response = http.request(request)
puts response.read_bodyPatch a FHIR Resource
curl -X PATCH https://api.clinikapi.com/v1/fhir/Patient/pt_abc123 \
-H "x-api-key: clk_live_abc123" \
-H "Content-Type: application/json-patch+json" \
-d '[
{ "op": "replace", "path": "/name/0/family", "value": "Johnson" },
{ "op": "add", "path": "/telecom/-", "value": { "system": "phone", "value": "+1-555-0200" } }
]'