Skip to content

Conversation

@Kasdejong
Copy link
Member

@Kasdejong Kasdejong commented Apr 23, 2025

Description

Applied changes to make the validator run against SDK v6

Related issues

Closes FirelyTeam/firely-net-sdk#3032

Also review FirelyTeam/fhir-test-cases#61

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the SDK version to alpha2 by updating the validation API to use ITypedElement instead of IScopedNode and aligning resource conversion calls accordingly.

  • Updated method signatures and XML documentation to use ITypedElement.
  • Modified resource resolution methods to use TryResolve…Async and updated schema builder using directives.

Reviewed Changes

Copilot reviewed 88 out of 91 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Firely.Fhir.Validation/Impl/ElementSchema.cs Updated validation signatures and using directives to use ITypedElement.
src/Firely.Fhir.Validation/Impl/DatatypeSchema.cs Replaced IScopedNode with ITypedElement in method parameters and error messages.
src/Firely.Fhir.Validation/Impl/ChildrenValidator.cs Converted children matching and validation logic to ITypedElement.
src/Firely.Fhir.Validation/Impl/CardinalityValidator.cs Updated interface implementations to reflect new element type.
src/Firely.Fhir.Validation/Impl/CanonicalValidator.cs Updated method signature to use ITypedElement.
src/Firely.Fhir.Validation/Impl/BindingValidator.cs Switched validation method parameter types to ITypedElement.
src/Firely.Fhir.Validation/Impl/BasicValidator.cs Changed abstract validation method parameter types to ITypedElement.
src/Firely.Fhir.Validation/Impl/AnyValidator.cs Adjusted validation group routines to use ITypedElement.
src/Firely.Fhir.Validation/Impl/AllValidator.cs Updated IValidatable and IGroupValidatable implementations for ITypedElement.
src/Firely.Fhir.Validation.Shared/Validator.cs Converted resource conversion calls to ITypedElement using ToPocoNode.
src/Firely.Fhir.Validation.Compilation.Shared/StructureDefinitionToElementSchemaResolver.cs Updated pattern matching for StructureDefinition resolution.
src/Firely.Fhir.Validation.Compilation.Shared/StructureDefinitionCorrectionsResolver.cs Replaced ResolveBy* calls with TryResolveBy* and adjusted schema corrections.
SchemaBuilders files (*.cs) Added missing using directives for Hl7.Fhir.Model.
Files not reviewed (3)
  • .idea/.idea.Firely.Validator.API/.idea/projectSettingsUpdater.xml: Language not supported
  • firely-validator-api-tests.props: Language not supported
  • firely-validator-api.props: Language not supported

@Kasdejong Kasdejong requested a review from ewoutkramer April 29, 2025 10:27
# Conflicts:
#	test/Firely.Fhir.Validation.Compilation.Tests.R4/TestData/issue-165/fhirpkg.lock.json
#	test/Firely.Fhir.Validation.Compilation.Tests.Shared/ExtensionContextComponentTests.cs
Consider applying the 'await' operator to the result of the call. -->
<WarningsAsErrors>CS4014</WarningsAsErrors>
<WarningsNotAsErrors>NU5104</WarningsNotAsErrors>
<WarningsNotAsErrors>NU5104, CS8602, CS8604, CS8619, CS8620, CS8603</WarningsNotAsErrors>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #513, we should not disable those warnings once PR is ready :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require a TON of effort right now!!! I have well over 1000 of these errors because our model is now nullable! We should make a separate issue for this once the dust settles.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Can you create a PR for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(aaah.....we don't have the preview of this new copilot stuff :-()

Kasdejong added 13 commits May 27, 2025 10:55
# Conflicts:
#	firely-validator-api-tests.props
#	firely-validator-api.props
#	src/Firely.Fhir.Validation/Impl/CardinalityValidator.cs
#	src/Firely.Fhir.Validation/Impl/FixedValidator.cs
#	src/Firely.Fhir.Validation/Impl/IssueAssertion.cs
#	src/Firely.Fhir.Validation/Impl/PatternValidator.cs
#	src/Firely.Fhir.Validation/Schema/ValueElementNode.cs
#	src/Firely.Fhir.Validation/Support/IScopedNodeExtensions.cs
…ha2' into feature/upgrade-sdk-to-6.0.0-alpha2
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the SDK to v6 alpha2, refactoring the validation logic to use ITypedElement instead of IScopedNode and updating related error messages and dependency versions.

  • Refactored validation method signatures and error messages across multiple validators
  • Updated project properties, including version bumps and warning suppressions
  • Adjusted namespace declarations and minor code clean-ups in the compilation shared files

Reviewed Changes

Copilot reviewed 88 out of 89 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Firely.Fhir.Validation/Impl/DatatypeSchema.cs Updated validation method signatures and error messages to use ITypedElement
src/Firely.Fhir.Validation/Impl/ChildrenValidator.cs Changed parameter types and related record definitions to ITypedElement
src/Firely.Fhir.Validation/Impl/CardinalityValidator.cs Adjusted input parameter types and method implementations accordingly
src/Firely.Fhir.Validation/Impl/CanonicalValidator.cs Updated method signature to use ITypedElement
src/Firely.Fhir.Validation/Impl/BindingValidator.cs Updated signature and enhanced null handling in code representation
src/Firely.Fhir.Validation/Impl/BasicValidator.cs Changed abstract methods and validation implementations to ITypedElement
src/Firely.Fhir.Validation/Impl/BaseTypeInvariantConstraintsValidator.cs Updated method signature and error message for ITypedElement
src/Firely.Fhir.Validation/Impl/AnyValidator.cs Refactored validation interfaces to use ITypedElement across the file
src/Firely.Fhir.Validation/Impl/AllValidator.cs Updated validation implementations from IScopedNode to ITypedElement
src/Firely.Fhir.Validation.Shared/Validator.cs Adjusted public API overloads and internal validation implementations to use ITypedElement with new conversion methods
src/Firely.Fhir.Validation.Compilation.Shared/StructureDefinitionToElementSchemaResolver.cs Utilized modern pattern matching for schema retrieval
src/Firely.Fhir.Validation.Compilation.Shared/StructureDefinitionCorrectionsResolver.cs Updated namespace declaration and resource resolution methods
src/Firely.Fhir.Validation.Compilation.Shared/SchemaBuilders/* Added missing using of Hl7.Fhir.Model where necessary
firely-validator-api.props Bumped version, added VersionSuffix, and updated warning configurations
firely-validator-api-tests.props Updated SDK version and warning configurations
Files not reviewed (1)
  • .idea/.idea.Firely.Validator.API/.idea/projectSettingsUpdater.xml: Language not supported

@ewoutkramer
Copy link
Member

Approved, but note that I had some questions about changes in the manifest tests.

@ewoutkramer ewoutkramer merged commit c87a1e2 into develop-sdk6 Jun 18, 2025
2 checks passed
@ewoutkramer ewoutkramer deleted the feature/upgrade-sdk-to-6.0.0-alpha2 branch June 18, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants