Resource dashboard (ResourceContext) — gap analysis & implementation plan
Why: the TEDY detail page (TedyResourceForm — a single flat metadata+versions+concepts view) is a fraction of reference-editor’s resource screen. Audited https://dev-tx.example/resources/code-systems/anesteesia-liigid/summary and the reference-editor source. This documents the gap and the plan to close it.
What reference-editor actually renders
The screen is a shared, route-driven tabbed resource shell (resources/resource/components/resource-context.component.ts) wrapping per-tab pages built from widget cards.
tw-resource-context— inputsresourceType(CodeSystem|ValueSet|MapSet|ImplementationGuide|TerminologyServer|StructureDefinition),resource,version,versions,conceptCode,mode(summary|details|concepts|properties|provenance|checklist|…). Renders a top page-bar: resource-type label, localized title, a tab strip (per-type conditional: Summary·Metadata·Concepts·Properties·Provenance·Checklist, +SD elements/fsh/json/uml), and a version selector (“All versions” + per-version routing). Route- and privilege-aware (twPrivileged,twPrivilegeContext).- Summary tab = a 2-column grid of cards:
tw-code-system-info-widget— icon-annotated summary (id, uri, properties, case-sensitivity + content, contact email/url, publisher, linked ValueSet).tw-code-system-versions-widget— version rows (version, date range, concept count, status tag, language, Add to release, linked VS) + Compare + Add version.tw-code-system-unlinked-concepts— backend table (CONCEPT·VERSION·DESIGNATION·AUTHOR·TASK·STATUS, row checkboxes) + search + Link to<version>dropdown + Add concept.tw-resource-tasks-widget(+tw-resource-task-modal) — Opened/All tasks, Add task, task rows.tw-resource-related-artifact-widget— related artifacts.- Value-sets card — referenced VS with rule-source / “version matches latest” indicator.
Shared widget family (resources/resource/components/): resource-context, resource-side-info, resource-form, resource-version-form, resource-identifiers, resource-contacts, resource-configuration-attributes, resource-multi-language-view, resource-readonly-concept, resource-tasks-widget, resource-task-modal, resource-related-artifact-widget, resource-release-modal, resource-fhir-import-modal.
Mapping: reference-editor → @helex/ui → TEDY status
| reference-editor (Marina) | @helex/ui primitive available | TEDY status | Action |
|---|---|---|---|
tw-resource-context (tabbed shell) | EntityHeader + PageTabs + AppSelect (compose) | ❌ missing (only flat TedyResourceForm) | Build TedyResourceShell |
| version selector (“All versions”) | AppSelect/AppDropdown | ❌ | part of shell |
code-system-info-widget (icon summary) | AppCard+FieldItem/AppDescriptions | ⚠️ partial (flat FieldItems) | CodeSystemInfoWidget |
code-system-versions-widget | AppCard+AppTable+AppTag | ⚠️ flat list only | CodeSystemVersionsWidget |
code-system-unlinked-concepts (backend table + checkboxes + link/add) | AppTable/AppDataGrid (selection) | ⚠️ simple read-only concepts table | extend CodeSystemConcepts (columns, selection, actions) |
resource-tasks-widget + resource-task-modal | AppTable+AppModal | ❌ | TedyTasksWidget + task modal (+ tasks client) |
resource-related-artifact-widget | AppCard+AppList | ❌ | RelatedArtifactsWidget |
| value-sets card | AppCard+AppTag+AppLink | ❌ | ReferencedValueSetsWidget |
resource-form (Metadata edit) | ResourceForm | ⚠️ view-only | edit mode (+ sub-widgets below) |
resource-identifiers | TxIdentifier (@helex/tx) — value model IS FHIR Identifier[] | ✅ reuse | free-form (allowCustom/omit concepts) mirrors the reference platform’s plain system+value table; VS-backed via the $expand adapter. No FhirIdentifier exists. |
resource-contacts (ContactDetail[] = name + telecoms) | FhirTelecom (ContactPoint) + FhirAddress exist; no contact widget | build in @helex/fhir | create FhirContact (ContactDetail editor) composing FhirTelecom — standard FHIR datatype, lives with the other Fhir* widgets (shared, sign-off-gated) |
resource-configuration-attributes | AppEditableTable | ❌ | ConfigurationAttributes |
resource-multi-language-view | AppLocalizedName | ⚠️ have input, not view | small helper |
resource-version-form | ResourceForm | ❌ | VersionForm |
resource-release-modal / resource-fhir-import-modal | AppModal | ❌ | later (release → Press; FHIR import → Exo) |
twPrivileged / twPrivilegeContext | useModule().canWrite() (@helex/core) | ⚠️ not wired per-resource | useTedyPrivilege(id,'CodeSystem') wrapper |
Note: @helex/ui has the primitives (EntityHeader, PageTabs, AppSelect, AppTable/AppDataGrid, AppCard, AppTag, FieldItem, AppModal, AppDropdown, AppDivider) — the gap is the composed, terminology-aware shell + the domain widgets, which are TEDY-specific → build in @helex/tedy (do NOT bloat @helex/ui; per the leaned-down convention).
Missing components (to build in @helex/tedy)
TedyResourceShell— theResourceContextequivalent:resourceType+resource+versions+mode; header (icon, localized title, version selector) + route-driven tab strip; wraps routed tab pages. Backed byEntityHeader+PageTabs+AppSelect. (Foundational — everything else mounts inside it.)- Summary widgets:
CodeSystemInfoWidget,CodeSystemVersionsWidget,RelatedArtifactsWidget,ReferencedValueSetsWidget. - Concepts: extend
CodeSystemConcepts→ backend table with the reference platform columns (Concept·Version·Designation·Author·Task·Status), row selection, Link to version + Add concept (and later the concepts tab page + tree). - Tasks:
TedyTasksWidget+ task modal + a tasks client (or reuse EMRflow). - Metadata edit:
ResourceFormedit mode for CodeSystem + sub-widgets: reuse@helex/txTxIdentifier(identifiers), newFhirContactin@helex/fhir(contacts, composingFhirTelecom),ConfigurationAttributes,VersionForm. (NoFhirIdentifier— identifiers =TxIdentifier.) - Privilege gating:
useTedyPrivilege(resourceId, 'CodeSystem')(wraps@helex/coreuseModule) for{id}.CodeSystem.write. - Later/other modules:
resource-release-modal→ Press;resource-fhir-import-modal→ Exo.
Implementation plan (phased)
- Phase R1 — Shell + Summary (read-only). ← DELIVERED (this change).
TedyResourceShell(@helex/tedy) =EntityHeader+PageTabs(merged) + a version-selector slot (tabBarExtraContent) + routed<Outlet>. Code System detail is now a nested routecode-systems/:id→ shell with tabs Summary · Metadata · Concepts (read-only):CodeSystemShellloads once and shares via Outlet context;CodeSystemSummary=CodeSystemInfoWidget+CodeSystemVersionsWidget+ concepts preview;CodeSystemMetadata= full field view;CodeSystemConceptsTab= the concepts table. FlatCodeSystemDetail/TedyResourceForm-for-detail retired (TedyResourceForm kept for create/edit). Properties/Provenance/Checklist tabs + RelatedArtifacts/ValueSets/Tasks widgets + version selector wiring follow in later phases. - Phase R2 — Concepts tab. Full concepts backend table (the reference platform columns + selection) + the concepts tree/search drawer (reuse
@helex/txTxConceptTree/TxConceptSearchDrawerwhere they fit the reference platform/ts/*, else fresh). - Phase R3 — Metadata edit + versions. Metadata edit + write flow DELIVERED (commit
ec538bf); create page DELIVERED (TEDY.01.2, commitf0918f9).@helex/tedysaveCodeSystem→POST /ts/code-systems/transaction; Metadata tab is now view/edit viaResourceForm(hideHeader, inside the shell) +useDataController, editing uri/name/title/description/publisher (TxConceptSelect)/content/caseSensitive/baseCodeSystem/identifiers (TxIdentifier); save invalidates the shell query → back to view. The edit fields were extracted into a sharedCodeSystemFormFieldsand reused byCodeSystemCreate(ResourceFormincreatemode,ideditable only on create, content/caseSensitive seeded, required-field validation), reached from the list’s Add code system action (code-systems/new) and navigating into the new record’s shell on success. Both verified end-to-end (guest write works on dev; create persiststitle={en:...}/content/caseSensitive and lands on the summary tab). Version form + lifecycle DELIVERED (commit493ec33):@helex/tedyversionClient(saveCodeSystemVersionPOST-new/PUT-existing,changeCodeSystemVersionStatusdraft/activate/retire,deleteCodeSystemVersion) +useCodeSystemVersionshooks; sharedVersionFormFields(version key create-only, release/expiration dates bridged toAppDatePicker’s dayjs, supported/preferred languages, algorithm, description, identifiers) reused by standaloneCodeSystemVersionCreate/CodeSystemVersionEditpages (code-systems/:id/versions/new+/:versionCode/edit); the Summary versions widget now lists live versions with Add version, per-row Edit, a single-step status transition (draft→active→retired, retired→draft), and confirmed Delete, invalidating on each change. Verified end-to-end (create+activate via UI; edit/retire/draft/delete via the same endpoints; note: editing an active version’s metadata is frozen server-side, matching reference-editor). Still pending: contacts (FhirContact) + config-attributes sub-widgets, per-resource privilege gating, and the Import FHIR create entry point (owned by Exo). - Phase R4 — Tasks + related artifacts + value sets widgets (Tasks may reuse EMR
flow). - Phase R5 — Generalize. Extract
TedyResourceShell+ shared widgets so ValueSet/MapSet/NamingSystem reuse them (theresourceTypeswitch), mirroring reference-editor’s sharedresource-*family.
Sequencing note: R1 is the unlock — it establishes the shell every terminology resource hangs off, and immediately closes the biggest visual/functional gap. Each phase is spec-first (update the TEDY.01 family: shell/summary → TEDY.01.3; metadata edit → TEDY.01.2 + a versions spec; concepts tab → a new child).
Verify
Per phase: npx tsc -p tsconfig.json --noEmit (module) + browser parity check against dev-tx.example/resources/code-systems/{id}/{tab} for each tab. Keep column/label/tab order matched to reference-editor (record deltas in the specs’ Differences tables).