Skip to content

TS/API: emit opt-in per-package terminology surfaces - #210

Open
sussdorff wants to merge 2 commits into
atomic-ehr:mainfrom
cognovis:feat/codegen-x68/terminology-surface
Open

TS/API: emit opt-in per-package terminology surfaces#210
sussdorff wants to merge 2 commits into
atomic-ehr:mainfrom
cognovis:feat/codegen-x68/terminology-surface

Conversation

@sussdorff

Copy link
Copy Markdown
Contributor
  • Add an opt-in TypeScript terminology.ts module per resolved package, carrying canonical URL, package id/version, declared content mode, and optional closure verification.
  • Emit code unions and display maps only for CodeSystems with content: complete, read from the resource itself.
  • Do not promote ValueSet expansions or not-present / example concept arrays into constants.
  • Keep unverifiable packages to identity and provenance only, with no concept content.
  • Route profile imports through the same physical package directory mapping used for schemas and terminology.

Terminology generation is off by default. Enable it on the TypeScript writer:

.typescript({
    terminology: {
        enabled: true,
        packageVerification: {
            "hl7.fhir.r4.core@4.0.1": "registry-integrity",
        },
    },
})

Before, packages produced profile/resource modules only. After, an enabled generator also emits terminology.ts:

export const CompleteExample = {
    url: "http://example.test/CodeSystem/complete",
    packageId: "fixture.ig",
    packageVersion: "1.2.3",
    content: "complete",
    verification: "registry-integrity",
    codes: ["second", "first"] as const,
    displays: { second: "Second display", first: "First display" },
};

Generate a terminology.ts module per resolved package when
typescript.terminology.enabled is set. Only CodeSystems with
content complete emit code unions and display maps; ValueSet
expansions are never promoted to constants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant