Complete API documentation for the Medical Data Validator service.
http://localhost:8000/api
Currently, the API operates without authentication for development. For production deployment, implement appropriate authentication mechanisms.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/health |
Health check and API status |
| POST | /api/validate/data |
Validate JSON data |
| POST | /api/validate/file |
Upload and validate files |
| POST | /api/compliance/check |
Quick compliance assessment |
| GET | /api/profiles |
Get validation profiles |
| GET | /api/standards |
Get medical standards info |
/api/health
Check API status and supported standards.
{
"status": "healthy",
"version": "0.1.0",
"timestamp": "2024-01-15T10:30:00Z",
"standards_supported": ["icd10", "loinc", "cpt", "icd9", "ndc", "fhir", "omop"]
}
curl -X GET "http://localhost:8000/api/health"
/api/validate/data
Validate structured JSON data for medical compliance.
{
"patient_id": ["001", "002", "003"],
"age": [30, 45, 28],
"diagnosis": ["E11.9", "I10", "Z51.11"],
"ssn": ["123-45-6789", "987-65-4321", "555-12-3456"]
}
detect_phi (boolean): Enable PHI/PII detection (default: true)quality_checks (boolean): Enable data quality checks (default: true)profile (string): Validation profile (clinical_trials, ehr, imaging, lab)standards (array): Medical standards to check (icd10, loinc, cpt, hipaa){
"success": true,
"is_valid": false,
"total_issues": 3,
"error_count": 1,
"warning_count": 2,
"info_count": 0,
"compliance_report": {
"hipaa": {
"compliant": false,
"issues": ["SSN detected in column: ssn"],
"score": 50
},
"icd10": {
"compliant": true,
"issues": [],
"score": 100
}
},
"issues": [
{
"severity": "error",
"description": "SSN detected in column: ssn",
"column": "ssn",
"row": null,
"value": null,
"rule_name": "PHIDetector"
}
],
"summary": {
"total_rows": 3,
"total_columns": 4,
"is_valid": false,
"total_issues": 3
}
}
curl -X POST "http://localhost:8000/api/validate/data" \
-H "Content-Type: application/json" \
-d '{"patient_id": ["P001"], "age": [30], "diagnosis": ["E11.9"]}'
/api/validate/file
Upload and validate medical data files (CSV, Excel, JSON, Parquet).
file: The file to validatedetect_phi: Enable PHI detection (true/false)quality_checks: Enable quality checks (true/false)profile: Validation profilestandards: Array of standards to check16MB maximum file size
curl -X POST "http://localhost:8000/api/validate/file" \
-F "file=@medical_data.csv" \
-F "detect_phi=true" \
-F "quality_checks=true"
/api/compliance/check
Quick compliance assessment for medical standards.
{
"patient_id": ["001", "002"],
"diagnosis": ["E11.9", "I10"],
"procedure": ["99213", "93010"]
}
{
"hipaa_compliant": true,
"icd10_compliant": true,
"loinc_compliant": false,
"cpt_compliant": true,
"fhir_compliant": true,
"omop_compliant": true,
"details": {
"hipaa": {
"compliant": true,
"issues": [],
"score": 100
}
}
}
/api/profiles
Retrieve available validation profiles.
{
"clinical_trials": "Clinical trial data validation",
"ehr": "Electronic health records validation",
"imaging": "Medical imaging metadata validation",
"lab": "Laboratory data validation"
}
/api/standards
Get detailed information about supported medical standards.
{
"icd10": {
"name": "International Classification of Diseases, 10th Revision",
"version": "2024",
"authority": "WHO",
"description": "Standard classification system for diseases and health conditions"
},
"loinc": {
"name": "Logical Observation Identifiers Names and Codes",
"version": "2.76",
"authority": "Regenstrief Institute",
"description": "Standard for identifying medical laboratory observations"
}
}
All endpoints return consistent error responses.
{
"success": false,
"error": "Error description",
"error_type": "ErrorType",
"traceback": "Full error traceback (in debug mode)"
}