Validation Documentation
Welcome to the Medbackend Validation documentation! This guide covers the comprehensive validation and authorization system that ensures secure and compliant access to FHIR resources.
Recommended Reading Order
-
- Security layer components
- JWT validation process
- RBAC engine functionality
- Core validation components
- Query handler security
- Settings configuration
-
- Role-based access control principles
- Request validation workflow
- Architecture overview
- Validator types and usage
- Default access configuration
- Validation rules structure
- RBAC scheme design
-
- Understanding FHIR compartments
- HL7 FHIR compartment definitions
- Visual examples
- Compartment-based validation
- Organization compartment
- Custom compartment extensions
-
- Detailed validator documentation
- PatientCompartment validator
- PractitionerCompartment validator
- RelatedPersonCompartment validator
- EncounterCompartment validator
- OrganizationCompartment validator
- DeviceCompartment validator
- LegitimateInterest validator
- GeneralPractitioner validator
- Allowed/Forbidden validators
Quick Start
- Review Authentication Architecture to understand the security foundation
- Learn Basic Validation Concepts for core RBAC principles
- Understand FHIR Compartments for resource organization
- Reference Validators Reference for detailed implementation
Key Components
Security Architecture
Validation Types
- Compartment Validators: Patient, Practitioner, RelatedPerson, Encounter, Organization, Device
- Policy Validators: LegitimateInterest, GeneralPractitioner
- Access Control: Allowed, Forbidden
FHIR Compartments
- Patient compartment
- Practitioner compartment
- Organization compartment
- Custom organization compartment extension
Configuration Examples
Default Access
{
"rbac": {
"default_access": "Forbidden",
"validation_rules": []
}
}
Validation Rule
{
"client_role": "Patient",
"entity_name": "DiagnosticReport",
"operation": "search",
"validator": "patient_compartment"
}
Security Best Practices
- Set default access to "Forbidden"
- Use compartment validators when possible
- Implement proper JWT validation
- Configure appropriate RBAC rules
- Regular security audits
- Monitor validation failures
Webhooks
You can extend any validation rule with webhooks to add custom logic:
- Pre-request hooks: Validate or transform data before FHIR operations
- Post-response hooks: Trigger workflows or sync external systems after operations
{
"client_role": "Patient",
"entity_name": "Patient",
"operation": "create",
"validator": "patient_compartment",
"pre_request_hook": {
"url": "https://your-service.com/webhooks/validate",
"enabled": true
}
}
See the Webhooks Documentation for full details on configuration and payload formats.
Additional Resources
- For authentication setup, see Auth Documentation
- For development setup, check Getting Started Guide
- For FHIR specifications, refer to HL7 FHIR Documentation
Support
If you need help with validation:
- Review the validator reference documentation
- Check the example configurations
- Contact the development team for specific issues