id: TEDY.01.2 template: resource-create module: tedy state: Built traces-from: [] source-refs:
- reference-editor/app/src/app/resources/code-system/containers/edit/code-system-edit.component.ts
- reference-editor/app/src/app/resources/code-system/services/code-system.service.ts # POST /ts/code-systems/transaction
- helex-tx/modules/tedy/frontend/src/pages/code-system/CodeSystemCreate.tsx # create page
- helex-tx/modules/tedy/frontend/src/pages/code-system/CodeSystemFormFields.tsx # shared create/edit fields
- helex-tx/libs/tedy/src/lib/client/codeSystemClient.ts # saveCodeSystem author: TEDY bootstrap created: 2026-08-08 updated: 2026-08-08
TEDY.01.2 – Add Code System
Feature grouping
Child of TEDY.01 – Code System (Common Spec). Siblings: TEDY.01.1 List, TEDY.01.3 View.
Status in TEDY: Built (R3 write flow). The create page (
CodeSystemCreate) reuses the R3 metadata form (CodeSystemFormFields) increatemode over the samesaveCodeSystem→POST /ts/code-systems/transactionwrite path. Reached from the list’s Add code system action (code-systems/new); on success it navigates into the new record’s shell (code-systems/:id/summary). Content defaults tocompleteand case-sensitivity toci(both, plus atitle, are NOT NULL in terminology-server); required fields (ID, URI, title, content) are validated client-side. Verified end-to-end against dev-tx.example (guest write). Not yet covered: the Import FHIR entry point (owned by Exo) and version creation (VersionForm, R3-pending).
Description
Create a new Code System. reference-editor exposes two entry points from the list’s Add code system dropdown:
- Manual → the Code System edit form (this spec).
- Import FHIR → a FHIR resource import → owned by Exo (
tx-sync), out of scope here.
Rendered with the shared create form (ResourceForm/TedyResourceForm in create mode).
Glossary Terms
Per TEDY.01 § Glossary.
Business Feature Sitemap
flowchart LR
ROOT[TEDY.01] --> C[TEDY.01.2 Add]
L[TEDY.01.1 List] -->|Add code system → Manual| C
C -->|save| V[TEDY.01.3 View]
Data Model
Reuses TEDY.01 § Data Model.
Sitemap / Navigation
/tedy/code-systems/new → on save, navigate('/tedy/code-systems/{id}', {replace:true}) + land in view mode (TEDY.01.3), per the frontend conventions.
Attributes (create fields)
| Field | Widget | Required | Rule |
|---|---|---|---|
id | AppInput | yes | unique code-system id (immutable after create) |
uri | AppInput | yes | canonical URL; unique |
name | AppInput | no | machine name |
title | AppLocalizedName | no | multilingual |
description | AppLocalizedName | no | |
publisher | TxConceptSelect(url=publisher VS) | no | code or free text |
content | TxConceptSelect(url=content-mode VS) / AppSelect | no | complete/supplement/… |
caseSensitive | AppSelect | no | cs / ci |
baseCodeSystem | AppInput | no | when content=supplement |
Business Logic
- Validate required (
id,uri) + uniqueness before submit; guard double-submit (savingstate). - Save →
POST /ts/code-systems/transactionwith the CodeSystem payload (the reference platform create/update transaction). - On success: notify,
navigateto the new id (replace) and switch toview; on failure:showError. Ctrl+Alt+Enter= save,Ctrl+Alt+Esc= cancel (shortcut providers).
StoryBook Component Contract
TedyResourceForm (mode="create", wrapping ResourceForm) inside PageShortcutProvider; fields per Attributes using App*/Tx* widgets; AppButtonPrimary save + AppButtonCancel.
API Endpoints
POST /ts/code-systems/transaction (CodeSystem.write). See TEDY.01 § Common API Surface.
Security / Permissions
CodeSystem.write. See TEDY.01 § Shared Privileges.
Non-functional Requirements
Create response < 1.5s; field validation feedback < 250ms.
Business Tests
- Missing
id/uriblocks submit with a validation message. - Duplicate
id/uriis rejected (server) and surfaced. - Successful create lands on
/tedy/code-systems/{id}in view mode. - Cancel returns to the list without writing.
Source Code References
reference-editor: code-system-edit.component.ts, code-system.service.ts (transaction). TEDY target: @helex/tedy create client + a create mode on TedyResourceForm — to build.
Out of Scope
- Import FHIR (→ Exo). Concept authoring (→ TEDY.01.3 / concept editor).
Traces
- parent: TEDY.01 · traces-to: TEDY.01.3