AI Services
MediLoop's AI services provide world-class clinical intelligence including patient timeline RAG, clinical decision support, automated documentation, predictive analytics, and multi-role AI assistants. All services are designed to augment healthcare provider decision-making.
Capabilities Overview
Patient Timeline RAG
Longitudinal patient memory with real-time sync
Clinical Decision Support
Diagnosis, drug safety, critical values
Automated Documentation
SOAP notes, discharge summaries
Predictive Analytics
Risk scores, sepsis detection
Proactive Healthcare
Care gaps, adherence monitoring
Multi-Role Assistants
Pharmacist, nurse, lab, researcher
All Endpoints
/api/v1/ai/process/Process clinical message/api/v1/documentation/soap-note/Generate SOAP note/api/v1/documentation/extract-entities/Extract medical entities/api/v1/clinical-decision-support/drug-interactions/Check drug interactions/api/v1/clinical-decision-support/critical-values/Detect critical values/api/v1/patient-timeline/timeline/{uhid}/Get patient timeline/api/v1/copilot/encounter/start/Start encounter copilot/api/v1/predictive-analytics/risk-scores/Calculate risk scoresPatient Timeline
Retrieve comprehensive patient timeline with longitudinal clinical data for RAG-powered context.
/api/v1/patient-timeline/timeline/{uhid}/curl -X GET https://api.mediloop.co/api/v1/patient-timeline/timeline/UG123456789A/ \
-H "Authorization: Bearer sk_live_..."{
"uhid": "UG123456789A",
"timeline": {
"encounters": [
{
"id": "enc-001",
"date": "2025-12-15",
"type": "outpatient",
"chief_complaint": "Fever"
}
],
"diagnoses": [
{
"code": "I10",
"display": "Essential hypertension",
"date": "2024-06-01"
}
],
"medications": [
{
"name": "Lisinopril",
"dose": "10mg",
"frequency": "daily",
"status": "active"
}
],
"observations": [
{
"type": "blood_pressure",
"value": "130/85",
"date": "2025-12-15"
}
]
},
"context_window": "90 days"
}Generate SOAP Note
Automatically generate structured SOAP notes from encounter data with AI-powered summarization.
/api/v1/documentation/soap-note/Request Body
encounter_iduuidrequiredEncounter ID
patient_uhidstringrequiredPatient UHID
provider_idstringrequiredProvider ID
include_historybooleanoptionalInclude patient history
Default: true
curl -X POST https://api.mediloop.co/api/v1/documentation/soap-note/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"encounter_id": "550e8400-e29b-41d4-a716-446655440000",
"patient_uhid": "UG123456789A",
"provider_id": "PROV-001"
}'{
"document_id": "660e8400-e29b-41d4-a716-446655440001",
"soap_note": {
"subjective": "Patient presents with 3-day history of fever, headache, and fatigue...",
"objective": "Vitals: BP 130/85, HR 88, Temp 38.2°C. Alert, mild distress...",
"assessment": "1. Suspected viral infection\n2. Hypertension, controlled",
"plan": "1. CBC, Malaria RDT\n2. Paracetamol 1g PRN\n3. Follow-up in 3 days"
},
"confidence": 0.92,
"entities_extracted": 12,
"requires_review": false
}Check Drug Interactions
Comprehensive drug safety checking including drug-drug, drug-condition, and drug-allergy interactions.
/api/v1/clinical-decision-support/drug-interactions/Request Body
new_medicationobjectrequiredNew medication to check
current_medicationsarrayrequiredCurrent medication list
conditionsarrayoptionalPatient conditions (ICD-10)
allergiesarrayoptionalKnown allergies
curl -X POST https://api.mediloop.co/api/v1/clinical-decision-support/drug-interactions/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"new_medication": {
"code": "197361",
"name": "Warfarin 5mg"
},
"current_medications": [
{ "code": "1191", "name": "Aspirin 81mg" }
],
"conditions": ["I10", "E11"],
"allergies": ["Penicillin"]
}'{
"safe": false,
"interactions": [
{
"type": "drug-drug",
"severity": "major",
"drugs": [
"Warfarin",
"Aspirin"
],
"description": "Increased bleeding risk",
"recommendation": "Monitor INR closely, consider alternative"
}
],
"contraindications": [],
"allergy_alerts": [],
"processing_time_ms": 145
}Detect Critical Values
Real-time detection of critical lab values with automatic notification triggering.
/api/v1/clinical-decision-support/critical-values/curl -X POST https://api.mediloop.co/api/v1/clinical-decision-support/critical-values/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"observation": {
"code": "2951-2",
"display": "Sodium",
"value": 118,
"unit": "mmol/L"
}
}'{
"is_critical": true,
"urgency": "high",
"value": 118,
"normal_range": "136-145 mmol/L",
"deviation": "severely_low",
"clinical_significance": "Severe hyponatremia - risk of seizures",
"recommended_actions": [
"Immediate physician notification",
"Repeat sodium level",
"Assess fluid status"
],
"notification_sent": true,
"notification_id": "notif-001"
}Encounter Copilot
Real-time AI assistance during clinical encounters with symptom analysis, test recommendations, and safety monitoring.
/api/v1/copilot/encounter/start/Request Body
encounter_iduuidrequiredEncounter ID
provider_idstringrequiredProvider ID
patient_uhidstringrequiredPatient UHID
curl -X POST https://api.mediloop.co/api/v1/copilot/encounter/start/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"encounter_id": "550e8400-e29b-41d4-a716-446655440000",
"provider_id": "PROV-001",
"patient_uhid": "UG123456789A"
}'{
"session_id": "sess-abc123",
"patient_context": {
"chronic_conditions": [
"Hypertension",
"Type 2 Diabetes"
],
"active_medications": [
"Lisinopril 10mg",
"Metformin 500mg"
],
"allergies": [
"Penicillin"
],
"recent_visits": 3
},
"alerts": [
{
"type": "reminder",
"message": "HbA1c due (last: 6 months ago)"
}
]
}Analyze Symptoms
/api/v1/copilot/encounter/analyze-symptoms/curl -X POST https://api.mediloop.co/api/v1/copilot/encounter/analyze-symptoms/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"session_id": "sess-abc123",
"symptoms": ["chest pain", "shortness of breath", "diaphoresis"],
"onset": "2 hours ago",
"severity": "severe"
}'{
"differential_diagnosis": [
{
"condition": "Acute Coronary Syndrome",
"probability": 0.85,
"code": "I21.9"
},
{
"condition": "Pulmonary Embolism",
"probability": 0.45,
"code": "I26.99"
},
{
"condition": "Aortic Dissection",
"probability": 0.25,
"code": "I71.00"
}
],
"urgency": "emergency",
"recommended_tests": [
{
"test": "ECG",
"priority": "stat",
"reason": "Rule out STEMI"
},
{
"test": "Troponin",
"priority": "stat",
"reason": "Cardiac biomarkers"
},
{
"test": "Chest X-Ray",
"priority": "urgent",
"reason": "Assess cardiac silhouette"
}
],
"red_flags": [
"Acute chest pain with diaphoresis - consider ACS"
]
}Predictive Analytics
AI-powered risk stratification, sepsis detection, and disease progression prediction.
/api/v1/predictive-analytics/risk-scores/curl -X POST https://api.mediloop.co/api/v1/predictive-analytics/risk-scores/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"risk_types": ["cardiovascular", "readmission", "mortality"]
}'{
"patient_uhid": "UG123456789A",
"risk_scores": {
"cardiovascular": {
"score": 0.23,
"category": "moderate",
"factors": [
"Hypertension",
"Age > 55",
"Diabetes"
]
},
"readmission_30day": {
"score": 0.15,
"category": "low",
"factors": [
"Good medication adherence"
]
},
"mortality_1year": {
"score": 0.08,
"category": "low",
"factors": []
}
},
"recommendations": [
"Continue current antihypertensive regimen",
"Schedule HbA1c in 3 months"
]
}Sepsis Risk Detection
/api/v1/predictive-analytics/sepsis-risk/curl -X POST https://api.mediloop.co/api/v1/predictive-analytics/sepsis-risk/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"vitals": {
"heart_rate": 110,
"respiratory_rate": 24,
"systolic_bp": 95,
"temperature": 38.8,
"gcs": 14
},
"labs": {
"wbc": 15.2,
"lactate": 2.8
}
}'{
"sepsis_risk": "high",
"qsofa_score": 2,
"sirs_criteria_met": 3,
"risk_probability": 0.72,
"alert_triggered": true,
"recommendations": [
"Consider sepsis bundle initiation",
"Blood cultures before antibiotics",
"Lactate clearance monitoring"
],
"time_to_intervention": "immediate"
}Medical Entity Extraction
Extract and code medical entities from clinical text using ICD-10, SNOMED CT, LOINC, and RxNorm.
/api/v1/documentation/extract-entities/curl -X POST https://api.mediloop.co/api/v1/documentation/extract-entities/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"text": "45-year-old male with hypertension and type 2 diabetes, currently on Metformin 500mg twice daily and Lisinopril 10mg daily. Presents with chest pain and shortness of breath."
}'{
"entities": {
"diagnoses": [
{
"text": "Hypertension",
"code": "I10",
"system": "ICD-10",
"validated": true
},
{
"text": "Type 2 Diabetes",
"code": "E11.9",
"system": "ICD-10",
"validated": true
}
],
"medications": [
{
"text": "Metformin 500mg",
"code": "860975",
"system": "RxNorm",
"validated": true
},
{
"text": "Lisinopril 10mg",
"code": "314076",
"system": "RxNorm",
"validated": true
}
],
"symptoms": [
{
"text": "Chest pain",
"code": "29857009",
"system": "SNOMED-CT"
},
{
"text": "Shortness of breath",
"code": "267036007",
"system": "SNOMED-CT"
}
],
"demographics": {
"age": 45,
"gender": "male"
}
},
"confidence": 0.94,
"processing_time_ms": 234
}Multi-Role AI Assistants
Specialized AI assistants for different healthcare roles including pharmacists, nurses, lab technicians, and researchers.
Pharmacist Assistant
Drug interactions, prescription verification, counseling points
/api/v1/multi-role/pharmacist/*Nurse Assistant
Patient assessment, medication schedules, handoff summaries
/api/v1/multi-role/nurse/*Lab Technician Assistant
Result interpretation, critical values, QC evaluation
/api/v1/multi-role/lab/*Researcher Assistant
Literature search, cohort identification, statistical recommendations
/api/v1/multi-role/researcher/*Document Digitization
OCR processing, document classification, and FHIR resource generation from medical documents.
/api/v1/document-digitization/process/curl -X POST https://api.mediloop.co/api/v1/document-digitization/process/ \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: multipart/form-data" \
-F "document=@lab_report.pdf" \
-F "document_type=lab_report"{
"document_id": "doc-001",
"classification": {
"type": "lab_report",
"confidence": 0.96
},
"ocr_result": {
"text": "Complete Blood Count...",
"confidence": 0.94
},
"extracted_data": {
"tests": [
{
"name": "Hemoglobin",
"value": 12.5,
"unit": "g/dL",
"reference": "12.0-16.0"
}
]
},
"fhir_resources": [
{
"resourceType": "DiagnosticReport",
"id": "dr-001"
},
{
"resourceType": "Observation",
"id": "obs-001"
}
]
}Clinical Decision Support Disclaimer
All AI services are designed to assist healthcare providers, not replace clinical judgment. AI-generated suggestions must be reviewed by qualified healthcare professionals before being acted upon. The system includes professional override capabilities and comprehensive audit logging.
Rate Limits
AI endpoints have specific rate limits due to computational requirements:
| Endpoint Category | Limit |
|---|---|
| Patient Timeline | 100 requests/minute |
| Clinical Decision Support | 60 requests/minute |
| Documentation Generation | 30 requests/minute |
| Encounter Copilot | 60 requests/minute |
| Predictive Analytics | 30 requests/minute |
| Entity Extraction | 100 requests/minute |
| Document Digitization | 20 requests/minute |
| Multi-Role Assistants | 60 requests/minute |
Performance Targets
| Operation | Target Latency |
|---|---|
| Patient message response | < 3 seconds (p95) |
| RAG retrieval | < 500ms |
| Drug interaction check | < 2 seconds |
| SOAP note generation | < 60 seconds |
| Critical value notification | < 30 seconds |
| Entity extraction | < 1 second |