Skip to content

Organisation Hierarchy

Epic summary

The Organisation Hierarchy workspace builds the small, strict tree MedCES uses for administrative containment and access scope.

Tenant
└── Governing organisation (optional)
└── Institute
└── Department
└── Department unit (optional)

Programmes, courses, curricula, faculty, students, and facilities are not hierarchy nodes. External regulators, universities, counselling authorities, and separately owned hospitals also remain outside the tree.

Before you start

The tenant and at least one institute must exist. MedCES supplies the allowed entity types and parent-child combinations. A structural change to a published node requires an impact review and a future or current effective date.

Actors and access

Access sourceAccess in this epic
Tenant Admin or Governance Registrar roleCreates permitted governing organisations and institutes
Institute AdminCreates and maintains institute departments
Department AdminMaintains permitted details for their department and units
Institute member with Organisation Approver roleApproves structural additions and changes
Auditor roleReconstructs the hierarchy and its approval history for any effective date

What the user does

Screen 1: Hierarchy Tree

The screen shows only the permitted institutional nodes. Selecting a node opens its current details, children, status, and history.

The user can filter by institute, entity type, status, effective date, or code. A separate link opens facilities; facilities are not shown as organisation children.

Screen 2: Add or Edit Entity

FieldRequiredMeaning and validation
Entity typeYesGoverning organisation, institute, department, or department unit
ParentYes except tenant rootMust be an allowed parent in the same tenant
NameYesFormal current name
CodeYesStable code unique in its owning scope
Short nameNoDisplay abbreviation
Clinical or non-clinicalDepartment onlyClassifies the department without changing its hierarchy position
Effective fromYesDate on which this version becomes valid
Effective toNoUsed when the node will end
Source and reasonYes for material changesOrder, approval, or another supporting record
StatusYesDraft, Under Review, Published, Suspended, or Archived

The path is generated from stable identifiers. Renaming a department never changes its identifier or historical path.

Screen 3: Structural Change

This screen is used to move, suspend, close, split, or merge a published branch. Before submission it shows:

  • current and proposed parent;
  • effective date;
  • affected descendant nodes;
  • active role grants at affected scopes;
  • faculty and unit associations;
  • programmes, courses, delivery mappings, and reports that reference the node;
  • actions required before the change can be approved.

The screen never rewrites historical records to the new path.

Screen 4: As-of View and History

The user selects a business date and sees the hierarchy that was valid on that date. The screen shows entity versions, earlier parents and names, approvals, and the users who prepared and approved each change.

Worked example: General Medicine

ABC Medical College creates the General Medicine department beneath the institute. Because the department operates through clinical units, Medicine Unit 1 and Medicine Unit 2 are added beneath it.

ABC Medical College
└── General Medicine
├── Medicine Unit 1
└── Medicine Unit 2

Faculty are assigned to those records later. Wards are allocated through the facility and unit screens. The MBBS programme remains owned by ABC Medical College and connects to General Medicine through course and delivery relationships.

Use case 1: Add a department

As an Institute Admin
I want to add a department beneath my institute
So that academic ownership and department-scoped access use a real organisational record.

Acceptance criteria

  • The parent is an active institute in the same tenant.
  • Name, code, classification, effective date, and source are recorded.
  • The path is generated by MedCES.
  • A Draft department cannot be selected by published academic records.
  • Publication triggers access-scope and readiness recalculation.

Use case 2: Add an optional department unit

As a Department Admin
I want to add a real unit beneath my department
So that unit teams, capacity, scheduling, and access can use the correct scope.

Acceptance criteria

  • Only a department can be the parent of a department unit.
  • The unit is not required where the department does not operate through units.
  • The unit cannot see its parent or sibling data through a unit-scoped grant.
  • Team, location, bed, availability, and teaching-capacity details are completed in Department Units and Clinical Teams.

Use case 3: Reorganise a branch

As a tenant member with Organisation Approver role
I want to approve a dated structural change
So that the current structure changes without erasing the structure used by earlier records.

Acceptance criteria

  • A node cannot become its own ancestor.
  • A branch cannot move across tenants.
  • The impact preview lists dependent access, people, academic, facility-allocation, reporting, and integration records.
  • Required remediation is completed or attached to the approval.
  • The old path remains available for dates before the change.

Negative cases and alternate flows

  • Illegal parent type: Reject the change and explain the valid parent.
  • Orphaned role grant: Block activation until the grant is ended or moved through Users and Access Assignment.
  • Protected operational period: Allow a future effective date where immediate change would break active work.

Use case 4: Reconstruct historical hierarchy

As a user with Auditor role
I want to view the hierarchy as of a selected date
So that an earlier access or reporting decision can be explained.

Acceptance criteria

  • Business-effective date is separate from the time the change was recorded.
  • Historical names and parents are shown rather than replaced by current values.
  • Export contains stable entity IDs, path versions, validity, and approval evidence.
  • The auditor sees only the tenant and institute scope included in their grant.

Business rules

  • Every tenant has exactly one tenant root.
  • A governing organisation is optional.
  • An institute belongs to the tenant and may sit beneath one governing organisation.
  • A department belongs to one institute.
  • A department unit, where used, belongs to one department.
  • One node cannot have two current structural parents.
  • External relationships never become parent-child links.
  • Programmes, courses, curricula, people, and facilities never become LTREE nodes.
  • Structural records that have been used are ended or superseded, not physically deleted.
  • Department and unit grants never provide sibling access.

Technical design

Conceptual schema

RecordImportant fields
org.entityid, tenant_id, entity type, stable code, current version, status
org.entity_versionentity_id, name, parent entity, path ltree, validity, source, approval
org.entity_typestable type code, permitted parent type, maximum depth, active
org.structural_changechange type, current parent, proposed parent, effective date, reason, status
setup.change_impactproposed change, dependent record, effect, required action, resolution

Process-layer responsibilities

  • Generate stable LTREE labels from entity identifiers.
  • Validate tenant boundary, parent type, depth, cycles, and overlapping validity.
  • Calculate descendants only from the version valid for the requested date.
  • Simulate moves, splits, merges, suspension, and closure before approval.
  • Preserve historical names, parents, paths, and approvals.
  • Notify the access service and affected readiness checks after publication.

Success outcome

The institute has a small, accurate hierarchy that can support access, ownership, reporting, and scheduling without mixing programmes, people, facilities, or external authorities into the tree.