Skip to content

Commit

Permalink
Merge pull request #20 from bvdh/changes-bvdh
Browse files Browse the repository at this point in the history
Compartment based search and change detection fix
  • Loading branch information
GinoCanessa authored Jan 27, 2025
2 parents 302c04a + 9a82f5f commit d8d7645
Show file tree
Hide file tree
Showing 9 changed files with 1,043 additions and 67 deletions.
7 changes: 7 additions & 0 deletions src/FhirStore.Common/Configuration/CandleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,13 @@ public class CandleConfig
},
};

/// <summary>The smart required tenants.</summary>
[ConfigOption(
ArgName = "--support-not-changed",
EnvName = "Support_Not_Changed",
Description = "When enabled, the server will support checking if the resource is changed.")]
public bool SupportNotChanged = false;

/// <summary>The smart required tenants.</summary>
[ConfigOption(
ArgName = "--smart-required",
Expand Down
7 changes: 4 additions & 3 deletions src/FhirStore.Common/Models/FhirRequestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,23 +558,24 @@ internal bool TryParseRequest()
{
_id = pathComponents[1];
_interaction = StoreInteractionCodes.InstanceReadHistory;

return true;
}

if (pathComponents[2].Equals("*", StringComparison.Ordinal))
{
_compartmentType = pathComponents[0];
_id = pathComponents[1];
_compartmentType = pathComponents[2];
_interaction = StoreInteractionCodes.CompartmentSearch;

return true;
}

if (_store.Keys.Contains(pathComponents[2]))
{
_compartmentType = pathComponents[0];
_id = pathComponents[1];
_compartmentType = pathComponents[2];
_resourceType = pathComponents[2];
_interaction = StoreInteractionCodes.CompartmentTypeSearch;

return true;
Expand Down
5 changes: 5 additions & 0 deletions src/FhirStore.Common/Models/TenantConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public readonly record struct FhirPackageInfo
/// </summary>
public int MaxSubscriptionExpirationMinutes { get; set; } = 30;

/// <summary>
/// Whether or not to check for changed resources and send NotModified if not changed.
/// </summary>
public bool SupportNotChanged { get; set; } = false;

/// <summary>
/// Gets or sets a value indicating whether SMART is required.
/// </summary>
Expand Down
Loading

0 comments on commit d8d7645

Please sign in to comment.