1. Authenticate → Get access token
2. Create Draft → Send FHIR data
3. Run Test → Trigger AI analysis
4. Get Results → Retrieve full report1. Authenticate → Get access token
2. Create Draft → Send FHIR data
3. Generate Magic Link → Healthcare provider reviews in CardioExplorer UIclientId (UUID)clientSecret (secure key){
"status": "success",
"data": {
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 3600
}
}
{
"status": "success",
"data": {
"magicLink": "https://api.cardioexplorer.com/api/auth/magic-links/verify?token=generated_token",
"expiresAt": "2024-01-25T11:30:00Z"
}
}{
"success": true,
"draftTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"itemsMapped": 12
}{
"success": false,
"message": "validation failed",
"validation": {
"valid": false,
"issues": [...]
}
}
{
"success": false,
"message": "User not authenticated"
}Step 5: Create Draft → Generate Magic Link (Step 3) → User reviews in UI → Complete & Get ResultsStep 5: Create Draft → Step 6: Run Test via API → Step 7: Get Results via API{
"testId": "901804f2-566f-4dc4-af33-7beb6432073c",
"patientId": "2307",
"riskScore": 0.4990183413028717,
"riskLevel": "High",
"recommendation": "Coronary CT angiography (CCTA) for diagnosis and risk stratification is recommended",
"completedAt": "2026-02-01T19:08:40.4233333",
"warnings": []
}testId: The test ID (unique identifier for this assessment)patientId: Patient identifier associated with this testriskScore: Risk score between 0.0 (low risk) and 1.0 (high risk)riskLevel: Human-readable risk level ("Very Low", "Low", "Moderate", "High", "Very High")recommendation: Clinical recommendation based on risk assessmentcompletedAt: Timestamp when the test was completed (ISO 8601 format)warnings: Array of warning messages (if any validation issues occurred){
"testId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"patientInfo": {
"patientId": "patient-123",
"age": 48,
"gender": "male"
},
"testDate": "2026-01-25T10:30:00Z",
"riskAssessment": {
"score": 0.342,
"riskLevel": "Moderate",
"riskClass": 1,
"populationRiskLevel": "Above average"
},
"biomarkers": {
"cholesterol": {
"total": 220,
"hdl": 45,
"ldl": 150,
"unit": "mg/dL"
},
"bloodPressure": {
"systolic": 140,
"diastolic": 90,
"unit": "mmHg"
},
"glucose": {
"value": 110,
"unit": "mg/dL"
}
},
"clinicalRecommendations": [
"Consider lifestyle modifications including diet and exercise",
"Schedule follow-up in 6 months",
"Monitor blood pressure regularly"
],
"medications": {
"antiplateletTherapy": "Yes",
"lipidLoweringTherapy": "Yes",
"betaBlocker": "No"
}
}Authenticate → Create Draft → Run Test → Get ResultsAuthenticate → Generate Magic Link → Provider completes assessment in UI| Endpoint | Method | Purpose | Auth Required |
|---|---|---|---|
/api/organization-auth/authenticate | POST | Get access token | ❌ No (uses clientId/secret) |
/api/fhir/draft-test | POST | Create draft from FHIR | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/run | POST | Run AI risk analysis | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/result | GET | Get full report | ✅ Yes (Bearer token) |
/api/auth/magic-links/generate | POST | Create UI access link | ✅ Yes (Bearer token) |