Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

TEDY.11 — Naming Systems

State: Built — list + create/edit form (standard ResourceList + ResourceForm). Template: tool-feature. Prefix: TEDY.

Overview

A Naming System registers a naming authority for a code system / value set / identifier — the canonical name plus the external identifiers (OID/UUID/URI) that refer to it. Served off /ts/naming-systems; string id. status is a publication lifecycle managed via activate/retire (created as draft); created is server-set.

Data model (libs/tedy/src/lib/types/namingSystem.ts)

NamingSystem { id?:string, names?:LocalizedName, kind?, codeSystem?, source?, description?, status?, created?, identifiers?:NamingSystemIdentifier[] }.

  • kindcodesystem | valueset | identifier | root (FHIR namingsystem-type).
  • codeSystem — referenced code system id, relevant when kind === 'codesystem'.
  • description — plain string (not localized).
  • statusdraft | active | retired.
  • NamingSystemIdentifier { type?, value?, preferred? }type from oid / uuid / uri / other; exactly one preferred.

NamingSystemSearchParams extends QueryParams { textContains?, lang? }.

REST API (base /ts/naming-systems)

  • GET /ts/naming-systems — paged search (textContains).
  • GET /ts/naming-systems/{id} — load one.
  • POST /ts/naming-systems — upsert (create and edit both POST the full object; there is no PUT).
  • POST /ts/naming-systems/{id}/activate · POST /ts/naming-systems/{id}/retire — lifecycle.
  • DELETE /ts/naming-systems/{id}.

Client: libs/tedy/src/lib/client/namingSystemClient.ts; hook: useNamingSystems / useNamingSystem / namingSystemKeys.

Business rules / constraints

  • Only draft naming systems are editable. The reference list opens draft in the edit form and active/retired in a read-only view. TEDY mirrors this — the form drops to view mode when the record’s status is not draft (subtitle: “Only draft naming systems can be edited — read-only.”). New records are created as draft.
  • id is immutable on edit (create-only; disabled in edit).
  • codeSystem is required when kind === 'codesystem' (validated on save).
  • Lifecycle is action-driven, not a form field: Activate only from draft; Retire unless already retired; Delete allowed for any status. All gated on *.NamingSystem.write.

Screens

  • List (pages/NamingSystemList.tsx, resource-list) — a standard ResourceList: ID (link → the form) · Name · Source · Kind (tag) · Status (tag). textContains search; Add (gated *.NamingSystem.write); per-row lifecycle actions — Activate (draft), Retire (unless retired), Delete (confirm).
  • Form (pages/naming-system/NamingSystemForm.tsx) — a standard ResourceForm with declarative sections: ID (required; immutable on edit via modeOverride:'view'), Name (localized, required), Kind (select), Code system (referenced CS id), Source, Description (textarea), and a repeatable Identifiers editor (type select + value input + preferred star + add/remove). Create + edit; POST then return to the list. Same load-gated mount as Defined Properties (ResourceForm seeds once from dataController.current).
    • Validation: ID + name + kind required; codeSystem required when kind === 'codesystem'.

Routes & nav

/naming-systems (list), /naming-systems/new, /naming-systems/:id/edit. Nav: Terminology → Naming Systems (tedyMenu.ts).

Privileges

*.NamingSystem.write gates Add / edit / activate / retire / delete. Read is open.

i18n

tedy.namingSystem.* (fields.*, kind.*, status.*, list.*, validation.*, notifications.*, identifier labels).