@records-fhir/validation-types 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/fix-suggestions/catalog-core.d.ts +3 -0
- package/dist/fix-suggestions/catalog-core.d.ts.map +1 -0
- package/dist/fix-suggestions/catalog-core.js +164 -0
- package/dist/fix-suggestions/catalog-core.js.map +1 -0
- package/dist/fix-suggestions/catalog-invariants.d.ts +3 -0
- package/dist/fix-suggestions/catalog-invariants.d.ts.map +1 -0
- package/dist/fix-suggestions/catalog-invariants.js +299 -0
- package/dist/fix-suggestions/catalog-invariants.js.map +1 -0
- package/dist/fix-suggestions/catalog-metadata.d.ts +3 -0
- package/dist/fix-suggestions/catalog-metadata.d.ts.map +1 -0
- package/dist/fix-suggestions/catalog-metadata.js +258 -0
- package/dist/fix-suggestions/catalog-metadata.js.map +1 -0
- package/dist/fix-suggestions/catalog-misc.d.ts +3 -0
- package/dist/fix-suggestions/catalog-misc.d.ts.map +1 -0
- package/dist/fix-suggestions/catalog-misc.js +389 -0
- package/dist/fix-suggestions/catalog-misc.js.map +1 -0
- package/dist/fix-suggestions/catalog-reference-profile.d.ts +3 -0
- package/dist/fix-suggestions/catalog-reference-profile.d.ts.map +1 -0
- package/dist/fix-suggestions/catalog-reference-profile.js +201 -0
- package/dist/fix-suggestions/catalog-reference-profile.js.map +1 -0
- package/dist/fix-suggestions/fallbacks.d.ts +14 -0
- package/dist/fix-suggestions/fallbacks.d.ts.map +1 -0
- package/dist/fix-suggestions/fallbacks.js +121 -0
- package/dist/fix-suggestions/fallbacks.js.map +1 -0
- package/dist/fix-suggestions/types.d.ts +17 -0
- package/dist/fix-suggestions/types.d.ts.map +1 -0
- package/dist/fix-suggestions/types.js +3 -0
- package/dist/fix-suggestions/types.js.map +1 -0
- package/dist/fix-suggestions.d.ts +8 -28
- package/dist/fix-suggestions.d.ts.map +1 -1
- package/dist/fix-suggestions.js +14 -1413
- package/dist/fix-suggestions.js.map +1 -1
- package/dist/validation/aspect-aliases.d.ts +1 -1
- package/dist/validation/aspect-aliases.d.ts.map +1 -1
- package/dist/validation/aspect-aliases.js.map +1 -1
- package/dist/validation/aspect-enums.d.ts +11 -11
- package/dist/validation/aspect-enums.d.ts.map +1 -1
- package/dist/validation/defaults/base-settings.d.ts +150 -0
- package/dist/validation/defaults/base-settings.d.ts.map +1 -0
- package/dist/validation/defaults/base-settings.js +266 -0
- package/dist/validation/defaults/base-settings.js.map +1 -0
- package/dist/validation/defaults/ig-packages.d.ts +54 -0
- package/dist/validation/defaults/ig-packages.d.ts.map +1 -0
- package/dist/validation/defaults/ig-packages.js +56 -0
- package/dist/validation/defaults/ig-packages.js.map +1 -0
- package/dist/validation/defaults/ig-settings-factories.d.ts +19 -0
- package/dist/validation/defaults/ig-settings-factories.d.ts.map +1 -0
- package/dist/validation/defaults/ig-settings-factories.js +133 -0
- package/dist/validation/defaults/ig-settings-factories.js.map +1 -0
- package/dist/validation/defaults/terminology-defaults.d.ts +66 -0
- package/dist/validation/defaults/terminology-defaults.d.ts.map +1 -0
- package/dist/validation/defaults/terminology-defaults.js +221 -0
- package/dist/validation/defaults/terminology-defaults.js.map +1 -0
- package/dist/validation/dtos.d.ts +15 -2
- package/dist/validation/dtos.d.ts.map +1 -1
- package/dist/validation/dtos.js +18 -2
- package/dist/validation/dtos.js.map +1 -1
- package/dist/validation/index.d.ts +13 -4
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +5 -2
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/issue-identity.d.ts +22 -0
- package/dist/validation/issue-identity.d.ts.map +1 -0
- package/dist/validation/issue-identity.js +79 -0
- package/dist/validation/issue-identity.js.map +1 -0
- package/dist/validation/issue-provenance.d.ts +26 -0
- package/dist/validation/issue-provenance.d.ts.map +1 -0
- package/dist/validation/issue-provenance.js +73 -0
- package/dist/validation/issue-provenance.js.map +1 -0
- package/dist/validation/issue-rule-id.d.ts +7 -0
- package/dist/validation/issue-rule-id.d.ts.map +1 -0
- package/dist/validation/issue-rule-id.js +27 -0
- package/dist/validation/issue-rule-id.js.map +1 -0
- package/dist/validation/issue-summary.d.ts +50 -0
- package/dist/validation/issue-summary.d.ts.map +1 -0
- package/dist/validation/issue-summary.js +2 -0
- package/dist/validation/issue-summary.js.map +1 -0
- package/dist/validation/results.d.ts +3 -314
- package/dist/validation/results.d.ts.map +1 -1
- package/dist/validation/results.js +3 -5
- package/dist/validation/results.js.map +1 -1
- package/dist/validation/run-snapshot.d.ts +98 -0
- package/dist/validation/run-snapshot.d.ts.map +1 -0
- package/dist/validation/run-snapshot.js +8 -0
- package/dist/validation/run-snapshot.js.map +1 -0
- package/dist/validation/settings-defaults.d.ts +7 -265
- package/dist/validation/settings-defaults.d.ts.map +1 -1
- package/dist/validation/settings-defaults.js +6 -648
- package/dist/validation/settings-defaults.js.map +1 -1
- package/dist/validation/settings-performance.d.ts +16 -0
- package/dist/validation/settings-performance.d.ts.map +1 -0
- package/dist/validation/settings-performance.js +19 -0
- package/dist/validation/settings-performance.js.map +1 -0
- package/dist/validation/settings-policies.d.ts +56 -0
- package/dist/validation/settings-policies.d.ts.map +1 -0
- package/dist/validation/settings-policies.js +5 -0
- package/dist/validation/settings-policies.js.map +1 -0
- package/dist/validation/settings-public.d.ts +22 -0
- package/dist/validation/settings-public.d.ts.map +1 -0
- package/dist/validation/settings-public.js +2 -0
- package/dist/validation/settings-public.js.map +1 -0
- package/dist/validation/settings-schema.d.ts +2765 -1271
- package/dist/validation/settings-schema.d.ts.map +1 -1
- package/dist/validation/settings-schema.js +110 -23
- package/dist/validation/settings-schema.js.map +1 -1
- package/dist/validation/settings-terminology.d.ts +174 -0
- package/dist/validation/settings-terminology.d.ts.map +1 -0
- package/dist/validation/settings-terminology.js +7 -0
- package/dist/validation/settings-terminology.js.map +1 -0
- package/dist/validation/settings-types.d.ts +3 -3
- package/dist/validation/settings-types.d.ts.map +1 -1
- package/dist/validation/settings-validators.d.ts.map +1 -1
- package/dist/validation/settings-validators.js +9 -0
- package/dist/validation/settings-validators.js.map +1 -1
- package/dist/validation/settings.d.ts +10 -444
- package/dist/validation/settings.d.ts.map +1 -1
- package/dist/validation/settings.js +1 -18
- package/dist/validation/settings.js.map +1 -1
- package/dist/validation/validation-advanced-metrics.d.ts +314 -0
- package/dist/validation/validation-advanced-metrics.d.ts.map +1 -0
- package/dist/validation/validation-advanced-metrics.js +2 -0
- package/dist/validation/validation-advanced-metrics.js.map +1 -0
- package/package.json +3 -3
- package/dist/validation-settings.d.ts +0 -28
- package/dist/validation-settings.d.ts.map +0 -1
- package/dist/validation-settings.js +0 -52
- package/dist/validation-settings.js.map +0 -1
- package/dist/validation-types.d.ts +0 -18
- package/dist/validation-types.d.ts.map +0 -1
- package/dist/validation-types.js +0 -16
- package/dist/validation-types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,25 @@ captures changes that affect type-package consumers directly.
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [0.1.6] — 2026-07-23
|
|
15
|
+
|
|
16
|
+
Released alongside `@records-fhir/validator` 0.5.0.
|
|
17
|
+
|
|
18
|
+
### Surface
|
|
19
|
+
|
|
20
|
+
- Added `code-inferred` to `ProfileApplicationSource` so consumers can
|
|
21
|
+
distinguish FHIR-implied Observation profile selection from explicit,
|
|
22
|
+
resource-declared, imposed-policy, and base-fallback application.
|
|
23
|
+
|
|
24
|
+
## [0.1.5] — 2026-06-23
|
|
25
|
+
|
|
26
|
+
Released alongside `@records-fhir/validator` 0.1.14.
|
|
27
|
+
|
|
28
|
+
### Surface
|
|
29
|
+
|
|
30
|
+
- Published the issue-identity helper exports, including
|
|
31
|
+
`computeValidationIssueId`, required by the validator runtime and CLI.
|
|
32
|
+
|
|
14
33
|
## [0.1.4] — 2026-05-28
|
|
15
34
|
|
|
16
35
|
Released alongside `@records-fhir/validator` 0.1.10.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-core.d.ts","sourceRoot":"","sources":["../../src/fix-suggestions/catalog-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAmKtD,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { CATALOG_METADATA } from './catalog-metadata.js';
|
|
2
|
+
export const CATALOG_CORE = {
|
|
3
|
+
// -------------------------------------------------------------------------
|
|
4
|
+
// Terminology
|
|
5
|
+
// -------------------------------------------------------------------------
|
|
6
|
+
'terminology-binding-required': {
|
|
7
|
+
why: 'Required bindings must use codes from the specified ValueSet for interoperability.',
|
|
8
|
+
fix: 'Replace the code with one from the required ValueSet. Check the ValueSet definition for allowed codes.',
|
|
9
|
+
example: 'Use "active" instead of "Active" for Patient.status',
|
|
10
|
+
specUrl: 'https://www.hl7.org/fhir/terminologies.html#required',
|
|
11
|
+
patch: { action: 'replace', path: '{{fieldPath}}', value: '(use a code from {{valueSet}})' },
|
|
12
|
+
},
|
|
13
|
+
'terminology-binding-extensible': {
|
|
14
|
+
why: 'Extensible bindings prefer codes from the ValueSet, but allow extensions for missing concepts.',
|
|
15
|
+
fix: 'If your concept exists in the ValueSet, use it. Otherwise, document why a custom code is needed.',
|
|
16
|
+
specUrl: 'https://www.hl7.org/fhir/terminologies.html#extensible',
|
|
17
|
+
},
|
|
18
|
+
'terminology-binding-preferred': {
|
|
19
|
+
why: 'Preferred bindings recommend using codes from the ValueSet for better interoperability.',
|
|
20
|
+
fix: 'Consider using a code from the preferred ValueSet. Custom codes are allowed but reduce consistency.',
|
|
21
|
+
specUrl: 'https://www.hl7.org/fhir/terminologies.html#preferred',
|
|
22
|
+
},
|
|
23
|
+
'terminology-binding-example': {
|
|
24
|
+
why: 'Example bindings suggest possible codes but impose no constraints.',
|
|
25
|
+
fix: 'This is informational only. Your code is valid, but check if the example codes better fit your use case.',
|
|
26
|
+
},
|
|
27
|
+
'terminology-binding-required-code': {
|
|
28
|
+
why: 'This primitive code element must use a value from the required binding.',
|
|
29
|
+
fix: 'Use one of the allowed code values. Check the element definition for the list.',
|
|
30
|
+
example: 'For status: use "active", "inactive", or "entered-in-error"',
|
|
31
|
+
},
|
|
32
|
+
'terminology-binding-extensible-code': {
|
|
33
|
+
why: 'Prefer standard codes for primitive code elements to improve interoperability.',
|
|
34
|
+
fix: 'If a standard code fits, use it. Document why a custom code is needed if not.',
|
|
35
|
+
},
|
|
36
|
+
'terminology-binding-preferred-code': {
|
|
37
|
+
why: 'Preferred codes suggest standard values for better consistency.',
|
|
38
|
+
fix: 'Consider using the preferred code if it fits. This is informational.',
|
|
39
|
+
},
|
|
40
|
+
'terminology-binding-example-code': {
|
|
41
|
+
why: 'Example codes show typical usage but are not required.',
|
|
42
|
+
fix: 'This is informational only. Your code is valid.',
|
|
43
|
+
},
|
|
44
|
+
'terminology-binding-missing': {
|
|
45
|
+
why: 'A required coded element is missing its code value.',
|
|
46
|
+
fix: 'Add the required code from the bound ValueSet.',
|
|
47
|
+
},
|
|
48
|
+
'terminology-valueset-error': {
|
|
49
|
+
why: 'Could not validate against the ValueSet (lookup failed).',
|
|
50
|
+
fix: 'Check terminology server connectivity. The code may still be valid.',
|
|
51
|
+
},
|
|
52
|
+
'terminology-code-invalid': {
|
|
53
|
+
why: 'The code is not valid for the declared code system. For UCUM quantities, the code must be a machine-readable UCUM expression, not just the display text.',
|
|
54
|
+
fix: 'Replace the code with a valid code from the declared system. If the issue contains a suggestedCode, use that value; for pH this is typically "[pH]".',
|
|
55
|
+
example: 'For system "http://unitsofmeasure.org", use code "[pH]" instead of "pH".',
|
|
56
|
+
specUrl: 'https://www.hl7.org/fhir/terminologies.html',
|
|
57
|
+
patch: { action: 'replace', path: '{{fieldPath}}', value: '{{suggestedCode}}' },
|
|
58
|
+
},
|
|
59
|
+
'terminology-display-mismatch': {
|
|
60
|
+
why: 'The code may be valid, but the display text does not match the terminology server display for that code.',
|
|
61
|
+
fix: 'Replace the display with an accepted display from the terminology server, or omit display and let consumers render the code.',
|
|
62
|
+
example: 'Keep system/code stable and update only Coding.display.',
|
|
63
|
+
specUrl: 'https://www.hl7.org/fhir/datatypes.html#Coding',
|
|
64
|
+
},
|
|
65
|
+
'terminology-coding-system-valueset': {
|
|
66
|
+
why: 'Coding.system must identify the CodeSystem that defines the code. A ValueSet URL describes an allowed set of codes and is not valid as Coding.system.',
|
|
67
|
+
fix: 'Replace Coding.system with the canonical CodeSystem URL for the selected code. Keep the ValueSet only in profile bindings or documentation.',
|
|
68
|
+
example: 'Use "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus" instead of "http://hl7.org/fhir/ValueSet/marital-status".',
|
|
69
|
+
specUrl: 'https://www.hl7.org/fhir/datatypes.html#Coding',
|
|
70
|
+
patch: { action: 'replace', path: '{{fieldPath}}', value: '(use the code system URL for this code)' },
|
|
71
|
+
},
|
|
72
|
+
// -------------------------------------------------------------------------
|
|
73
|
+
// Structural
|
|
74
|
+
// -------------------------------------------------------------------------
|
|
75
|
+
'structural-required-element-missing': {
|
|
76
|
+
why: 'Required elements (min=1) must be present for the resource to be valid.',
|
|
77
|
+
fix: 'Add the missing element with a valid value.',
|
|
78
|
+
example: 'Add Patient.name: [{ "family": "Doe", "given": ["John"] }]',
|
|
79
|
+
patch: { action: 'add', path: '{{fieldPath}}', value: '(required — see element definition for type)' },
|
|
80
|
+
},
|
|
81
|
+
'structural-cardinality-min': {
|
|
82
|
+
why: 'The element requires a minimum number of values.',
|
|
83
|
+
fix: 'Add more values to meet the minimum cardinality requirement.',
|
|
84
|
+
},
|
|
85
|
+
'structural-cardinality-max': {
|
|
86
|
+
why: 'The element has exceeded the maximum allowed values.',
|
|
87
|
+
fix: 'Remove excess values or consolidate them as appropriate.',
|
|
88
|
+
},
|
|
89
|
+
'structural-type-mismatch': {
|
|
90
|
+
why: 'The value type must match what the FHIR specification expects.',
|
|
91
|
+
fix: 'Change the value to the correct type. Check the element definition for allowed types.',
|
|
92
|
+
example: 'birthDate should be "1990-01-15" (string), not 1990 (number)',
|
|
93
|
+
patch: { action: 'replace', path: '{{fieldPath}}', value: '(change to type {{expectedType}})' },
|
|
94
|
+
},
|
|
95
|
+
'structural-invalid-json': {
|
|
96
|
+
why: 'The resource cannot be parsed as valid JSON.',
|
|
97
|
+
fix: 'Check for syntax errors: missing quotes, commas, brackets, or trailing commas.',
|
|
98
|
+
},
|
|
99
|
+
'structural-invalid-format': {
|
|
100
|
+
why: 'The primitive value does not match the FHIR format for its declared type.',
|
|
101
|
+
fix: 'Use the FHIR primitive format expected by the element, such as adding seconds and a timezone for dateTime values.',
|
|
102
|
+
example: 'Use 2026-05-15T11:59:02Z instead of 2026-05-15T11:59:02',
|
|
103
|
+
},
|
|
104
|
+
'structural-unknown-element': {
|
|
105
|
+
why: 'This element is not defined in the FHIR specification for this resource type.',
|
|
106
|
+
fix: 'Remove the unknown element, or use an extension if custom data is needed.',
|
|
107
|
+
},
|
|
108
|
+
'structural-resource-type-mismatch': {
|
|
109
|
+
why: 'The resourceType does not match the expected type for this context.',
|
|
110
|
+
fix: 'Correct the resourceType field to match the expected type.',
|
|
111
|
+
},
|
|
112
|
+
'structural-missing-resource-type': {
|
|
113
|
+
why: 'Every FHIR resource must have a resourceType field.',
|
|
114
|
+
fix: 'Add resourceType at the root: { "resourceType": "Patient", ... }',
|
|
115
|
+
patch: { action: 'add', path: 'resourceType', value: '"{{resourceType}}"' },
|
|
116
|
+
},
|
|
117
|
+
'structural-cardinality-violation': {
|
|
118
|
+
why: 'The element count violates the cardinality constraint.',
|
|
119
|
+
fix: 'Add or remove elements to meet the min/max requirements.',
|
|
120
|
+
},
|
|
121
|
+
'structural-validation-error': {
|
|
122
|
+
why: 'Structural validation failed for an unspecified reason.',
|
|
123
|
+
fix: 'Check the resource structure against the FHIR specification.',
|
|
124
|
+
},
|
|
125
|
+
'structural-empty-array': {
|
|
126
|
+
why: 'FHIR arrays must contain at least one element if present.',
|
|
127
|
+
fix: 'Remove the empty array or add at least one entry.',
|
|
128
|
+
},
|
|
129
|
+
'structural-invalid-id': {
|
|
130
|
+
why: 'Resource id must match the FHIR id pattern: [A-Za-z0-9\\-._]{1,64}.',
|
|
131
|
+
fix: 'Use only alphanumeric characters, hyphens, dots, and underscores (max 64 chars).',
|
|
132
|
+
},
|
|
133
|
+
'structural-attachment-size-mismatch': {
|
|
134
|
+
why: 'Attachment.size does not match the actual byte count of Attachment.data.',
|
|
135
|
+
fix: 'Recalculate size from the decoded base64 data length and set it correctly.',
|
|
136
|
+
},
|
|
137
|
+
'structural-bundle-fullurl-duplicate': {
|
|
138
|
+
why: 'Each Bundle entry must have a unique fullUrl for unambiguous reference resolution.',
|
|
139
|
+
fix: 'Assign a unique fullUrl to each entry (use urn:uuid for temporary IDs).',
|
|
140
|
+
},
|
|
141
|
+
'structural-bundle-fullurl-invalid': {
|
|
142
|
+
why: 'The fullUrl value is not a valid URI.',
|
|
143
|
+
fix: 'Use an absolute URL (https://...) or urn:uuid:... format.',
|
|
144
|
+
},
|
|
145
|
+
'structural-bundle-fullurl-not-absolute': {
|
|
146
|
+
why: 'Bundle entry fullUrl must be an absolute URI, not a relative path.',
|
|
147
|
+
fix: 'Prefix with the server base URL or use a urn:uuid identifier.',
|
|
148
|
+
},
|
|
149
|
+
'structural-hapi-error': {
|
|
150
|
+
why: 'The HAPI FHIR validator reported an error.',
|
|
151
|
+
fix: 'Review the error details and fix the indicated issue.',
|
|
152
|
+
},
|
|
153
|
+
'structural-invalid-uri': {
|
|
154
|
+
why: 'The URI format is invalid per RFC 3986.',
|
|
155
|
+
fix: 'Use a valid URI format with proper scheme and encoding.',
|
|
156
|
+
example: 'https://example.org/fhir or urn:uuid:...',
|
|
157
|
+
},
|
|
158
|
+
'validation-error': {
|
|
159
|
+
why: 'General validation error.',
|
|
160
|
+
fix: 'Review the error message for specific guidance.',
|
|
161
|
+
},
|
|
162
|
+
...CATALOG_METADATA,
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=catalog-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-core.js","sourceRoot":"","sources":["../../src/fix-suggestions/catalog-core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GAAkC;IACvD,4EAA4E;IAC5E,cAAc;IACd,4EAA4E;IAC5E,8BAA8B,EAAE;QAC5B,GAAG,EAAE,oFAAoF;QACzF,GAAG,EAAE,wGAAwG;QAC7G,OAAO,EAAE,qDAAqD;QAC9D,OAAO,EAAE,sDAAsD;QAC/D,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,gCAAgC,EAAE;KAC/F;IACD,gCAAgC,EAAE;QAC9B,GAAG,EAAE,gGAAgG;QACrG,GAAG,EAAE,kGAAkG;QACvG,OAAO,EAAE,wDAAwD;KACpE;IACD,+BAA+B,EAAE;QAC7B,GAAG,EAAE,yFAAyF;QAC9F,GAAG,EAAE,qGAAqG;QAC1G,OAAO,EAAE,uDAAuD;KACnE;IACD,6BAA6B,EAAE;QAC3B,GAAG,EAAE,oEAAoE;QACzE,GAAG,EAAE,0GAA0G;KAClH;IACD,mCAAmC,EAAE;QACjC,GAAG,EAAE,yEAAyE;QAC9E,GAAG,EAAE,gFAAgF;QACrF,OAAO,EAAE,6DAA6D;KACzE;IACD,qCAAqC,EAAE;QACnC,GAAG,EAAE,gFAAgF;QACrF,GAAG,EAAE,+EAA+E;KACvF;IACD,oCAAoC,EAAE;QAClC,GAAG,EAAE,iEAAiE;QACtE,GAAG,EAAE,sEAAsE;KAC9E;IACD,kCAAkC,EAAE;QAChC,GAAG,EAAE,wDAAwD;QAC7D,GAAG,EAAE,iDAAiD;KACzD;IACD,6BAA6B,EAAE;QAC3B,GAAG,EAA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ACzE,GAAG,EAAE,+DAA+D;KACvE;IACD,uBAAuB,EAAE;QACrB,GAAG,EAAE,4CAA4C;QACjD,GAAG,EAAE,uDAAuD;KAC/D;IACD,wBAAwB,EAAE;QACtB,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,yDAAyD;QAC9D,OAAO,EAAE,0CAA0C;KACtD;IACD,kBAAkB,EAAE;QAChB,GAAG,EAAE,2BAA2B;QAChC,GAAG,EAAE,iDAAiD;KACzD;IAED,GAAG,gBAAgB;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-invariants.d.ts","sourceRoot":"","sources":["../../src/fix-suggestions/catalog-invariants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAgT5D,CAAC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
export const CATALOG_INVARIANTS = {
|
|
2
|
+
// -------------------------------------------------------------------------
|
|
3
|
+
// Narrative
|
|
4
|
+
// -------------------------------------------------------------------------
|
|
5
|
+
'narrative-malformed-xhtml': {
|
|
6
|
+
why: 'Narrative must be valid XHTML for safe rendering.',
|
|
7
|
+
fix: 'Check for unclosed tags, proper nesting, and valid XML structure.',
|
|
8
|
+
example: '<div xmlns="http://www.w3.org/1999/xhtml"><p>Valid narrative</p></div>',
|
|
9
|
+
},
|
|
10
|
+
'narrative-forbidden-content': {
|
|
11
|
+
why: 'Scripts and interactive elements are forbidden for security.',
|
|
12
|
+
fix: 'Remove <script>, <form>, <iframe>, onclick handlers, and javascript: URLs.',
|
|
13
|
+
},
|
|
14
|
+
'narrative-invalid-root': {
|
|
15
|
+
why: 'Narrative must have a <div> root with XHTML namespace.',
|
|
16
|
+
fix: 'Wrap content in: <div xmlns="http://www.w3.org/1999/xhtml">...</div>',
|
|
17
|
+
patch: { action: 'replace', path: 'text.div', value: '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\">...</div>"' },
|
|
18
|
+
},
|
|
19
|
+
// -------------------------------------------------------------------------
|
|
20
|
+
// Business Rules
|
|
21
|
+
// -------------------------------------------------------------------------
|
|
22
|
+
'business-rule-violation': {
|
|
23
|
+
why: 'A clinical or business rule defined for this resource was violated.',
|
|
24
|
+
fix: 'Review the specific rule constraint and adjust your data accordingly.',
|
|
25
|
+
},
|
|
26
|
+
'business-value-out-of-range': {
|
|
27
|
+
why: 'The value falls outside the acceptable range for this measurement.',
|
|
28
|
+
fix: 'Verify the value is correct. If intentional, add interpretation or note.',
|
|
29
|
+
},
|
|
30
|
+
'business-negative-value': {
|
|
31
|
+
why: 'This field typically should not contain negative values.',
|
|
32
|
+
fix: 'Use a positive value, or verify this is intentional for your use case.',
|
|
33
|
+
},
|
|
34
|
+
'business-rule-sp-composite': {
|
|
35
|
+
why: 'A composite SearchParameter business rule was violated.',
|
|
36
|
+
fix: 'Review the composite parameter components and ensure the resource data satisfies all parts.',
|
|
37
|
+
},
|
|
38
|
+
'business-invalid-effective-date': {
|
|
39
|
+
why: 'The effective date format is invalid or illogical.',
|
|
40
|
+
fix: 'Use valid FHIR date/dateTime format (YYYY-MM-DD or YYYY-MM-DDTHH:MM:SSZ).',
|
|
41
|
+
},
|
|
42
|
+
'business-future-effective-date': {
|
|
43
|
+
why: 'Clinical observations typically should not have future effective dates.',
|
|
44
|
+
fix: 'Verify the date is correct. If intentional (e.g., scheduled medication), document why.',
|
|
45
|
+
},
|
|
46
|
+
'business-final-status-no-value': {
|
|
47
|
+
why: 'Observations with final status typically require a value.',
|
|
48
|
+
fix: 'Add a value, or use dataAbsentReason if value is legitimately missing.',
|
|
49
|
+
patch: { action: 'add', path: 'Observation.valueQuantity', value: '{ "value": 0, "unit": "...", "system": "http://unitsofmeasure.org" }' },
|
|
50
|
+
},
|
|
51
|
+
'business-invalid-onset-date': {
|
|
52
|
+
why: 'The onset date format is invalid.',
|
|
53
|
+
fix: 'Use valid FHIR date format (YYYY, YYYY-MM, or YYYY-MM-DD).',
|
|
54
|
+
},
|
|
55
|
+
'business-future-onset-date': {
|
|
56
|
+
why: 'Condition onset date is in the future.',
|
|
57
|
+
fix: 'If this is expected onset, consider using a different element.',
|
|
58
|
+
},
|
|
59
|
+
'business-invalid-birth-date': {
|
|
60
|
+
why: 'The birth date format is invalid.',
|
|
61
|
+
fix: 'Use valid date format: YYYY, YYYY-MM, or YYYY-MM-DD.',
|
|
62
|
+
},
|
|
63
|
+
'business-future-birth-date': {
|
|
64
|
+
why: 'Birth date cannot be in the future.',
|
|
65
|
+
fix: 'Correct the birth date to a past or current date.',
|
|
66
|
+
},
|
|
67
|
+
'business-unreasonable-age': {
|
|
68
|
+
why: 'The calculated age seems unrealistic (e.g., >150 years).',
|
|
69
|
+
fix: 'Verify the birth date is correct.',
|
|
70
|
+
},
|
|
71
|
+
'business-end-before-start': {
|
|
72
|
+
why: 'Period.end must be after Period.start for logical consistency.',
|
|
73
|
+
fix: 'Swap the dates or correct the incorrect value.',
|
|
74
|
+
},
|
|
75
|
+
'finished-status-no-end': {
|
|
76
|
+
why: 'Encounters with a "finished" status should record an end timestamp.',
|
|
77
|
+
fix: 'Add Encounter.period.end, or set the status to in-progress if still active.',
|
|
78
|
+
},
|
|
79
|
+
'invalid-status-value': {
|
|
80
|
+
why: 'The status code is not in the allowed value set for this resource.',
|
|
81
|
+
fix: 'Pick a status from the resource\'s defined status value set.',
|
|
82
|
+
},
|
|
83
|
+
'invalid-date-format': {
|
|
84
|
+
why: 'Dates must follow the FHIR date format (YYYY, YYYY-MM, or YYYY-MM-DD).',
|
|
85
|
+
fix: 'Rewrite the value as an ISO-8601 date with no embedded time.',
|
|
86
|
+
},
|
|
87
|
+
'invalid-period-start': {
|
|
88
|
+
why: 'Period.start must be a valid FHIR dateTime.',
|
|
89
|
+
fix: 'Use an ISO-8601 dateTime like 2026-04-08T10:15:30Z.',
|
|
90
|
+
},
|
|
91
|
+
'invalid-period-end': {
|
|
92
|
+
why: 'Period.end must be a valid FHIR dateTime.',
|
|
93
|
+
fix: 'Use an ISO-8601 dateTime like 2026-04-08T10:15:30Z.',
|
|
94
|
+
},
|
|
95
|
+
// -------------------------------------------------------------------------
|
|
96
|
+
// FHIR Core Invariants (dom-*, obs-*, pat-*, ele-*, ref-*, bdl-*, con-*)
|
|
97
|
+
// -------------------------------------------------------------------------
|
|
98
|
+
'dom-6': {
|
|
99
|
+
why: 'FHIR invariant dom-6: a resource should have narrative for robust management.',
|
|
100
|
+
fix: 'Add a populated `text.div` narrative element to the resource.',
|
|
101
|
+
specUrl: 'https://www.hl7.org/fhir/domainresource.html#invs',
|
|
102
|
+
},
|
|
103
|
+
'ele-1-violation': {
|
|
104
|
+
why: 'FHIR invariant ele-1: all FHIR elements must have @value or children.',
|
|
105
|
+
fix: 'Populate the element with a value or remove it if empty.',
|
|
106
|
+
},
|
|
107
|
+
'ref-1-violation': {
|
|
108
|
+
why: 'FHIR invariant ref-1: a Reference.reference must be either a relative or absolute URL.',
|
|
109
|
+
fix: 'Use a proper reference format (ResourceType/id or absolute URL).',
|
|
110
|
+
},
|
|
111
|
+
'obs-3-violation': {
|
|
112
|
+
why: 'FHIR invariant obs-3: a ReferenceRange must have at least a low, high, or text.',
|
|
113
|
+
fix: 'Add one of Observation.referenceRange.low, .high, or .text.',
|
|
114
|
+
},
|
|
115
|
+
'obs-6-violation': {
|
|
116
|
+
why: 'FHIR invariant obs-6: dataAbsentReason SHALL only be present if Observation.value[x] is not present.',
|
|
117
|
+
fix: 'Remove dataAbsentReason when a value is present, or vice versa.',
|
|
118
|
+
patch: { action: 'remove', path: 'Observation.dataAbsentReason' },
|
|
119
|
+
},
|
|
120
|
+
'obs-7-violation': {
|
|
121
|
+
why: 'FHIR invariant obs-7: Observation.value must not be present if Observation.dataAbsentReason is present.',
|
|
122
|
+
fix: 'Remove one of value[x] or dataAbsentReason.',
|
|
123
|
+
},
|
|
124
|
+
'pat-1-violation': {
|
|
125
|
+
why: 'FHIR invariant pat-1: Patient.contact SHALL at least contain a name, a telecom, or an address.',
|
|
126
|
+
fix: 'Populate at least one of name, telecom, or address on Patient.contact.',
|
|
127
|
+
},
|
|
128
|
+
'con-3-violation': {
|
|
129
|
+
why: 'FHIR invariant con-3: Condition.clinicalStatus and verificationStatus pair must be consistent.',
|
|
130
|
+
fix: 'Ensure clinicalStatus and verificationStatus follow the allowed combinations.',
|
|
131
|
+
},
|
|
132
|
+
'con-4-violation': {
|
|
133
|
+
why: 'FHIR invariant con-4: Condition.abatement SHALL only be present if clinicalStatus is resolved, remission, or inactive.',
|
|
134
|
+
fix: 'Remove abatement or update clinicalStatus accordingly.',
|
|
135
|
+
},
|
|
136
|
+
'con-5-violation': {
|
|
137
|
+
why: 'FHIR invariant con-5: Condition.clinicalStatus SHALL NOT be present if verificationStatus is entered-in-error.',
|
|
138
|
+
fix: 'Remove clinicalStatus when verificationStatus is entered-in-error.',
|
|
139
|
+
patch: { action: 'remove', path: 'Condition.clinicalStatus' },
|
|
140
|
+
},
|
|
141
|
+
'bdl-1-violation': {
|
|
142
|
+
why: 'FHIR invariant bdl-1: total is only allowed in search and history bundles.',
|
|
143
|
+
fix: 'Remove Bundle.total or change the Bundle.type to searchset/history.',
|
|
144
|
+
},
|
|
145
|
+
'bdl-2-violation': {
|
|
146
|
+
why: 'FHIR invariant bdl-2: entry.search only when Bundle.type is searchset.',
|
|
147
|
+
fix: 'Remove entry.search or switch the bundle to type searchset.',
|
|
148
|
+
},
|
|
149
|
+
'bdl-3-violation': {
|
|
150
|
+
why: 'FHIR invariant bdl-3: entry.request mandatory for type=transaction/batch/history.',
|
|
151
|
+
fix: 'Add entry.request or switch the bundle type.',
|
|
152
|
+
},
|
|
153
|
+
'bdl-4-violation': {
|
|
154
|
+
why: 'FHIR invariant bdl-4: entry.response mandatory for type=transaction-response/batch-response/history.',
|
|
155
|
+
fix: 'Add entry.response or switch the bundle type.',
|
|
156
|
+
},
|
|
157
|
+
'ait-1-violation': {
|
|
158
|
+
why: 'FHIR invariant ait-1: AllergyIntolerance clinical status must be consistent with verification status.',
|
|
159
|
+
fix: 'Ensure clinicalStatus and verificationStatus follow the allowed combinations.',
|
|
160
|
+
},
|
|
161
|
+
'ait-2-violation': {
|
|
162
|
+
why: 'FHIR invariant ait-2: AllergyIntolerance onset date must be before or at the recorded date.',
|
|
163
|
+
fix: 'Correct the onset or recordedDate so onset does not come after recorded.',
|
|
164
|
+
},
|
|
165
|
+
'cmp-1-violation': {
|
|
166
|
+
why: 'FHIR invariant cmp-1: Composition.section entry must reference a resource.',
|
|
167
|
+
fix: 'Add a valid reference for each Composition.section.entry.',
|
|
168
|
+
},
|
|
169
|
+
'cmp-2-violation': {
|
|
170
|
+
why: 'FHIR invariant cmp-2: A section must have at least one of text, entry, or section.',
|
|
171
|
+
fix: 'Add text, entry, or subsection to the empty Composition.section.',
|
|
172
|
+
},
|
|
173
|
+
// -------------------------------------------------------------------------
|
|
174
|
+
// Bundle-specific structural issues
|
|
175
|
+
// -------------------------------------------------------------------------
|
|
176
|
+
'bundle-validation-error': {
|
|
177
|
+
why: 'Bundle structural validation failed.',
|
|
178
|
+
fix: 'Review the Bundle type, entries, and request/response elements.',
|
|
179
|
+
},
|
|
180
|
+
'bundle-cross-entry-reference-missing': {
|
|
181
|
+
why: 'A reference inside this Bundle entry points to a resource that is not included as an entry in the same Bundle. For document and message Bundles, all referenced resources must be present.',
|
|
182
|
+
fix: 'Add the missing resource as a Bundle entry, or change the reference to point at an existing entry.',
|
|
183
|
+
},
|
|
184
|
+
'bundle-cross-entry-reference-unresolved': {
|
|
185
|
+
why: 'A reference cannot be resolved within this Bundle. The target resource may exist on an external server.',
|
|
186
|
+
fix: 'If the reference should be self-contained, add the target as a Bundle entry. Otherwise this warning is informational.',
|
|
187
|
+
},
|
|
188
|
+
'bundle-duplicate-entry': {
|
|
189
|
+
why: 'The same resource (same resourceType and id) appears more than once in the Bundle.',
|
|
190
|
+
fix: 'Remove the duplicate entry or assign distinct ids.',
|
|
191
|
+
},
|
|
192
|
+
'bundle-document-first-entry': {
|
|
193
|
+
why: 'Document bundles must have Composition as the first entry.',
|
|
194
|
+
fix: 'Re-order entries so the Composition resource comes first.',
|
|
195
|
+
},
|
|
196
|
+
'bundle-document-first-entry-not-composition': {
|
|
197
|
+
why: 'The first entry in a document Bundle must be a Composition resource.',
|
|
198
|
+
fix: 'Move the Composition entry to position 0 in Bundle.entry.',
|
|
199
|
+
},
|
|
200
|
+
'bundle-message-first-entry': {
|
|
201
|
+
why: 'Message bundles must have MessageHeader as the first entry.',
|
|
202
|
+
fix: 'Re-order entries so the MessageHeader resource comes first.',
|
|
203
|
+
},
|
|
204
|
+
'bundle-message-first-entry-not-messageheader': {
|
|
205
|
+
why: 'The first entry in a message Bundle must be a MessageHeader resource.',
|
|
206
|
+
fix: 'Move the MessageHeader entry to position 0 in Bundle.entry.',
|
|
207
|
+
},
|
|
208
|
+
'bundle-entry-missing-fullurl': {
|
|
209
|
+
why: 'Bundle entries should have a fullUrl for reference resolution within the Bundle.',
|
|
210
|
+
fix: 'Add fullUrl as an absolute URL or urn:uuid to the entry.',
|
|
211
|
+
},
|
|
212
|
+
'bundle-history-missing-total': {
|
|
213
|
+
why: 'History bundles should include a `total` field.',
|
|
214
|
+
fix: 'Populate Bundle.total with the total number of matches.',
|
|
215
|
+
},
|
|
216
|
+
'bundle-searchset-missing-total': {
|
|
217
|
+
why: 'Searchset bundles should include a `total` field.',
|
|
218
|
+
fix: 'Populate Bundle.total with the total matches for the search.',
|
|
219
|
+
},
|
|
220
|
+
'bundle-searchset-entry-missing-mode': {
|
|
221
|
+
why: 'Searchset bundle entries should declare entry.search.mode (match, include, outcome).',
|
|
222
|
+
fix: 'Set entry.search.mode explicitly for each entry.',
|
|
223
|
+
},
|
|
224
|
+
// -------------------------------------------------------------------------
|
|
225
|
+
// Contained resource issues
|
|
226
|
+
// -------------------------------------------------------------------------
|
|
227
|
+
'contained-missing-id': {
|
|
228
|
+
why: 'Contained resources must have an id so they can be referenced.',
|
|
229
|
+
fix: 'Add an id to the contained resource.',
|
|
230
|
+
patch: { action: 'add', path: '{{fieldPath}}.id', value: '"contained-1"' },
|
|
231
|
+
},
|
|
232
|
+
'contained-missing-resourcetype': {
|
|
233
|
+
why: 'Contained resources must declare their resourceType.',
|
|
234
|
+
fix: 'Add resourceType to every entry in the contained array.',
|
|
235
|
+
},
|
|
236
|
+
'contained-duplicate-id': {
|
|
237
|
+
why: 'Contained resource ids must be unique within a resource.',
|
|
238
|
+
fix: 'Rename duplicate contained resource ids.',
|
|
239
|
+
},
|
|
240
|
+
'contained-nested-violation': {
|
|
241
|
+
why: 'FHIR forbids nesting contained resources inside contained resources.',
|
|
242
|
+
fix: 'Flatten the contained hierarchy so each contained resource is only one level deep.',
|
|
243
|
+
},
|
|
244
|
+
'contained-unreferenced': {
|
|
245
|
+
why: 'Every contained resource should be referenced by the parent (dom-3).',
|
|
246
|
+
fix: 'Add a reference to the contained resource via #localId or remove it.',
|
|
247
|
+
},
|
|
248
|
+
'contained-reference-type-unknown': {
|
|
249
|
+
why: 'The referenced contained resource\'s type cannot be inferred.',
|
|
250
|
+
fix: 'Fix the parent reference path or add the contained resource.',
|
|
251
|
+
},
|
|
252
|
+
// -------------------------------------------------------------------------
|
|
253
|
+
// Deep binding / terminology traversal
|
|
254
|
+
// -------------------------------------------------------------------------
|
|
255
|
+
'deep-binding-empty-code': {
|
|
256
|
+
why: 'A coded element anywhere in the resource is empty.',
|
|
257
|
+
fix: 'Populate the coding.code (and system) or remove the element.',
|
|
258
|
+
},
|
|
259
|
+
'deep-binding-no-valid-coding': {
|
|
260
|
+
why: 'A CodeableConcept has no coding that matches the required ValueSet.',
|
|
261
|
+
fix: 'Add at least one coding whose system/code is from the required ValueSet.',
|
|
262
|
+
},
|
|
263
|
+
// -------------------------------------------------------------------------
|
|
264
|
+
// Early termination (short-circuit on critical errors)
|
|
265
|
+
// -------------------------------------------------------------------------
|
|
266
|
+
'early-termination-null-resource': {
|
|
267
|
+
why: 'Validation was asked to run on a null/undefined resource.',
|
|
268
|
+
fix: 'Ensure the caller passes a valid FHIR resource object.',
|
|
269
|
+
},
|
|
270
|
+
'early-termination-empty-resource': {
|
|
271
|
+
why: 'Validation was asked to run on an empty object.',
|
|
272
|
+
fix: 'Provide a populated FHIR resource with resourceType and fields.',
|
|
273
|
+
},
|
|
274
|
+
'early-termination-not-object': {
|
|
275
|
+
why: 'FHIR resources must be JSON objects.',
|
|
276
|
+
fix: 'Parse the input to a JS object before passing it to the validator.',
|
|
277
|
+
},
|
|
278
|
+
'early-termination-missing-resourcetype': {
|
|
279
|
+
why: 'Every FHIR resource must declare resourceType.',
|
|
280
|
+
fix: 'Add resourceType at the root of the resource.',
|
|
281
|
+
},
|
|
282
|
+
'early-termination-unknown-resourcetype': {
|
|
283
|
+
why: 'The supplied resourceType is not known in this FHIR version.',
|
|
284
|
+
fix: 'Verify resourceType spelling (case-sensitive) and the FHIR version.',
|
|
285
|
+
},
|
|
286
|
+
'early-termination-missing-id': {
|
|
287
|
+
why: 'A persistent FHIR resource requires an id.',
|
|
288
|
+
fix: 'Add an id to the resource or use a POST create (server assigns id).',
|
|
289
|
+
},
|
|
290
|
+
'early-termination-missing-required': {
|
|
291
|
+
why: 'A required top-level element is missing — aborting further checks.',
|
|
292
|
+
fix: 'Populate the indicated required element and re-run validation.',
|
|
293
|
+
},
|
|
294
|
+
'early-termination-resource-too-large': {
|
|
295
|
+
why: 'The resource exceeds the configured size limit.',
|
|
296
|
+
fix: 'Split large bundles or raise the validator size limit cautiously.',
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
//# sourceMappingURL=catalog-invariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-invariants.js","sourceRoot":"","sources":["../../src/fix-suggestions/catalog-invariants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAkC;IAC7D,4EAA4E;IAC5E,YAAY;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3,"file":"catalog-metadata.d.ts","sourceRoot":"","sources":["../../src/fix-suggestions/catalog-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAgQ1D,CAAC"}
|