Skip to content

A ValueSet resource expanded by LocalTerminologyService/ValueSetExpander causes NullReferenceException during serialization process. #3327

@v-isyamauchi-gh

Description

@v-isyamauchi-gh

ℹ️ Do you want to ask something or start a discussion, then go here

ℹ️ Is your bug report about Firely Server Facade, please send an email to [email protected] or submit a bug report to Jira if you are a paying customer.

Describe the bug
A ValueSet resource expanded by LocalTerminologyService/ValueSetExpander causes NullReferenceException during serialization process (in PocoElementNode ctor due to 'definition' parameter being null).

The issue appears to be the 'expansion' field added by the expander having 'property' field (ValueSet.expansion.contains.property) that exists in R5 or above, not in lower versions.

To Reproduce
Run the code below with Fhir version R4 or below.

    var server = new LocalTerminologyService(
        new MultiResolver(new CachedResolver(ZipSource.CreateValidationSource())));
    var parameters = new Parameters()
    {
        Parameter = new List<Parameters.ParameterComponent>
        {
            new Parameters.ParameterComponent()
            {
                Name = "url",
                Value = new FhirUri("http://hl7.org/fhir/ValueSet/diagnostic-service-sections"),
            },
        },
    };
    var resource = await server.Expand(parameters);
    var s = await resource.ToJsonAsync();

Expected behavior
The json serialization should succeed (the expander should not add any property not existing in a specific Fhir version).

Screenshots
If applicable, add screenshots to help explain your problem.

Version used:

  • FHIR Version: R4(B) or below
  • Version: 5.11.4

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions