Skip to content

Conversation

@luisfabib
Copy link
Owner

@luisfabib luisfabib commented Jan 19, 2026

This PR refactors all FHIR element constraint validators from Pydantic's @field_validator decorator to @model_validator(mode="after"). This change aligns the validation approach with a new validate_element_constraint API that validates multiple fields simultaneously at the model instance level rather than individual field values.

Changes

@luisfabib luisfabib merged commit e837e1f into main Jan 19, 2026
3 checks passed
@luisfabib luisfabib deleted the invariants-field-to-model-validators branch January 19, 2026 10:03
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
luisfabib added a commit that referenced this pull request Jan 23, 2026
commit 3f16bfe
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 16:08:16 2026 +0100

    Fix Primitive Extension Placeholder Cardinality for FHIR List-Type Fields (#207)

commit 71c2a75
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Tue Jan 20 12:50:04 2026 +0100

    Add placeholder elements for `Extension.value` type choice values in R4, R4B, R5 (#206)

commit 24e79a8
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 14:58:13 2026 +0100

    Fix FHIRPath `$this` context in nested function call (#203)

commit e837e1f
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Mon Jan 19 11:03:21 2026 +0100

    Refactor FHIR constraint validators from field-level to model-level validation (#201)

commit f5e28f6
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:36:29 2026 +0100

    Fix FHIR `eld-11` constraint validation expression R5 `ElementDefinition` (#199)

commit 05cbe2b
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 17:11:58 2026 +0100

    Fix FHIRPath environment variable precedence in nested evaluations (#197)

commit 99cdcd1
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 16:56:43 2026 +0100

    Fix FHIRPath Ambiguity Issues Where Negative Numbers Conflicted With Subtraction Operators  (#198)

commit 79ec56e
Author: Luis Fábregas-Ibáñez <48292540+luisfabib@users.noreply.github.com>
Date:   Sat Jan 17 14:59:56 2026 +0100

    Fix FHIRPath `Union` Operation `TypeError` with Incomparable Types (#196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use of field_validator breaks FHIRPath expressions with environment variables in backbone elements

2 participants