You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When creating a new resource (Organization in executed tests) with multiplecontained resources which lack a defined id, a 500 Internal Server Error is returned. This is triggered by an exception: ArgumentException: An item with the same key has already been added. Key: #. The exception appears to occur in Spark.Engine.Service.FhirServiceExtensions.IndexService.MakeContainedReferencesUnique().
To Reproduce
The following code, which uses the Spark reference server, shows the behavior.
Note that the resources in this example are minimal and not representative of a full model. However, they are sufficient to exhibit the error.
UribaseUri=new Uri("https://spark.incendi.no/fhir/", UriKind.Absolute);varhttpClient=new HttpClient();varsettings=new FhirClientSettings
{VerifyFhirVersion=false,PreferredReturn= Prefer.ReturnRepresentation,PreferredFormat= ResourceFormat.Json
};varfhirClient=new FhirClient(baseUri, httpClient, settings);varorganization=new Organization
{Name="An Organization",Identifier={new Identifier("http://a-fake-system","a value")}};// Removal of EITHER contained resource (below) results in success. The error only occurs when multiple lack id.
organization.Contained.Add(new Endpoint
{Identifier={new Hl7.Fhir.Model.Identifier {System="http://not-a-real-system",Value="endpoint-1-identifier"}},});
organization.Contained.Add(new Endpoint
{Identifier={new Hl7.Fhir.Model.Identifier {System="http://not-a-real-system",Value="endpoint-2-identifier"}},});varcreatedOrg=await fhirClient.CreateAsync(organization);
Expected behavior
If the resource is valid, then a 201 Created should be returned. If the resource is invalid, then a 400-class response should be returned.
Spark version
Version: 1.5.14
The text was updated successfully, but these errors were encountered:
Describe the bug
When creating a new resource (
Organization
in executed tests) with multiple contained resources which lack a definedid
, a500 Internal Server Error
is returned. This is triggered by an exception:ArgumentException: An item with the same key has already been added. Key: #
. The exception appears to occur inSpark.Engine.Service.FhirServiceExtensions.IndexService.MakeContainedReferencesUnique()
.To Reproduce
The following code, which uses the Spark reference server, shows the behavior.
Expected behavior
If the resource is valid, then a
201 Created
should be returned. If the resource is invalid, then a400
-class response should be returned.Spark version
1.5.14
The text was updated successfully, but these errors were encountered: