Skip to main content
PATCH
/
mr
/
api
/
v1
/
docs
/
{id}
Update Document
curl --request PATCH \
  --url https://api.eka.care/mr/api/v1/docs/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Pt-Id: <x-pt-id>' \
  --data '
{
  "dt": "lr",
  "ndhm": true,
  "oid": "161847797963700",
  "dd_e": 1614556800,
  "tg": [
    "covid"
  ],
  "cases": [
    "<string>"
  ],
  "metadata": "<string>"
}
'
import requests

url = "https://api.eka.care/mr/api/v1/docs/{id}"

payload = {
    "dt": "lr",
    "ndhm": True,
    "oid": "161847797963700",
    "dd_e": 1614556800,
    "tg": ["covid"],
    "cases": ["<string>"],
    "metadata": "<string>"
}
headers = {
    "X-Pt-Id": "<x-pt-id>",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PATCH',
  headers: {
    'X-Pt-Id': '<x-pt-id>',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    dt: 'lr',
    ndhm: true,
    oid: '161847797963700',
    dd_e: 1614556800,
    tg: ['covid'],
    cases: ['<string>'],
    metadata: '<string>'
  })
};

fetch('https://api.eka.care/mr/api/v1/docs/{id}', 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.eka.care/mr/api/v1/docs/{id}",
  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([
    'dt' => 'lr',
    'ndhm' => true,
    'oid' => '161847797963700',
    'dd_e' => 1614556800,
    'tg' => [
        'covid'
    ],
    'cases' => [
        '<string>'
    ],
    'metadata' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json",
    "X-Pt-Id: <x-pt-id>"
  ],
]);

$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.eka.care/mr/api/v1/docs/{id}"

	payload := strings.NewReader("{\n  \"dt\": \"lr\",\n  \"ndhm\": true,\n  \"oid\": \"161847797963700\",\n  \"dd_e\": 1614556800,\n  \"tg\": [\n    \"covid\"\n  ],\n  \"cases\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Pt-Id", "<x-pt-id>")
	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.patch("https://api.eka.care/mr/api/v1/docs/{id}")
  .header("X-Pt-Id", "<x-pt-id>")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"dt\": \"lr\",\n  \"ndhm\": true,\n  \"oid\": \"161847797963700\",\n  \"dd_e\": 1614556800,\n  \"tg\": [\n    \"covid\"\n  ],\n  \"cases\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.eka.care/mr/api/v1/docs/{id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Pt-Id"] = '<x-pt-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"dt\": \"lr\",\n  \"ndhm\": true,\n  \"oid\": \"161847797963700\",\n  \"dd_e\": 1614556800,\n  \"tg\": [\n    \"covid\"\n  ],\n  \"cases\": [\n    \"<string>\"\n  ],\n  \"metadata\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-Pt-Id
string
required

eka user id (OID)

Path Parameters

id
string
required

Document ID to update the document details.

Example:

"2df9e795-d368-4ceb-be9d-b44281703827"

Body

application/json
dt
string | null
required
Example:

"lr"

ndhm
boolean | null

If true, the record will be linked.

Example:

true

oid
string | null

OID associated with the document.

Example:

"161847797963700"

dd_e
integer<int64> | null

Format should be in epoch seconds.

Example:

1614556800

tg
string[] | null

Tags associated with the uploaded documents. The rules for tags are the same as the upload API.

Example:
["covid"]
cases
string[] | null

List of cases linked with Medical Record.

metadata
string

Metadata associated with document (FHIR Bundle Format).

Response

Document linked successfully.