Skip to content

New: [AEA-6322] - simplified version of a FHIR schema output#4468

Closed
kieran-wilkinson-4 wants to merge 35 commits intomasterfrom
AEA-6322-Simple-Version-Structure-Definitions
Closed

New: [AEA-6322] - simplified version of a FHIR schema output#4468
kieran-wilkinson-4 wants to merge 35 commits intomasterfrom
AEA-6322-Simple-Version-Structure-Definitions

Conversation

@kieran-wilkinson-4
Copy link
Copy Markdown
Contributor

@kieran-wilkinson-4 kieran-wilkinson-4 commented Mar 20, 2026

Summary

  • ✨ New Feature

Details

adds initial generation of json schema from fhir StructureDefinition

scope is intentionally tight:

  • iterates over top-level attributes -> maps into simple json schema
  • no deep nesting yet (flat structure only)
  • ignores refs / bindings for now (acknowledged but out of scope)
  • uses json-schema-to-ts for type inference
  • changes jest to vitest

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 20, 2026

This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket:

AEA-6322

@bencegadanyi1-nhs bencegadanyi1-nhs changed the title Aea 6322 simple version structure definitions Update: [AEA-6322] - version 0 implementation of a simple structured definition Mar 23, 2026
@bencegadanyi1-nhs bencegadanyi1-nhs marked this pull request as ready for review March 23, 2026 13:18
Copilot AI review requested due to automatic review settings March 23, 2026 13:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new packages/fhir-schema-generation workspace intended to download FHIR profiles from Simplifier, parse selected JSON schemas, and generate a simplified structured schema output, while integrating the package into the repo’s build/lint/test/coverage tooling.

Changes:

  • Added a new fhir-schema-generation Node/TypeScript workspace with download/extract + schema parse/generate utilities.
  • Added Jest + ESLint configuration and initial unit tests for the downloader/extractor.
  • Wired the new workspace into root workspaces, Make targets, pre-commit, Sonar coverage paths, and repo documentation.

Reviewed changes

Copilot reviewed 24 out of 27 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
sonar-project.properties Adds lcov path so Sonar can ingest coverage for the new workspace.
package.json Registers packages/fhir-schema-generation as a workspace.
package-lock.json Locks dependencies for the new workspace and workspace linkage.
eslint.config.mjs Minor formatting change to the root ESLint config export.
README.md Documents the new fhir-schema-generation package in the repo overview.
Makefile Adds install/build/test/run/clean hooks for the new workspace.
.vscode/launch.json Adds a debug profile to run the new package via tsx.
.trivyignore.yaml Reorders/updates vulnerability ignore entries.
.pre-commit-config.yaml Adds a pre-commit hook to lint the new workspace.
.gitignore Ignores generated artifacts for the new workspace (output/compiled files).
packages/fhir-schema-generation/package.json Defines scripts and dependencies for the new workspace.
packages/fhir-schema-generation/package-lock.json Workspace-local lockfile for the new package.
packages/fhir-schema-generation/tsconfig.json TypeScript compiler configuration for the new workspace.
packages/fhir-schema-generation/jest.config.ts Jest configuration (ts-jest ESM preset, coverage enabled).
packages/fhir-schema-generation/eslint.config.mjs Extends root ESLint config and overrides a few rules for this workspace.
packages/fhir-schema-generation/README.md Documents purpose and basic run/test commands for the package.
packages/fhir-schema-generation/.tool-versions Pins node version for the workspace.
packages/fhir-schema-generation/tests/fetch-fhir.test.ts Adds unit tests for download/extract/version-resolution behavior.
packages/fhir-schema-generation/src/index.ts Adds a runnable pipeline: download → parse → generate → print output.
packages/fhir-schema-generation/src/utils/common.ts Adds a small filename-normalization helper.
packages/fhir-schema-generation/src/utils/download-simplifier-package.ts Implements package metadata fetch, tarball download, secure-ish extraction, and manifest reading.
packages/fhir-schema-generation/src/utils/parse-fhir-schema.ts Parses Simplifier-produced JSON schema files and extracts typed definitions.
packages/fhir-schema-generation/src/utils/generate-schema.ts Converts parsed definitions into simplified JSON schema definitions.
packages/fhir-schema-generation/src/utils/schema-types.ts Defines derived schema types and runtime type guards for schema nodes.
packages/fhir-schema-generation/src/models/fhir-package/dist-tags.interface.ts Defines types for NPM-style dist-tag metadata.
packages/fhir-schema-generation/src/models/fhir-package/package-metadata.interface.ts Defines registry metadata shape used by the downloader.
packages/fhir-schema-generation/src/models/fhir-package/package-version.interface.ts Defines per-version metadata shape used by the downloader.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/fhir-schema-generation/src/utils/generate-schema.ts Outdated
Comment thread packages/fhir-schema-generation/src/utils/schema-types.ts
Comment thread packages/fhir-schema-generation/package.json Outdated
Comment thread packages/fhir-schema-generation/tests/fetch-fhir.test.ts Outdated
Comment thread packages/fhir-schema-generation/src/utils/download-simplifier-package.ts Outdated
Comment thread Makefile Outdated
Comment thread README.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@kieran-wilkinson-4 kieran-wilkinson-4 force-pushed the AEA-6322-Simple-Version-Structure-Definitions branch from a974851 to e7db0da Compare March 30, 2026 15:15
@sonarqubecloud
Copy link
Copy Markdown

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.

4 participants