-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Status and $Status operation to CapabilityStatement #3381
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f95c09d
Initial changes to add status to capability statement. Still getting …
PTaladay 2a314bf
Merge remote-tracking branch 'origin/main' into personal/patalada/104442
PTaladay 091a07a
Added in $status to capability statement. Still working on adding in …
PTaladay 5748edf
Reverted changes for SearchParamComponent.
PTaladay c17fa66
Added status to the documentation property for the search param compo…
PTaladay 72e97b2
Added check for activating of feature flag to determine if it shows i…
PTaladay 1edca51
Updated failing unit test after recent changes.
PTaladay b64e308
Addressing pr comments.
PTaladay 8d32b57
Added test.
PTaladay 72db218
Added tests to check if feature flag is properly being evaluated befo…
PTaladay ab4de11
Removed incorrect project reference
PTaladay 4d1fb30
Merge remote-tracking branch 'origin/main' into personal/patalada/104442
PTaladay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
32 changes: 32 additions & 0 deletions
32
src/Microsoft.Health.Fhir.Core/Data/OperationDefinition/search-parameter-status.json
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,32 @@ | ||
{ | ||
"resourceType": "OperationDefinition", | ||
"id": "status", | ||
"url": "[base]/OperationDefinition/search-parameter-status", | ||
"version": "1.0.0", | ||
"name": "Selectable search parameters", | ||
"status": "active", | ||
"kind": "operation", | ||
"description": "Allows for disabling or enabling of search parameters so that only the ones that are used are enabled in order to save space in the datastore. This operation is asynchronous as defined in the [FHIR Asynchronous Request Pattern](http://hl7.org/fhir/async.html)", | ||
"code": "status", | ||
"system": false, | ||
"type": true, | ||
"instance": false, | ||
"parameter": [ | ||
{ | ||
"name": "url", | ||
"use": "in", | ||
"min": 0, | ||
"max": "1", | ||
"documentation": "Url of the search parameter status to update.", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "status", | ||
"use": "out", | ||
"min": 0, | ||
"max": "1", | ||
"documentation": "Status to update search parameter to. Can be 'supported' or 'disabled'. Cannot update deleted search parameters with this operation.", | ||
"type": "string" | ||
} | ||
] | ||
} |
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
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
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
2 changes: 2 additions & 0 deletions
2
src/Microsoft.Health.Fhir.Core/Microsoft.Health.Fhir.Core.csproj
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
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
69 changes: 69 additions & 0 deletions
69
...Health.Fhir.Shared.Api.UnitTests/Features/Operations/OperationsCapabilityProviderTests.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,69 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
using System; | ||
using Microsoft.Extensions.Options; | ||
using Microsoft.Health.Fhir.Api.Configs; | ||
using Microsoft.Health.Fhir.Api.Features.Operations; | ||
using Microsoft.Health.Fhir.Core.Configs; | ||
using Microsoft.Health.Fhir.Core.Features.Conformance; | ||
using Microsoft.Health.Fhir.Core.Features.Conformance.Models; | ||
using Microsoft.Health.Fhir.Core.Features.Routing; | ||
using Microsoft.Health.Fhir.Tests.Common; | ||
using Microsoft.Health.Test.Utilities; | ||
using NSubstitute; | ||
using Xunit; | ||
|
||
namespace Microsoft.Health.Fhir.Api.UnitTests.Features.Operations | ||
{ | ||
/// <summary> | ||
/// shared conformance tests | ||
/// </summary> | ||
[Trait(Traits.OwningTeam, OwningTeam.Fhir)] | ||
[Trait(Traits.Category, Categories.Operations)] | ||
public partial class OperationsCapabilityProviderTests | ||
{ | ||
private IUrlResolver _urlResolver; | ||
private IOptions<OperationsConfiguration> _operationsOptions = Substitute.For<IOptions<OperationsConfiguration>>(); | ||
private IOptions<FeatureConfiguration> _featureOptions = Substitute.For<IOptions<FeatureConfiguration>>(); | ||
private IOptions<CoreFeatureConfiguration> _coreFeatureOptions = Substitute.For<IOptions<CoreFeatureConfiguration>>(); | ||
private OperationsConfiguration _operationsConfiguration = new OperationsConfiguration(); | ||
private CoreFeatureConfiguration _coreFeatureConfiguration = new CoreFeatureConfiguration(); | ||
private FeatureConfiguration _featureConfiguration = new FeatureConfiguration(); | ||
|
||
public OperationsCapabilityProviderTests() | ||
{ | ||
_urlResolver = Substitute.For<IUrlResolver>(); | ||
_urlResolver.ResolveMetadataUrl(Arg.Any<bool>()).Returns(new System.Uri("https://test.com")); | ||
_operationsOptions.Value.Returns(_operationsConfiguration); | ||
_featureOptions.Value.Returns(_featureConfiguration); | ||
_coreFeatureOptions.Value.Returns(_coreFeatureConfiguration); | ||
} | ||
|
||
[Fact] | ||
public void GivenAConformanceBuilder_WhenSupportsSelectableSearchParametersIsEnabled_ThenStatusOperationIsNotAdded() | ||
{ | ||
_coreFeatureConfiguration.SupportsSelectableSearchParameters = true; | ||
ListedCapabilityStatement listedCapabilityStatement = new ListedCapabilityStatement(); | ||
OperationsCapabilityProvider provider = new OperationsCapabilityProvider(_operationsOptions, _featureOptions, _coreFeatureOptions, _urlResolver); | ||
ICapabilityStatementBuilder builder = Substitute.For<ICapabilityStatementBuilder>(); | ||
provider.Build(builder); | ||
|
||
builder.Received(3).Apply(Arg.Any<Action<ListedCapabilityStatement>>()); | ||
} | ||
|
||
[Fact] | ||
public void GivenAConformanceBuilder_WhenSupportsSelectableSearchParametersIsDisabled_ThenStatusOperationIsNotAdded() | ||
{ | ||
_coreFeatureConfiguration.SupportsSelectableSearchParameters = false; | ||
ListedCapabilityStatement listedCapabilityStatement = new ListedCapabilityStatement(); | ||
OperationsCapabilityProvider provider = new OperationsCapabilityProvider(_operationsOptions, _featureOptions, _coreFeatureOptions, _urlResolver); | ||
ICapabilityStatementBuilder builder = Substitute.For<ICapabilityStatementBuilder>(); | ||
provider.Build(builder); | ||
|
||
builder.Received(2).Apply(Arg.Any<Action<ListedCapabilityStatement>>()); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low priority: You can replace the static string with nameof(SearchParameterStatusOperationDefinition).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add that as a fix in another PR.