Skip to content

Commit e5fab4d

Browse files
author
records-bot
committed
sync: monorepo @ validator 0.4.2 / validation-types 0.1.5
Snapshot of medvertical/records monorepo state, exported via oss:export-validator. Tracks the npm publication of: @records-fhir/validator@0.4.2 @records-fhir/validation-types@0.1.5 Run npm i @records-fhir/validator@0.4.2 for the matching distribution. The conformance evidence in conformance-results/ matches the published tarball.
1 parent cf169e4 commit e5fab4d

241 files changed

Lines changed: 15099 additions & 1921 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
For production CI, pin an immutable patch tag:
4848
4949
```yaml
50-
- uses: medvertical/records-fhir-validator@v0.4.1
50+
- uses: medvertical/records-fhir-validator@v0.4.2
5151
with:
5252
paths: resources/**/*.json
5353
profile-url: http://hl7.org/fhir/StructureDefinition/Patient
@@ -60,7 +60,7 @@ Action pinning:
6060
| Goal | Pin in `uses:` | Notes |
6161
|---|---|---|
6262
| Latest stable in current major | `medvertical/records-fhir-validator@v0` | Floating tag, force-moved on stable releases only |
63-
| Exact released version | `medvertical/records-fhir-validator@v0.4.1` | Immutable consumer tag |
63+
| Exact released version | `medvertical/records-fhir-validator@v0.4.2` | Immutable consumer tag |
6464
| Bit-exact reproducibility | `medvertical/records-fhir-validator@<commit-sha>` | Best for audit and forensics |
6565

6666
The `validator-v<semver>` tag is the npm mirror/release-page tag. Use
@@ -69,7 +69,7 @@ The `validator-v<semver>` tag is the npm mirror/release-page tag. Use
6969
### npm Package
7070

7171
```sh
72-
npm install @records-fhir/validator@0.4.1 @records-fhir/validation-types@0.1.5
72+
npm install @records-fhir/validator@0.4.2 @records-fhir/validation-types@0.1.5
7373
```
7474

7575
Run the CLI against one file or a folder:
@@ -139,7 +139,7 @@ includes `file`, `resourceType`, `profileUrl`, and `issues`. With
139139

140140
## What Is Included
141141

142-
- `@records-fhir/validator` 0.4.1 - Apache-2.0 validation engine.
142+
- `@records-fhir/validator` 0.4.2 - Apache-2.0 validation engine.
143143
- `@records-fhir/validation-types` 0.1.5 - Apache-2.0 validation-domain types.
144144
- Composite GitHub Action at repository root.
145145
- Standalone examples under `packages/validator/examples/`.

packages/validation-types/src/fix-suggestions/catalog-core.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ export const CATALOG_CORE: Record<string, FixSuggestion> = {
9898
why: 'The resource cannot be parsed as valid JSON.',
9999
fix: 'Check for syntax errors: missing quotes, commas, brackets, or trailing commas.',
100100
},
101+
'structural-invalid-format': {
102+
why: 'The primitive value does not match the FHIR format for its declared type.',
103+
fix: 'Use the FHIR primitive format expected by the element, such as adding seconds and a timezone for dateTime values.',
104+
example: 'Use 2026-05-15T11:59:02Z instead of 2026-05-15T11:59:02',
105+
},
101106
'structural-unknown-element': {
102107
why: 'This element is not defined in the FHIR specification for this resource type.',
103108
fix: 'Remove the unknown element, or use an extension if custom data is needed.',
@@ -198,8 +203,8 @@ export const CATALOG_CORE: Record<string, FixSuggestion> = {
198203
fix: 'Use just the version number without ETag wrapper.',
199204
},
200205
'metadata-version-id-same-as-id': {
201-
why: 'versionId and resource id serve different purposes.',
202-
fix: 'Use a separate version identifier, typically sequential numbers.',
206+
why: 'versionId and resource id serve different purposes, but matching values are not a FHIR conformance error.',
207+
fix: 'Informational only. Keep it if your server intentionally starts versioning at the logical id value.',
203208
},
204209
'metadata-version-id-very-high': {
205210
why: 'Unusually high versionId may indicate timestamp-based versioning.',

packages/validation-types/src/fix-suggestions/catalog-misc.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ export const CATALOG_MISC: Record<string, FixSuggestion> = {
126126
fix: 'Add enableBehavior ("all" or "any") when item has multiple enableWhen conditions.',
127127
},
128128
'questionnaire-invariant-que-5': {
129-
why: 'Questionnaire invariant que-5: only "coding" and "quantity" items can have answerOption.',
130-
fix: 'Set item.type to choice/open-choice or remove the answerOption.',
129+
why: 'Questionnaire invariant que-5: only answer-capable Questionnaire item types can have answerOption or answerValueSet.',
130+
fix: 'Set item.type to a compatible answer type such as choice/open-choice, coding, decimal, integer, date, dateTime, time, string, or quantity; otherwise remove the answer source.',
131131
},
132132
'questionnaire-invariant-que-6': {
133133
why: 'Questionnaire invariant que-6: required items must have items or initial.',

packages/validation-types/src/validation/__tests__/mii-2026-preset.test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import { describe, expect, it } from 'vitest';
22
import {
33
createEhds2026ValidationSettings,
44
createMii2026ValidationSettings,
5+
FHIR_CORE_EXTENSION_PACKAGE_SET,
6+
FHIR_CORE_EXTENSION_PACKAGE_VERSIONS,
7+
FHIR_CORE_TERMINOLOGY_PACKAGE_SET,
8+
FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS,
59
HL7_EU_EHDS_2026_PACKAGE_SET,
610
HL7_EU_EHDS_2026_PACKAGE_VERSIONS,
711
HL7_EU_EPS_XTEHR_REFERENCE_PACKAGE,
@@ -10,6 +14,28 @@ import {
1014
} from '../index';
1115

1216
describe('MII 2026 validation preset', () => {
17+
it('pins core terminology packages for deterministic local binding checks', () => {
18+
expect(FHIR_CORE_TERMINOLOGY_PACKAGE_SET)
19+
.toHaveLength(Object.keys(FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS).length);
20+
expect(FHIR_CORE_TERMINOLOGY_PACKAGE_SET).toContainEqual({
21+
id: 'hl7.terminology.r5',
22+
version: '7.1.0'
23+
});
24+
});
25+
26+
it('pins core extension packages for deterministic local extension checks', () => {
27+
expect(FHIR_CORE_EXTENSION_PACKAGE_SET)
28+
.toHaveLength(Object.keys(FHIR_CORE_EXTENSION_PACKAGE_VERSIONS).length);
29+
expect(FHIR_CORE_EXTENSION_PACKAGE_SET).toContainEqual({
30+
id: 'hl7.fhir.uv.extensions.r4',
31+
version: '5.3.0'
32+
});
33+
expect(FHIR_CORE_EXTENSION_PACKAGE_SET).toContainEqual({
34+
id: 'hl7.fhir.uv.extensions.r5',
35+
version: '5.3.0'
36+
});
37+
});
38+
1339
it('keeps the package pin set in sync with the version map', () => {
1440
expect(MII_2026_PACKAGE_SET).toHaveLength(Object.keys(MII_2026_PACKAGE_VERSIONS).length);
1541
expect(MII_2026_PACKAGE_SET).toContainEqual({

packages/validation-types/src/validation/defaults/ig-packages.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ export interface FhirPackagePin {
99
version: string;
1010
}
1111

12+
export const FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS = {
13+
'hl7.terminology.r4': '7.1.0',
14+
'hl7.terminology.r5': '7.1.0',
15+
} as const;
16+
17+
export const FHIR_CORE_TERMINOLOGY_PACKAGE_SET: FhirPackagePin[] = Object.entries(
18+
FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS
19+
).map(([id, version]) => ({ id, version }));
20+
21+
export const FHIR_CORE_EXTENSION_PACKAGE_VERSIONS = {
22+
'hl7.fhir.uv.extensions.r4': '5.3.0',
23+
'hl7.fhir.uv.extensions.r5': '5.3.0',
24+
} as const;
25+
26+
export const FHIR_CORE_EXTENSION_PACKAGE_SET: FhirPackagePin[] = Object.entries(
27+
FHIR_CORE_EXTENSION_PACKAGE_VERSIONS
28+
).map(([id, version]) => ({ id, version }));
29+
1230
export const MII_2026_PACKAGE_VERSIONS = {
1331
'de.basisprofil.r4': '1.5.4',
1432
'de.medizininformatikinitiative.kerndatensatz.meta': '2026.0.0',

packages/validation-types/src/validation/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ export {
141141
DEFAULT_CACHE_CONFIG,
142142
createEhds2026ValidationSettings,
143143
createMii2026ValidationSettings,
144+
FHIR_CORE_EXTENSION_PACKAGE_SET,
145+
FHIR_CORE_EXTENSION_PACKAGE_VERSIONS,
146+
FHIR_CORE_TERMINOLOGY_PACKAGE_SET,
147+
FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS,
144148
HL7_EU_EHDS_2026_PACKAGE_SET,
145149
HL7_EU_EHDS_2026_PACKAGE_VERSIONS,
146150
HL7_EU_EPS_XTEHR_REFERENCE_PACKAGE,

packages/validation-types/src/validation/settings-defaults.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export type {
1313
Mii2026ValidationSettingsOverrides,
1414
} from './defaults/ig-packages';
1515
export {
16+
FHIR_CORE_EXTENSION_PACKAGE_VERSIONS,
17+
FHIR_CORE_EXTENSION_PACKAGE_SET,
18+
FHIR_CORE_TERMINOLOGY_PACKAGE_VERSIONS,
19+
FHIR_CORE_TERMINOLOGY_PACKAGE_SET,
1620
MII_2026_PACKAGE_VERSIONS,
1721
MII_2026_PACKAGE_SET,
1822
HL7_EU_EHDS_2026_PACKAGE_VERSIONS,

packages/validation-types/src/validation/settings-schema.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ export const TerminologyResolutionSchema = z.object({
155155
validateCodes: z.boolean(),
156156
cacheResults: z.boolean(),
157157
cacheTTLSeconds: z.number(),
158+
requestTimeoutMs: z.number().optional(),
159+
slowResponseThresholdMs: z.number().optional(),
160+
maxRemoteCodeSystemValidations: z.number().optional(),
158161
}).optional(),
159162
twoPhaseExpansion: z.object({
160163
enabled: z.boolean(),

packages/validation-types/src/validation/settings.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export interface AdvisorRuleMatch {
7878
code?: string | string[];
7979
path?: string | string[];
8080
message?: string;
81+
messageRegex?: string | string[];
8182
aspect?: string | string[];
8283
severity?: string;
8384
profile?: string;
@@ -202,6 +203,12 @@ export interface ValidationSettings {
202203
cacheResults: boolean;
203204
/** Cache expiration in seconds (default: 3600) */
204205
cacheTTLSeconds: number;
206+
/** Per-request timeout for remote terminology operations. */
207+
requestTimeoutMs?: number;
208+
/** Open the remote terminology circuit after repeated slow responses. */
209+
slowResponseThresholdMs?: number;
210+
/** Cap direct remote CodeSystem validations per validator instance. */
211+
maxRemoteCodeSystemValidations?: number;
205212
};
206213

207214
/**

packages/validator/CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,40 @@ ship together; package-only changes are noted under each release.
1212

1313
No unreleased changes yet.
1414

15+
## [0.4.2] — 2026-07-05
16+
17+
Patch release for validator architecture boundaries, evidence policy, and
18+
maintainability after the 0.4.1 evidence release.
19+
20+
### Added
21+
22+
- Added stable `host` and `conformance` package surfaces for embedding and
23+
evidence tooling, keeping repository consumers off deprecated implementation
24+
subpaths.
25+
- Added `dedupeIssuesWithTrace()` so duplicate-suppression decisions expose the
26+
named policy rule that removed an issue.
27+
- Added an explicit FHIR Schema runtime policy export that keeps the graph path
28+
evidence-only until Java/reference and dual-path gates justify promotion.
29+
30+
### Changed
31+
32+
- Hardened public-export and mirror-import architecture guards so new internal
33+
validator exports or repository imports fail fast.
34+
- Split terminology remote CodeSystem budget handling out of the API client and
35+
kept the fail-open budget reason traceable.
36+
- Split remote CodeSystem budget aggregation tests into focused coverage.
37+
38+
### Documentation
39+
40+
- Documented validator fallback, fail-open, fail-closed, legacy compatibility,
41+
and release-gate guardrails.
42+
43+
### Verification
44+
45+
- Verified with merged PR #252 CI, main CI, validator build, OSS boundary audit,
46+
OSS package smoke, architecture guards, focused Vitest suites, and npm publish
47+
dry-run.
48+
1549
## [0.4.1] — 2026-07-01
1650

1751
Patch release for the standalone validator evidence lanes and MII reference

0 commit comments

Comments
 (0)