Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ const builder = new APIBuilder()
generateProfile?: boolean,
withDebugComment?: boolean,
openResourceTypeSet?: boolean,
terminology?: {
enabled: true,
packageVerification: {
"hl7.fhir.r4.core@4.0.1": "registry-integrity",
},
},
})
.python({ // Python generator
client?: "fhirpy" | "none", // client integration (default: fhirpy)
Expand Down Expand Up @@ -204,6 +210,10 @@ Each language generator accepts its own option object. All options are optional;
| `sliceGetterDefault` | `"flat" \| "raw"` | `"flat"` | Default return shape for generated slice getters (`flat` strips discriminators, `raw` returns the full FHIR element). |
| `lineWidth` | `number` | `120` | Maximum line width before wrapping. |
| `withDebugComment` | `boolean` | `false` | Emit comments tracing each generated type back to its source schema. |
| `terminology.enabled` | `boolean` | `false` | Emit a `terminology.ts` module for every package in the resolved closure. |
| `terminology.packageVerification` | `Record<string, string>` | `{}` | Map package references such as `hl7.fhir.r4.core@4.0.1` to a closure verification state (`registry-integrity`, `unverifiable`, ...). Absent entries record `not-recorded`. |

When terminology generation is enabled, each exported symbol includes its canonical identity, source package and version, declared content mode, and verification state. Only CodeSystems declaring `content: "complete"` emit code unions and display maps. ValueSet expansions are never promoted to constants, and an `unverifiable` package emits identity and provenance without concept content.

**Python** — `.python({ ... })`

Expand Down
6 changes: 3 additions & 3 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"dependencies": {
"@atomic-ehr/fhir-canonical-manager": "0.0.24",
"@atomic-ehr/fhirschema": "0.0.14",
"brace-expansion": "^5.0.8",
"brace-expansion": "^5.0.9",
"mustache": "^4.2.0",
"picocolors": "^1.1.1",
"yaml": "^2.9.0",
Expand All @@ -69,7 +69,7 @@
"minimatch": ">=10.2.3",
"rollup": ">=4.59.0",
"smol-toml": ">=1.6.1",
"brace-expansion": "^5.0.8",
"brace-expansion": "^5.0.9",
"picomatch": ">=4.0.4",
"esbuild": ">=0.28.1"
}
Expand Down
6 changes: 2 additions & 4 deletions src/api/writer-generator/typescript/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ import {
tsCamelCase,
tsExtensionFlatTypeName,
tsFieldName,
tsModulePath,
tsNameFromCanonical,
tsPackageDir,
tsProfileClassName,
tsProfileModuleName,
tsResourceName,
Expand Down Expand Up @@ -316,9 +314,9 @@ export const generateProfileImports = (
const getModulePath = (typeId: TypeIdentifier): string => {
if (isNestedIdentifier(typeId)) {
const path = tsNameFromCanonical(typeId.url, true);
if (path) return `../../${tsPackageDir(typeId.package)}/${pascalCase(path)}`;
if (path) return `../../${w.packageDirectory(typeId)}/${pascalCase(path)}`;
}
return `../../${tsModulePath(typeId)}`;
return `../../${w.modulePath(typeId)}`;
};

const addType = (typeId: TypeIdentifier) => {
Expand Down
Loading
Loading