Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions src/Spark.Engine/Extensions/InteractionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Linq;
using Spark.Engine.Core;
using System.Net.Http.Headers;

namespace Spark.Engine.Extensions;

Expand All @@ -22,6 +23,10 @@ public static Key ExtractKey(this ILocalhost localhost, Bundle.EntryComponent en
if (entry.Request != null && entry.Request.Url != null)
{
key = localhost.UriToKey(entry.Request.Url);
if (!string.IsNullOrWhiteSpace(entry.Request.IfMatch))
{
key.VersionId = EntityTagHeaderValue.Parse(entry.Request.IfMatch).Tag.Trim('"');
}
}
else if (entry.Resource != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spark.Engine/Service/FhirService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public async Task<FhirResponse> HandleInteractionAsync(Entry interaction)
switch (interaction.Method)
{
case Bundle.HTTPVerb.PUT:
return await PutAsync(interaction).ConfigureAwait(false);
return await UpdateAsync(interaction.Key, interaction.Resource).ConfigureAwait(false);
case Bundle.HTTPVerb.POST:
return await CreateAsync(interaction).ConfigureAwait(false);
case Bundle.HTTPVerb.DELETE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ private async Task<IList<Tuple<Entry, FhirResponse>>> HandleTransactionAsync(ILi
{
List<Tuple<Entry, FhirResponse>> responses = new List<Tuple<Entry, FhirResponse>>();

_transfer.Internalize(interactions, mapper);
// each operation will be executed by itself
// _transfer.Internalize(interactions, mapper);

foreach (Entry interaction in interactions)
{
Expand All @@ -83,7 +84,7 @@ private async Task<IList<Tuple<Entry, FhirResponse>>> HandleTransactionAsync(ILi
responses.Add(new Tuple<Entry, FhirResponse>(interaction, response));
}

_transfer.Externalize(interactions);
// _transfer.Externalize(interactions);
return responses;
}

Expand Down
Loading