@atomic-ehr/codegen 0.0.1-canary.20250830233015.ec9aae7 → 0.0.1-canary.20250831211734.bb1536b

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.
@@ -1,126 +0,0 @@
1
- /**
2
- * Validation Generator
3
- *
4
- * Generates client-side validation for FHIR resources including validation types,
5
- * resource validators, and validation helpers for the REST client.
6
- */
7
- import type { TypeSchema } from "../../typeschema/type-schema.types";
8
- /**
9
- * Validation options for resource validation
10
- */
11
- export interface ValidationOptions {
12
- /** Validation profile to use (strict, lenient, etc.) */
13
- profile?: "strict" | "lenient" | "minimal";
14
- /** Whether to throw on validation errors or return result */
15
- throwOnError?: boolean;
16
- /** Whether to validate required fields */
17
- validateRequired?: boolean;
18
- /** Whether to validate cardinality constraints */
19
- validateCardinality?: boolean;
20
- /** Whether to validate data types */
21
- validateTypes?: boolean;
22
- /** Whether to validate value constraints */
23
- validateConstraints?: boolean;
24
- /** Whether to collect performance metrics */
25
- collectMetrics?: boolean;
26
- }
27
- /**
28
- * Validation error details
29
- */
30
- export interface ValidationError {
31
- /** Error severity */
32
- severity: "error" | "warning" | "information";
33
- /** Error code */
34
- code: string;
35
- /** Human-readable error message */
36
- message: string;
37
- /** Path to the invalid element */
38
- path: string;
39
- /** Current value that failed validation */
40
- value?: unknown;
41
- /** Expected value or constraint */
42
- expected?: string;
43
- /** Suggestion for fixing the error */
44
- suggestion?: string;
45
- }
46
- /**
47
- * Validation warning details
48
- */
49
- export interface ValidationWarning {
50
- /** Warning code */
51
- code: string;
52
- /** Human-readable warning message */
53
- message: string;
54
- /** Path to the element */
55
- path: string;
56
- /** Current value */
57
- value?: unknown;
58
- /** Suggestion for improvement */
59
- suggestion?: string;
60
- }
61
- /**
62
- * Validation result
63
- */
64
- export interface ValidationResult {
65
- /** Whether validation passed */
66
- valid: boolean;
67
- /** List of validation errors */
68
- errors: ValidationError[];
69
- /** List of validation warnings */
70
- warnings: ValidationWarning[];
71
- /** Validation performance metrics */
72
- metrics?: {
73
- /** Time taken for validation in milliseconds */
74
- duration: number;
75
- /** Number of elements validated */
76
- elementsValidated: number;
77
- /** Number of constraints checked */
78
- constraintsChecked: number;
79
- };
80
- }
81
- /**
82
- * Validation Generator class
83
- *
84
- * Generates client-side validation logic for FHIR resources including
85
- * validation types, validators, and integration helpers.
86
- */
87
- export declare class ValidationGenerator {
88
- private resourceTypes;
89
- private resourceSchemas;
90
- /**
91
- * Collect resource types and schemas for validation generation
92
- */
93
- collectResourceData(schemas: TypeSchema[]): void;
94
- /**
95
- * Generate validation types and interfaces
96
- */
97
- generateValidationTypes(): string;
98
- /**
99
- * Generate resource validators for all resource types
100
- */
101
- generateResourceValidators(): string;
102
- /**
103
- * Generate resource-specific validators
104
- */
105
- private generateResourceSpecificValidators;
106
- /**
107
- * Generate a specific validator for a key resource type
108
- */
109
- private generateResourceValidator;
110
- /**
111
- * Generate a generic validator for less common resource types
112
- */
113
- private generateGenericResourceValidator;
114
- /**
115
- * Get validation rules for a specific resource type
116
- */
117
- private getValidationRules;
118
- /**
119
- * Generate resource-specific constraint validation
120
- */
121
- private generateResourceSpecificConstraints;
122
- /**
123
- * Get collected resource types
124
- */
125
- getResourceTypes(): Set<string>;
126
- }