Generate Discharge Summary
curl --request GET \
--url https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id} \
--header 'auth: <auth>'import requests
url = "https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}"
headers = {"auth": "<auth>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {auth: '<auth>'}};
fetch('https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_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/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("auth", "<auth>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}")
.header("auth", "<auth>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["auth"] = '<auth>'
response = http.request(request)
puts response.read_bodydata:{"text":"<h2>Discharge Summary</h2>","is_eof":false,"tokens":{"input":-1,"index":0}}
data:{"text":"<p>Patient was admitted with fever.</p>","is_eof":false,"tokens":{"input":-1,"index":1}}
data:{"text":"","is_eof":true,"tokens":{"input":-1,"index":2}}
{
"success": false,
"error": "Admission not found"
}{
"message": "<string>"
}Admissions
Generate Discharge Summary
Overview
This API uses AI to draft a discharge summary for an IPD admission of your workspace, from the patient’s details and the prescriptions of the admission’s visits (latest visit first, each dated). The draft is streamed as HTML while it is written. To save it, use Create Discharge Summary.
Response format: text/event-stream. Each event is one line starting with data: followed by JSON:
text— the next piece of the summary as HTML, sent a line at a time (append it to what you have).is_eof—trueon the last event, which has emptytext.tokens.index— the position of the piece in the stream.
Events are separated by a single newline. If the summary cannot be started (for example the admission does not exist), a JSON error is returned instead with status 400.
GET
/
ipd
/
v1
/
service
/
admissions
/
generate-discharge-summary
/
{admission_id}
Generate Discharge Summary
curl --request GET \
--url https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id} \
--header 'auth: <auth>'import requests
url = "https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}"
headers = {"auth": "<auth>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {auth: '<auth>'}};
fetch('https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_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/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("auth", "<auth>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}")
.header("auth", "<auth>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/ipd/v1/service/admissions/generate-discharge-summary/{admission_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["auth"] = '<auth>'
response = http.request(request)
puts response.read_bodydata:{"text":"<h2>Discharge Summary</h2>","is_eof":false,"tokens":{"input":-1,"index":0}}
data:{"text":"<p>Patient was admitted with fever.</p>","is_eof":false,"tokens":{"input":-1,"index":1}}
data:{"text":"","is_eof":true,"tokens":{"input":-1,"index":2}}
{
"success": false,
"error": "Admission not found"
}{
"message": "<string>"
}Was this page helpful?

