Healthcare organizations often manage complex hierarchical structures — regional hospital networks comprising diverse facilities that must balance shared resources with organizational autonomy. Additionally, many clinic-specific healthcare systems need event-driven architecture for real-time data synchronization across interconnected entities. Aidbox solves these challenges with two powerful features: Organization-Based Hierarchical Access Control (OrgBAC) and Topic-Based Subscriptions.
OrgBAC allows you to represent an organizational hierarchy inside Aidbox FHIR server and provides FHIR API endpoints with automatic data isolation.
Imagine a healthcare network such as:
To illustrate this, the bundle below shows how each organization in the hierarchy is created through the REST API:
POST /fhir
resourceType: Bundle
type: batch
entry:
- request:
method: PUT
url: Organization/med-corp
resource:
name: MedCorp HQ
resourceType: Organization
- request:
method: PUT
url: Organization/city-general-hospital
resource:
name: City General Hospital
resourceType: Organization
partOf:
reference: Organization/med-corp
- request:
method: PUT
url: Organization/riverside-clinic
resource:
name: Riverside Clinic
resourceType: Organization
partOf:
reference: Organization/med-corp
Each gets a dedicated endpoint:
/Organization/med-corp/fhir for MedCorp HQ/Organization/city-general-hospital/fhir for City General Hospital/Organization/riverside-clinic/fhir for Riverside ClinicAny resource created through an organization’s endpoint is automatically tagged with its organization ID, ensuring proper isolation without any additional configuration:
PUT /Organization/city-general-hospital/fhir/Patient/pt-123
name: [ { family: 'John' } ]
---
meta:
extension:
- url: https://aidbox.app/tenant-organization-id
valueReference:
reference: Organization/city-general-hospital
id: pt-123
resourceType: Patient
name:
- family: SmithThe underlying access logic is simple and predictable:
GET /Organization/med-corp/fhir/Patient)GET /Organization/city-general-hospital/fhir/Patient)GET /Organization/riverside-clinic/fhir/Patient)For more details about OrgBAC features and configuration, see the documentation: Organization-Based Hierarchical Access Control (OrgBAC)
Subscriptions enable real-time data synchronization through webhooks, Kafka, and various message queues. Beginning with Aidbox 2509, subscriptions automatically respect organizational boundaries. When subscription is created through an organization's API, it inherits hierarchical filtering rules.
This ensures:
Two key components are required for setup:
POST /Organization/med-corp/fhir/AidboxSubscriptionTopic
{
"resourceType": "AidboxSubscriptionTopic",
"url": "http://aidbox.example/observation-feed",
"status": "active",
"trigger": [{
"resource": "Observation",
"fhirPathCriteria": "status = 'final'"
}]
}POST /
resourceType: Bundle
type: batch
entry:
# MedCorp HQ destination - receives events from entire network
- request:
method: POST
url: /Organization/med-corp/fhir/AidboxTopicDestination
resource:
id: med-corp-observation-feed
resourceType: AidboxTopicDestination
meta:
profile: ["http://aidbox.app/StructureDefinition/aidboxtopicdestination-webhook-at-least-once"]
kind: webhook-at-least-once
topic: http://aidbox.example/observation-feed
parameter:
- name: endpoint
valueUrl: https://med-corp-hq.requestcatcher.com/test
# City General Hospital destination - receives only its events
- request:
method: POST
url: /Organization/city-general-hospital/fhir/AidboxTopicDestination
resource:
id: city-general-observation-feed
resourceType: AidboxTopicDestination
meta:
profile: ["http://aidbox.app/StructureDefinition/aidboxtopicdestination-webhook-at-least-once"]
kind: webhook-at-least-once
topic: http://aidbox.example/observation-feed
parameter:
- name: endpoint
valueUrl: https://city-general-hospital.requestcatcher.com/test
# Riverside Clinic destination - receives only its events
- request:
method: POST
url: /Organization/riverside-clinic/fhir/AidboxTopicDestination
resource:
id: riverside-observation-feed
resourceType: AidboxTopicDestination
meta:
profile: ["http://aidbox.app/StructureDefinition/aidboxtopicdestination-webhook-at-least-once"]
kind: webhook-at-least-once
topic: http://aidbox.example/observation-feed
parameter:
- name: endpoint
valueUrl: https://riverside-clinic.requestcatcher.com/testYou can monitor requests received by each organization using the following URLs (open them before producing events):
The diagram below illustrates how event flows through the system. Green arrows show MedCorp HQ event flow, while yellow arrows show City General Hospital event flow:

POST /Organization/city-general-hospital/fhir/Patient
id: pt-1
name: [{"family": "Smith"}]POST /Organization/city-general-hospital/fhir/Observation
resourceType: Observation
status: final
code:
coding:
- system: http://loinc.org
code: 15074-8
display: Glucose [Moles/volume] in Blood
subject:
reference: Patient/pt-1
valueQuantity:
value: 6.3
unit: mmol/l
system: http://unitsofmeasure.org
code: mmol/L
OrgBAC and topic-based subscriptions together create a robust foundation for multi-tenant healthcare architectures. This combination delivers immediate value:
Whether you're architecting a regional hospital network, managing multiple clinics, or building a multi-practice EHR, Aidbox provides a secure, scalable foundation your healthcare system needs.
Start using a free developer license to implement OrgBAC and topic-based subscriptions in your organization, or explore the documentation for detailed implementation guides.
Get in touch with us today!
