Update Case
curl --request PATCH \
--url https://api.eka.care/mr/api/v1/cases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Pt-Id: <x-pt-id>' \
--data '
{
"display_name": "Leg Injury",
"hi_type": "OPConsultation",
"type": "OP",
"occurred_at": 1678886400,
"partner_meta": {
"facility_id": "GH",
"uhid": "UHID_1234"
}
}
'import requests
url = "https://api.eka.care/mr/api/v1/cases/{id}"
payload = {
"display_name": "Leg Injury",
"hi_type": "OPConsultation",
"type": "OP",
"occurred_at": 1678886400,
"partner_meta": {
"facility_id": "GH",
"uhid": "UHID_1234"
}
}
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({
display_name: 'Leg Injury',
hi_type: 'OPConsultation',
type: 'OP',
occurred_at: 1678886400,
partner_meta: {facility_id: 'GH', uhid: 'UHID_1234'}
})
};
fetch('https://api.eka.care/mr/api/v1/cases/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.eka.care/mr/api/v1/cases/{id}")
.header("X-Pt-Id", "<x-pt-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/mr/api/v1/cases/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Pt-Id", "<x-pt-id>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/mr/api/v1/cases/{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 \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": "Missing required field: type",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "UNAUTHORIZED"
}{
"error": "Case not found for the given ID",
"code": "CASE_NOT_FOUND"
}{
"error": "Something went wrong while processing the request",
"code": "INTERNAL_SERVER_ERROR"
}Medical Records
Update Case
This endpoint allows updating details of an existing medical case using the case ID.
PATCH
/
mr
/
api
/
v1
/
cases
/
{id}
Update Case
curl --request PATCH \
--url https://api.eka.care/mr/api/v1/cases/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Pt-Id: <x-pt-id>' \
--data '
{
"display_name": "Leg Injury",
"hi_type": "OPConsultation",
"type": "OP",
"occurred_at": 1678886400,
"partner_meta": {
"facility_id": "GH",
"uhid": "UHID_1234"
}
}
'import requests
url = "https://api.eka.care/mr/api/v1/cases/{id}"
payload = {
"display_name": "Leg Injury",
"hi_type": "OPConsultation",
"type": "OP",
"occurred_at": 1678886400,
"partner_meta": {
"facility_id": "GH",
"uhid": "UHID_1234"
}
}
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({
display_name: 'Leg Injury',
hi_type: 'OPConsultation',
type: 'OP',
occurred_at: 1678886400,
partner_meta: {facility_id: 'GH', uhid: 'UHID_1234'}
})
};
fetch('https://api.eka.care/mr/api/v1/cases/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.eka.care/mr/api/v1/cases/{id}")
.header("X-Pt-Id", "<x-pt-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/mr/api/v1/cases/{id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Pt-Id", "<x-pt-id>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/mr/api/v1/cases/{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 \"display_name\": \"Leg Injury\",\n \"hi_type\": \"OPConsultation\",\n \"type\": \"OP\",\n \"occurred_at\": 1678886400,\n \"partner_meta\": {\n \"facility_id\": \"GH\",\n \"uhid\": \"UHID_1234\"\n }\n}"
response = http.request(request)
puts response.read_body{
"error": "Missing required field: type",
"code": "BAD_REQUEST"
}{
"error": "Invalid or expired token",
"code": "UNAUTHORIZED"
}{
"error": "Case not found for the given ID",
"code": "CASE_NOT_FOUND"
}{
"error": "Something went wrong while processing the request",
"code": "INTERNAL_SERVER_ERROR"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Patient ID
Path Parameters
Unique case ID
Body
application/json
Human-readable name for the case
Example:
"Leg Injury"
Type of case
Available options:
OPConsultation, Prescription, DischargeSummary, DiagnosticReport, ImmunizationRecord, HealthDocumentRecord, WellnessRecord Example:
"OPConsultation"
Type of the case
Example:
"OP"
Timestamp when the event occurred (Unix timestamp)
Example:
1678886400
metadata attached to the case.
Example:
{ "facility_id": "GH", "uhid": "UHID_1234" }
Response
Case updated successfully (no content)
Was this page helpful?

