-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add GET interaction support for transaction bundles
This adds support for GET interaction in batch/transaction bundles. Fixes #305
- Loading branch information
1 parent
7a3cd05
commit 85fb8cf
Showing
3 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/Spark.Engine/Service/FhirServiceExtensions/GetManipulationOperation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Hl7.Fhir.Model; | ||
using Hl7.Fhir.Rest; | ||
using Spark.Engine.Core; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Spark.Engine.Service.FhirServiceExtensions | ||
{ | ||
public class GetManipulationOperation : ResourceManipulationOperation | ||
{ | ||
public GetManipulationOperation(Resource resource, IKey operationKey, SearchResults searchResults, SearchParams searchCommand = null) | ||
: base(resource, operationKey, searchResults, searchCommand) | ||
{ | ||
} | ||
|
||
public static Uri ReadSearchUri(Bundle.EntryComponent entry) | ||
{ | ||
return entry.Request != null | ||
? new Uri(entry.Request.Url, UriKind.RelativeOrAbsolute) | ||
: null; | ||
} | ||
|
||
protected override IEnumerable<Entry> ComputeEntries() | ||
{ | ||
if (SearchResults != null) | ||
{ | ||
foreach (string localKeyLiteral in SearchResults) | ||
{ | ||
yield return Entry.Create(Bundle.HTTPVerb.GET, Key.ParseOperationPath(localKeyLiteral)); | ||
} | ||
} | ||
else | ||
{ | ||
yield return Entry.Create(Bundle.HTTPVerb.GET, OperationKey); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters