Case
Case Compose
Case Compose - Section Narrative
Compose a Narrative based on name, age, gender, section, and teaching points
POST https://api-qa.med2lab.com/external/v1/case/compose/
Request Body
name*
string
Patient name
age*
string
Patient age
gender*
string
Patient gender
section*
string
"narrative" teaching_points string Teaching points of generated case
model*
String
"gpt-3.5-turbo", "gpt-4"... from OpenAI
stringcurl --location 'http://dev-api.med2lab.com/external/v1/case/compose/' \
--header 'Authorization: Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk' \
--header 'Content-Type: application/json' \
--data '{
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "narrative",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"model": "gpt-4"
}'import requests
import json
url = "http://dev-api.med2lab.com/external/v1/case/compose/"
payload = json.dumps({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "narrative",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"model": "gpt-4"
})
headers = {
'Authorization': 'Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "http://dev-api.med2lab.com/external/v1/case/compose/");
request.Headers.Add("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
var content = new StringContent("{\r\n \"name\": \"Peter\",\r\n \"age\": \"6 years old\",\r\n \"gender\": \"Male\",\r\n \"section\": \"narrative\",\r\n \"teaching_points\": \"Diagnose of DKA in a pediatric patient\",\r\n \"model\": \"gpt-4\"\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "narrative",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"model": "gpt-4"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://dev-api.med2lab.com/external/v1/case/compose/");
xhr.setRequestHeader("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Case Compose - Section Vital Signs
Compose a Vital Signs based on name, age, gender, section, other sections, and teaching points
POST https://api-qa.med2lab.com/external/v1/case/compose/
Request Body
name*
string
Patient name
age*
string
The id of the user who owns the pet
gender*
string
Patient gender
section*
string
"vital_signs" teaching_points string Teaching points of generated case other_sections string other sections such as narrative...
model*
string
"gpt-3.5-turbo", "gpt-4"... from OpenAI
packaged*
boolean
True returns a formatted JSON for vital signs. False only returns a string.
[
{
"vital_sign_name": "Temperature",
"current_value": "37.8",
"unit": "°C",
"start_value": "36",
"end_value": "37.5"
},
...
]curl --location 'http://dev-api.med2lab.com/external/v1/case/compose/' \
--header 'Authorization: Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk' \
--header 'Content-Type: application/json' \
--data '{
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "vital_signs",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": true
}'import requests
import json
url = "http://dev-api.med2lab.com/external/v1/case/compose/"
payload = json.dumps({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "vital_signs",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": True
})
headers = {
'Authorization': 'Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "http://dev-api.med2lab.com/external/v1/case/compose/");
request.Headers.Add("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
var content = new StringContent("{\r\n \"name\": \"Peter\",\r\n \"age\": \"6 years old\",\r\n \"gender\": \"Male\",\r\n \"section\": \"vital_signs\",\r\n \"teaching_points\": \"Diagnose of DKA in a pediatric patient\",\r\n \"other_sections\": \"NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.\",\r\n \"model\": \"gpt-4\",\r\n \"packaged\": true\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "vital_signs",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": true
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://dev-api.med2lab.com/external/v1/case/compose/");
xhr.setRequestHeader("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Case Compose - Section Exam
Compose a Exam based on name, age, gender, section, other sections, and teaching points
POST https://api-qa.med2lab.com/external/v1/case/compose/
Request Body
name*
string
Patient name
age*
string
Patient age
gender*
string
Patient gender
section*
string
"exam" teaching_points string Teaching points of generated case other_sections string other sections such as narrative...
model*
String
"gpt-3.5-turbo", "gpt-4"... from OpenAI
packaged*
boolean
True returns a formatted JSON for exam name and exam finding. False only returns a string.
[
{
"exam_name": "General Observation",
"exam_finding": "Peter appears lethargic and dehydrated. He is breathing rapidly and deeply, a pattern known as Kussmaul respiration, which is often seen in patients with severe metabolic acidosis such as diabetic ketoacidosis (DKA)."
},
...
]curl --location 'http://dev-api.med2lab.com/external/v1/case/compose/' \
--header 'Authorization: Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk' \
--header 'Content-Type: application/json' \
--data '{
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "exam",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": true
}'import requests
import json
url = "http://dev-api.med2lab.com/external/v1/case/compose/"
payload = json.dumps({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "exam",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": True
})
headers = {
'Authorization': 'Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "http://dev-api.med2lab.com/external/v1/case/compose/");
request.Headers.Add("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
var content = new StringContent("{\r\n \"name\": \"Peter\",\r\n \"age\": \"6 years old\",\r\n \"gender\": \"Male\",\r\n \"section\": \"exam\",\r\n \"teaching_points\": \"Diagnose of DKA in a pediatric patient\",\r\n \"other_sections\": \"NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.\",\r\n \"model\": \"gpt-4\",\r\n \"packaged\": true\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
// WARNING: For POST requests, body is set to null by browsers.
var data = JSON.stringify({
"name": "Peter",
"age": "6 years old",
"gender": "Male",
"section": "exam",
"teaching_points": "Diagnose of DKA in a pediatric patient",
"other_sections": "NARRATIVE: Peter, a 6-year-old boy, was brought to the emergency department by his parents who reported that he had been excessively thirsty and urinating frequently for the past week. They also noticed that he had lost weight and seemed unusually tired. Over the past day, Peter had started vomiting and his breath had a strange, fruity odor.",
"model": "gpt-4",
"packaged": true
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://dev-api.med2lab.com/external/v1/case/compose/");
xhr.setRequestHeader("Authorization", "Bearer PHApOPl7xtqc2ZEqg6c6AcL34DYOQk");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);Last updated