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


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) in create mode over the same saveCodeSystemPOST /ts/code-systems/transaction write 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 to complete and case-sensitivity to ci (both, plus a title, 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)

FieldWidgetRequiredRule
idAppInputyesunique code-system id (immutable after create)
uriAppInputyescanonical URL; unique
nameAppInputnomachine name
titleAppLocalizedNamenomultilingual
descriptionAppLocalizedNameno
publisherTxConceptSelect(url=publisher VS)nocode or free text
contentTxConceptSelect(url=content-mode VS) / AppSelectnocomplete/supplement/…
caseSensitiveAppSelectnocs / ci
baseCodeSystemAppInputnowhen content=supplement

Business Logic

  • Validate required (id, uri) + uniqueness before submit; guard double-submit (saving state).
  • Save → POST /ts/code-systems/transaction with the CodeSystem payload (the reference platform create/update transaction).
  • On success: notify, navigate to the new id (replace) and switch to view; 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

  1. Missing id/uri blocks submit with a validation message.
  2. Duplicate id/uri is rejected (server) and surfaced.
  3. Successful create lands on /tedy/code-systems/{id} in view mode.
  4. 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 TedyResourceFormto build.

Out of Scope

  • Import FHIR (→ Exo). Concept authoring (→ TEDY.01.3 / concept editor).

Traces

  • parent: TEDY.01 · traces-to: TEDY.01.3