New: [AEA-6322] - simplified version of a FHIR schema output#4468
New: [AEA-6322] - simplified version of a FHIR schema output#4468kieran-wilkinson-4 wants to merge 35 commits intomasterfrom
Conversation
|
This PR is linked to a ticket in an NHS Digital JIRA Project. Here's a handy link to the ticket: AEA-6322 |
…rsion-Structure-Definitions
…rsion-Structure-Definitions
There was a problem hiding this comment.
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-generationNode/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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
a974851 to
e7db0da
Compare
|



Summary
Details
adds initial generation of json schema from fhir
StructureDefinitionscope is intentionally tight:
json-schema-to-tsfor type inference