id: TEDY.01
template: tool-feature
module: tedy
state: Proposed
traces-from: [] # TODO: link terminology-editor user stories
source-refs:
reference-editor/app/src/app/resources/code-system
reference-editor/app/src/app/resources/_lib/code-system/model/code-system.ts
terminology-server (/ts/code-systems)
helex-tx/libs/tedy/src/lib/client/codeSystemClient.ts
helex-tx/libs/tedy/src/lib/client/conceptClient.ts
helex-tx/libs/tedy/src/lib/types/codeSystem.ts
author: TEDY bootstrap
created: 2026-08-08
updated: 2026-08-08
Common specification for Code System management in TEDY — browse, view, and author FHIR CodeSystems over terminology-server (/ts/code-systems). This root spec owns the shared vocabulary, data model, value sets, FHIR mapping, privileges, common API surface, and navigation so the child (screen) specs don’t duplicate them.
terminology-server owns the persistence + FHIR model; TEDY is the React client. Derived via spec-authoring.md (Step-1 dev-tx.example scan, Step-2 reference-editor + terminology-server reconcile).
Child specs:
Term (canonical) Meaning
Code System A FHIR CodeSystem — a managed set of concepts (codes) with designations, versions, properties.
Concept A single code within a Code System (its content).
Version A CodeSystemVersion with a publication status (draft/active/retired) + release date.
Designation A concept’s localized display/definition (designationType = display/definition, per language).
Publisher CodeSystem.publisher — resolved via the publisher value set when it is a code, else free text.
Space A reference-platform authoring workspace a resource belongs to.
Content mode CodeSystem.content — complete / supplement / fragment / example / not-present.
flowchart LR
US["(TODO) US: manage code systems"] --> ROOT[TEDY.01]
ROOT --> LST[TEDY.01.1 List]
ROOT --> CRT[TEDY.01.2 Add]
ROOT --> VIEW[TEDY.01.3 View]
LST -->|Add code system| CRT
LST -->|row / ID| VIEW
CRT -->|save| VIEW
Shared model for list / create / view. terminology-server owns the tables; TEDY consumes the JSON envelopes.
Entity / Resource the reference platform API FHIR resource Notes
CodeSystem /ts/code-systemsCodeSystem list + detail; lastVersion decorated
CodeSystemVersion /ts/code-systems/{id}/versionsCodeSystem.version status ∈ draft/active/retired
CodeSystemConcept /ts/code-systems/{id}/conceptsCodeSystem.concept content; display from designations
List envelope n/a n/a { data: [...], meta: { total, offset } }
Single-resource envelope n/a n/a resource root fields
Field Type Cardinality Rule
idstring 1..1 immutable identity (the code-system id)
uristring 0..1 canonical URL; unique
namestring 0..1 machine name
titleLocalizedName 0..1 multilingual display
descriptionLocalizedName 0..1
publisherstring 0..1 code from publisher VS or free text
contentcode 0..1 codesystem-content-mode
caseSensitivecode 0..1 cs / ci
baseCodeSystemstring 0..1 for supplements
versions / lastVersionCodeSystemVersion[] 0..* version + status + releaseDate + conceptsTotal
conceptsCodeSystemConcept[] 0..* code + versions[].designations[]
Field ValueSet Canonical URL Binding
publisherpublisher https://tx.example/fhir/ValueSet/publisherextensible
version status publication-status http://hl7.org/fhir/ValueSet/publication-statusrequired
contentcodesystem-content-mode http://hl7.org/fhir/ValueSet/codesystem-content-moderequired
Internal field FHIR R5 path Mapping Notes
idCodeSystem.iddirect
uriCodeSystem.urldirect
nameCodeSystem.namedirect
titleCodeSystem.titletransform LocalizedName → language-resolved title
publisherCodeSystem.publisherdirect
contentCodeSystem.contentdirect
caseSensitiveCodeSystem.caseSensitivetransform cs/ci → boolean
lastVersion.versionCodeSystem.versiondirect
concepts[]CodeSystem.concept[]transform designations → concept.display + designation
Phase-0 TEDY is read-only (browse/view). Authoring (create/edit) writes via POST /ts/code-systems/transaction (child TEDY.01.2 / future edit).
Concept display resolves from versions[].designations[] where designationType='display' (match language → preferred → first), fallback to the code.
Publisher display resolves via the publisher value set (@helex/tx), fallback to the raw value when free text.
Value-set-backed selects use TxConceptSelect(url=…) (see spec-authoring.md ; dev proxies /api/tx/$expand→the reference platform FHIR).
Action Privilege
View / browse authenticated (dev: guest via the reference platform yupi)
Create / edit / delete / versions / concepts CodeSystem.write (the reference platform {id}.CodeSystem.write)
Method Path Privilege Description
GET /ts/code-systemsread list (params: textContains, publisher, versionStatus, spaceId, content, lastVersionDecorated, lang)
GET /ts/code-systems/{id}read load one (?decorate=true)
GET /ts/code-systems/{id}/versionsread versions
GET /ts/code-systems/{id}/conceptsread concepts (params: textContains, codeContains, displayLanguage)
POST /ts/code-systems/transactionwrite create/update (authoring)
GET /spacesread spaces (for the Space filter)
GET /fhir/ValueSet/$expand?url=…read value-set expansion (publisher/status/content)
All TEDY calls go through @helex/tedy’s txApi (/txapi → dev-tx.example /api).
/tedy/code-systems — list (TEDY.01.1)
/tedy/code-systems/new — create (TEDY.01.2, pending)
/tedy/code-systems/{id} — view (TEDY.01.3)
(Standalone Router basename="/tedy"; menu routes are basename-relative — see spec-authoring/dev notes.)
Requirement Target
List load < 2s; server-side pagination (20/page); no eager concept load
Detail + concepts load < 2s; concepts paged (20/page)
Search debounce ~400ms
List, view, and (future) create all operate over /ts/code-systems* with the shared envelope.
Publisher/status/content render via their value sets; concept display via designations.
Write actions require CodeSystem.write; read is open on the guest dev server.
traces-from: TODO user stories
children: TEDY.01.1, TEDY.01.2, TEDY.01.3