The Medpro24 API is provided under our End User License agreement.
Base URL: https://api.medpro24.com/
All API calls require the following POST parameters:
userkey: String, required. command: String, required. Command: getpatientlist
Method: POST
Description:
yourcode: integer.firstname: String.lastname: String.email: String.cellphone: String.dateofbirth: String.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "userkey=your_userkey&command=getpatientlist",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
try
{
var url = "https://api.medpro24.com/";
var content = new StringContent(
"userkey=your_userkey&command=getpatientlist",
Encoding.UTF8,
"application/x-www-form-urlencoded"
);
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
}
import requests
url = "https://api.medpro24.com/"
payload = {
"userkey": "your_userkey",
"command": "getpatientlist"
}
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
npm install axios
const axios = require('axios');
const qs = require('qs');
async function getpatientlist() {
const url = 'https://api.medpro24.com/';
const data = qs.stringify({
userkey: 'your_userkey',
command: 'getpatientlist'
});
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
};
try {
const response = await axios.post(url, data, config);
console.log(response.data);
} catch (error) {
console.error('Error making API call:', error);
}
}
getpatientlist();
Command: updatepatientdetails
Method: POST
Description: This endpoint inserts ot updates the information of a patient.
patientcode: String, required.patientname: String, required. email: String, optional. cellphone: String, optionalres_code: integer.res_text: String.
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "userkey=your_userkey&command=updatepatientdetails&patientcode=12345&patientname=John+Doe",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
try
{
var url = "https://api.medpro24.com/";
var content = new StringContent(
"userkey=your_userkey&command=updatepatientdetails&patientcode=12345&patientname=John+Doe&age=45&address=123+Main+St",
Encoding.UTF8,
"application/x-www-form-urlencoded"
);
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
}
import requests
url = "https://api.medpro24.com/"
payload = {
"userkey": "your_userkey",
"command": "updatepatientdetails",
"patientcode": "12345",
"patientname": "John Doe"
}
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
npm install axios
const axios = require('axios');
const qs = require('qs');
async function updatePatientDetails() {
const url = 'https://api.medpro24.com/';
const data = qs.stringify({
userkey: 'your_userkey',
command: 'updatepatientdetails',
patientcode: '12345',
patientname: 'John Doe'
});
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
};
try {
const response = await axios.post(url, data, config);
console.log(response.data);
} catch (error) {
console.error('Error making API call:', error);
}
}
updatePatientDetails();
Command: updateexam
Method: POST
Description: This endpoint updates the details of a patient's exam.
examname: String, requiredexamcode: String, requiredpatientcode: String, requiredexamdate: Date (YYYY-MM-DD), requiredresult: String, optionalresultunits: String, optionalresultsfile: file, optional<?php
$curl = curl_init();
// Path to the file you want to upload
$filepath = '/path/to/your/file.jpg';
$filedata = new CURLFile($filePath, 'image/png', basename($filepath));
// Payload data including the file
$data = array(
'userkey' => 'your_userkey',
'command' => 'updateexam',
'examname' => $yourexamname, // Name of the exam ex. Cholesterol HDL OR Brain MRI SAG FLAIR
'examcode' => $yourexamcode, // Your system code for this exam
'patientcode' => $yourpatientcode, // Your code for this patient
'examdate' => $dateofexam, // YYYYMMDD formatted date
'result' => $lineresults, // If it is a numeric or text result
'resultunits' => $resultunits, // Units for numeric results
'resultsfile' => $filedata // Adding file to the payload in case of imaging etc
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
"Content-Type: multipart/form-data"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.IO;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
try
{
var url = "https://api.medpro24.com/";
var filePath = @"path\to\your\file\0000001.jpg"; // Specify the path for the exam file
await UpdateExam(url, "your_userkey", "12345", "Cholesterol HDL", "EX123", "20240605", "200", "mg/dL", filePath);
}
catch (Exception e)
{
Console.WriteLine($"Exception: {e.Message}");
}
}
static async Task UpdateExam(string url, string userkey, string patientcode, string examname, string examcode, string examdate, string result, string resultunits, string filePath)
{
using (var content = new MultipartFormDataContent())
{
content.Add(new StringContent(userkey), "userkey");
content.Add(new StringContent("updateexam"), "command");
content.Add(new StringContent(patientcode), "patientcode");
content.Add(new StringContent(examname), "examname");
content.Add(new StringContent(examcode), "examcode");
content.Add(new StringContent(examdate), "examdate");
content.Add(new StringContent(result), "result");
content.Add(new StringContent(resultunits), "resultunits");
if (File.Exists(filePath))
{
var fileContent = new ByteArrayContent(File.ReadAllBytes(filePath));
fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
content.Add(fileContent, "resultsfile", Path.GetFileName(filePath));
}
else
{
Console.WriteLine("File not found.");
return;
}
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
import requests
url = "https://api.medpro24.com/"
# Path to the file you want to test
file_path = '/path/to/your/file.jpg'
# Open the file in binary mode
with open(file_path, 'rb') as file:
files = {
'resultsfile': (file_path, file, 'image/jpeg') # In case of imaging etc, specify the path for the file, assuming the file is a JPEG image (this can be an image, a PDF or a raw DICOM file)
}
payload = {
"userkey": "your_userkey",
"command": "runmodel",
"examname": "12345", // Name of the exam ex. Cholesterol HDL OR Brain MRI SAG FLAIR
"examcode": "12345", // Your system code for this exam
"patientcode": "12345", // Your code for this patient
"examdate": "", // YYYYMMDD formatted date
"result": "12345", // If it is a numeric or text result
"resultunits": "12345" // Units for numeric results
}
# Make the POST request
response = requests.post(url, data=payload, files=files)
# Print the response text
print(response.text)
npm install axios form-data
const axios = require('axios');
const qs = require('qs');
const FormData = require('form-data');
const fs = require('fs');
async function updateexam() {
const url = 'https://api.medpro24.com/';
// Create an instance of FormData
const form = new FormData();
// Append fields to the form
form.append('userkey', 'your_userkey');
form.append('command', 'updateexam');
form.append('examname', '12345'); // Name of the exam ex. Cholesterol HDL OR Brain MRI SAG FLAIR
form.append('examcode', '12345'); // Your system code for this exam
form.append('patientcode', '12345'); // Your code for this patient
form.append('examdate', '12345'); // YYYYMMDD formatted date
form.append('result', '12345'); // If it is a numeric or text result
form.append('resultunits', '12345'); // Units for numeric results
// Path to the file you want to upload
const filePath = '/path/to/your/file.jpg'; # Specify the path for the file in case of imaging etc, assuming the file is a JPEG image (this can be an image, a PDF or a raw DICOM file)
// Ensure the file exists
if (fs.existsSync(filePath)) {
// Append file to form
form.append('resultsfile', fs.createReadStream(filePath), {
filename: 'file.jpg', // Optional, form-data derives it from the file path
contentType: 'image/jpeg', // Optional, form-data can derive it from the file extension
knownLength: fs.statSync(filePath).size // Optional, improves upload performance
});
} else {
console.log('File not found');
return;
}
// Axios configuration for the request
const config = {
headers: {
...form.getHeaders(), // Automatically sets the content-type to multipart/form-data with boundary
}
};
try {
const response = await axios.post(url, form, config);
console.log(response.data);
} catch (error) {
console.error('Error making API call:', error);
}
}
updateexam();
Command: updateprescription
Method: POST
Description: This endpoint updates the details of a patient's exam.
patientcode: String, requiredprescriptioncode: String, requiredprescriptiondate: Date (YYYY-MM-DD), requiredprescriptiontext: String, requiredquantity: Numeric, optionalunits: String, optionalfrequency: Integer, optional<?php
$curl = curl_init();
$data = array(
'userkey' => 'your_userkey',
'command' => 'updateprescription',
'patientcode' => $yourpatientcode, // Your code for this patient
'prescriptiontext' => $prescriptiontext, // Name of the prescription ex. Vitamin D 4000 iu daily
'prescriptioncode' => $yourprescriptioncode, // Your system code for this prescription ex. ABC0001
'prescriptiondate' => $dateofprescription, // YYYYMMDD formatted date
'quantity' => $prescr_quantity, // ex. 4000
'units' => $prescr_units, // ex. 'iu'
'frequency' => $prescr_frequency // Frequency in hours ex. '24'
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
await UpdatePrescription("your_userkey", "your_patientcode", "prescription_text", "your_prescriptioncode", "date_of_prescription", "quantity", "units");
}
static async Task UpdatePrescription(string userKey, string patientCode, string prescriptionText, string prescriptionCode, string dateOfPrescription, string quantity, string units)
{
try
{
var url = "https://api.medpro24.com/";
var content = new StringContent(
$"userkey={userKey}&command=updateprescription&patientcode={patientCode}&prescriptiontext={prescriptionText}&prescriptioncode={prescriptionCode}&prescriptiondate={dateOfPrescription}&quantity={quantity}&units={units}",
Encoding.UTF8,
"application/x-www-form-urlencoded"
);
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
}
import requests
def update_prescription(userkey, patientcode, prescriptiontext, prescriptioncode, prescriptiondate, quantity, units, frequency):
url = "https://api.medpro24.com/"
payload = {
"userkey": userkey,
"command": "updateprescription",
"patientcode": patientcode, # Your code for this patient
"prescriptiontext": prescriptiontext, # Name of the prescription e.g., Vitamin D 4000 iu daily
"prescriptioncode": prescriptioncode, # Your system code for this prescription e.g., ABC0001
"prescriptiondate": prescriptiondate, # YYYYMMDD formatted date
"quantity": quantity, # e.g., 4000
"units": units, # e.g., 'iu'
"frequency": frequency # Frequency in hours e.g., '24'
}
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
# Example call
update_prescription("your_userkey", "12345", "Vitamin D 4000 iu daily", "ABC0001", "20240604", "4000", "iu", "24")
const axios = require('axios');
async function updatePrescription(userkey, patientcode, prescriptiontext, prescriptioncode, prescriptiondate, quantity, units, frequency) {
const url = 'https://api.medpro24.com/';
const payload = {
userkey: userkey,
command: 'updateprescription',
patientcode: patientcode, // Your code for this patient
prescriptiontext: prescriptiontext, // Name of the prescription e.g., Vitamin D 4000 iu daily
prescriptioncode: prescriptioncode, // Your system code for this prescription e.g., ABC0001
prescriptiondate: prescriptiondate, // YYYYMMDD formatted date
quantity: quantity, // e.g., 4000
units: units, // e.g., 'iu'
frequency: frequency // Frequency in hours e.g., '24'
};
const headers = {
'Content-Type': 'application/x-www-form-urlencoded'
};
try {
const response = await axios.post(url, payload, { headers: headers });
console.log(response.data);
} catch (error) {
console.error('Error making the POST request:', error.message);
}
}
// Example call
updatePrescription('your_userkey', '12345', 'Vitamin D 4000 iu daily', 'ABC0001', '20240604', '4000', 'iu', '24');
Command: listmodels
Method: POST
Description: Returns a list of available models to run.
instrument: Alphanumeric, optionalexamtype: Alphanumeric, optional<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "userkey=your_userkey&command=listmodels",
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
try
{
var url = "https://api.medpro24.com/";
var content = new StringContent(
"userkey=your_userkey&command=listmodels",
Encoding.UTF8,
"application/x-www-form-urlencoded"
);
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
}
import requests
url = "https://api.medpro24.com/"
payload = {
"userkey": "your_userkey",
"command": "listmodels"
}
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)
npm install axios
const axios = require('axios');
const qs = require('qs');
async function listmodels() {
const url = 'https://api.medpro24.com/';
const data = qs.stringify({
userkey: 'your_userkey',
command: 'listmodels'
});
const config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
};
try {
const response = await axios.post(url, data, config);
console.log(response.data);
} catch (error) {
console.error('Error making API call:', error);
}
}
listmodels();
Command: runmodel
Method: POST
Description: Submit an image for classification.
modelid: Integer, requiredimage: File, required<php
$curl = curl_init();
// Path to the file you want to test
$filePath = '/path/to/your/file.jpg';
$fileData = new CURLFile($filePath, 'image/jpeg', basename($filePath));
// Payload data including the file
$data = array(
'userkey' => 'your_userkey',
'command' => 'runmodel',
'modelid' => $modelid,
'image' => $fileData // Adding file to the payload
);
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.medpro24.com/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => array(
"Content-Type: multipart/form-data"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.IO;
class Program
{
static readonly HttpClient client = new HttpClient();
static async Task Main()
{
try
{
var url = "https://api.medpro24.com/";
var filePath = @"path\to\your\file\0000001.jpg"; // Specify the path for the file you want to test (this can be an image, a PDF or a raw DICOM file)
using (var content = new MultipartFormDataContent())
{'
content.Add(new StringContent("your_userkey"), "userkey");
content.Add(new StringContent("runmodel"), "command");
content.Add(new StringContent("12345"), "modelid"); // the id of the model you want to run
if (File.Exists(filePath))
{
// Read file into a byte array and add to the multipart form data content
var fileContent = new ByteArrayContent(File.ReadAllBytes(filePath));
fileContent.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("image/jpeg");
content.Add(fileContent, "resultsfile", Path.GetFileName(filePath));
}
else
{
Console.WriteLine("File not found.");
return;
}
HttpResponseMessage response = await client.PostAsync(url, content);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
catch (HttpRequestException e)
{
Console.WriteLine($"Request exception: {e.Message}");
}
}
}
import requests
url = "https://api.medpro24.com/"
# Path to the file you want to test
file_path = '/path/to/your/file.jpg'
# Open the file in binary mode
with open(file_path, 'rb') as file:
files = {
'file': (file_path, file, 'image/jpeg') # Specify the path for the file you want to test, assuming the file is a JPEG image (this can be an image, a PDF or a raw DICOM file)
}
# Data to be sent; files do not need to be included in the payload dictionary
payload = {
"userkey": "your_userkey",
"command": "runmodel",
"modelid": "12345",
}
# Make the POST request
response = requests.post(url, data=payload, files=files)
# Print the response text
print(response.text)
npm install axios form-data
const axios = require('axios');
const qs = require('qs');
const FormData = require('form-data');
const fs = require('fs');
async function runmodel() {
const url = 'https://api.medpro24.com/';
// Create an instance of FormData
const form = new FormData();
// Append fields to the form
form.append('userkey', 'your_userkey');
form.append('command', 'runmodel');
form.append('modelid', '12345');
// Path to the file you want to upload
const filePath = '/path/to/your/file.jpg'; # Specify the path for the file you want to test, assuming the file is a JPEG image (this can be an image, a PDF or a raw DICOM file)
// Ensure the file exists
if (fs.existsSync(filePath)) {
// Append file to form
form.append('file', fs.createReadStream(filePath), {
filename: 'file.jpg', // Optional, form-data derives it from the file path
contentType: 'image/jpeg', // Optional, form-data can derive it from the file extension
knownLength: fs.statSync(filePath).size // Optional, improves upload performance
});
} else {
console.log('File not found');
return;
}
// Axios configuration for the request
const config = {
headers: {
...form.getHeaders(), // Automatically sets the content-type to multipart/form-data with boundary
}
};
try {
const response = await axios.post(url, form, config);
console.log(response.data);
} catch (error) {
console.error('Error making API call:', error);
}
}
runmodel();