1. Authenticate → Get access token
2. Create Draft → Send FHIR data
3. Run Test → Trigger AI analysis
4. Get Results → Retrieve full report
5. Generate PDF → Download formatted report (optional)1. 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": "29b2b745-6ba9-4e1f-9512-91247359eefb",
"itemsMapped": 29,
"itemsRejected": 1,
"itemsMissing": 2,
"rejectedItems": [
{
"conceptId": 3006923,
"conceptName": "alat",
"code": "1742-6",
"vocabularyId": "LOINC",
"resourceType": "Observation",
"rejectionReason": "Data too old: 124.4 days (max: 90 days)",
"entryUrl": "urn:uuid:857ea484-91af-4748-8f04-8858cbc1859f",
"valueNumber": 49,
"valueText": null,
"unit": "U/L"
}
],
"missingItems": [
{
"conceptId": 40769783,
"name": "High-sensitivity troponin T"
},
{
"conceptId": 3016417,
"name": "Pancreatic amylase"
}
]
}success: Boolean indicating if the draft was created successfullydraftTestId: UUID of the created draft testitemsMapped: Count of successfully mapped FHIR data elements (12)itemsRejected: Count of items that were rejected during processing (e.g., data too old, invalid values) (2)itemsMissing: Count of required fields not found in the FHIR bundle (18)rejectedItems: Array of rejected items with conceptId and name only (no displayName, internalName, or description)missingItems: Array of missing required fields with conceptId and name only{
"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 ResultsmissingItems and rejectedItems arrays in the response to understand data gapsmissingItems to identify gaps)Step 5: Create Draft → Step 6: Run Test via API → Step 7: Get Results via APImissingItems and rejectedItems - use this to identify incomplete data before proceeding to Step 6. If data is incomplete, the API will return validation errors in Step 6.language (optional): Language code for localized clinical recommendations and risk level display. Supported values:en (English) - Default if not specifiedde (German)recommendation and riskLevel fields in the response will be translated to the requested language.{
"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": "901804f2-566f-4dc4-af33-7beb6432073c",
"patientId": "2307",
"riskScore": 0.4990183413028717,
"riskLevel": "Hoch",
"recommendation": "Koronare CT-Angiographie (CCTA) zur Diagnose und Risikostratifizierung wird empfohlen",
"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 (localized based on language parameter)recommendation: Clinical recommendation based on risk assessment and ESC guidelines (localized based on language parameter)completedAt: 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"
}
}language (optional): Language locale for the PDF report. Supported values:en-GB (English - UK) - Default if not specifiedde-DE (German - Germany){
"status": "success",
"message": "PDF report generated successfully",
"pdfContent": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL...",
"ccsTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"filename": "CardioExplorer_Report_b4f1a1d40ef74f0e9f342c3c5e4f6a10_20260125.pdf"
}status: Status of the PDF generation ("success" or "error")message: Human-readable message describing the resultpdfContent: Base64-encoded PDF file contentccsTestId: The test ID for which the report was generatedfilename: Suggested filename for the PDF (format: CardioExplorer_Report_{testId}_{date}.pdf){
"status": "error",
"message": "Test has no results",
"ccsTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"errors": ["Cannot generate report for a test without results. Please run the test first."]
}{
"status": "error",
"message": "User not authenticated properly",
"ccsTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"errors": ["Authentication required"]
}{
"status": "error",
"message": "Access denied",
"ccsTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"errors": ["You don't have permission to access this test"]
}{
"status": "error",
"message": "CCS Test not found",
"ccsTestId": "b4f1a1d4-0ef7-4f0e-9f34-2c3c5e4f6a10",
"errors": ["The specified CCS test does not exist"]
}language (optional): Language locale for the PDF report. Supported values:en-GB (English - UK) - Default if not specifiedde-DE (German - Germany)/report (Step 8) when you need:/report/download (Step 9) when you need:Authenticate → Create Draft → Run Test → Get Results → Generate PDF ReportAuthenticate → 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 with gap analysis (missing/rejected items) | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/run?language=en | POST | Run AI risk analysis with localized risk level and recommendations | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/result | GET | Get full report | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/report?language=en-GB | GET | Generate PDF report (base64) | ✅ Yes (Bearer token) |
/api/ccs/v1/tests/{id}/report/download?language=en-GB | GET | Download PDF report (file) | ✅ Yes (Bearer token) |
/api/auth/magic-links/generate | POST | Create UI access link | ✅ Yes (Bearer token) |