Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Hl7.Fhir.ElementModel;
using Hl7.Fhir.Model;
using Hl7.Fhir.Specification.Source;
using Hl7.Fhir.Specification.Terminology;
using Hl7.Fhir.Validation;
using Microsoft.Extensions.Options;
using Microsoft.Health.Fhir.Core.Configs;
Expand Down Expand Up @@ -38,12 +39,20 @@ public ProfileValidator(IProvideProfilesForValidation profilesResolver, IOptions

private Validator GetValidator()
{
var expanderSettings = new ValueSetExpanderSettings
{
MaxExpansionSize = 20000, // Set your desired max expansion size here
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did we get the 20,000 from? Was that the default value for Firely until we upgraded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current valueset expansion that is being used is ~17,000. The 20,000 give a bit of a buffer, but I don't want much larger than necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we set this from a configuration somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could add a setting, and make it configurable. But I wanted a quick change to address this issue. Then we can consider a more in depth change.

};

var terminologyService = new LocalTerminologyService(_resolver.AsAsync(), expanderSettings);

var ctx = new ValidationSettings()
{
ResourceResolver = _resolver,
GenerateSnapshot = true,
Trace = false,
ResolveExternalReferences = false,
TerminologyService = terminologyService,
};

var validator = new Validator(ctx);
Expand Down
Loading