Skip to content

Commit

Permalink
Update fine grained scope test description.
Browse files Browse the repository at this point in the history
  • Loading branch information
arscan committed Aug 13, 2024
1 parent 217c459 commit 6c69524
Showing 1 changed file with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ class SmartFineGrainedScopesGroup < USCoreTestKit::USCoreV610::SmartGranularScop
short_title 'SMART Launch with Fine-Grained Scopes'

input_instructions %(
Register Inferno as a standalone application using the following information:
If necessary, register Inferno as a standalone application using the following information:
* Redirect URI: `#{SMARTAppLaunch::AppRedirectTest.config.options[:redirect_uri]}`
Each group requires a separate set of granular scopes to be granted:
Inferno may be registered multiple times with different `client_ids`, or this
may reuse a single registration of Inferno.`
This test will perform two launches, with each launch requiring a separate
separate set of finer-grained scopes to be granted:
Group 1:
* `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis`
Expand All @@ -24,9 +28,20 @@ class SmartFineGrainedScopesGroup < USCoreTestKit::USCoreV610::SmartGranularScop
)

description <<~DESCRIPTION
This scenario verifies that the system under test supports:
> SMART v2 scope syntax for patient-level and user-level scopes to support
As finalized in the [HTI-1 Final Rule](https://www.federalregister.gov/d/2023-28857/p-1250), Health IT Modules are
required to support SMART App Launch v2.0.0 "Finer-grained resource
constraints using search parameters" for the "category" parameter for the
Condition resource with Condition sub-resources Encounter Diagnosis, Problem
List, and Health Concern, and the Observation resource with Observation
sub-resources Clinical Test, Laboratory, Social History, SDOH, Survey, and
Vital Signs.
This is also reflected in the (g)(10) Standardized API for patient and
populations [Test
Procedure](https://www.healthit.gov/test-method/standardized-api-patient-and-population-services#test_procedure):
> [AUT-PAT-28] SMART v2 scope syntax for patient-level and user-level scopes to support
the “permission-v2” “SMART on FHIR® Capability”, including support for
finer-grained resource constraints using search parameters according to
section 3.0.2.3 of the implementation specification at § 170.215(c)(2) for
Expand All @@ -36,15 +51,19 @@ class SmartFineGrainedScopesGroup < USCoreTestKit::USCoreV610::SmartGranularScop
sub-resources Clinical Test, Laboratory, Social History, SDOH, Survey, and
Vital Signs
Prior to running these tests, first run the Single Patient API tests using
resource-level scopes. This group contains two sets of granular scope
tests, each of which includes a SMART Standalone Launch followed by FHIR
API tests. The app launches require that a particular subset of the
required granular scopes be granted. The FHIR API tests then repeat all of
the queries from the original Single Patient API tests that were run using
resource-level scopes, and verify that only resources matching the current
granular scopes are returned. Each group requires a separate set of
granular scopes to be granted:
Prior to running this scenario, first run the Single Patient API tests using
resource-level scopes, as this scenario uses content saved from that scenario
as a baseline for comparison when finer-grained scopes are granted.
This scenario contains two groups of finer-grained scope tests, each of
which includes a SMART Standalone Launch that requests a subset of
finer-grained scopes, followed by FHIR API requests to verify that scopes
are appropriately granted. The app launches require that the subset of the
requested finer-grained scopes are granted by the user. The FHIR API tests then repeat all
of the queries from the original Single Patient API tests that were run
using resource-level scopes, and verify that only resources matching the
current finer-grained scopes are returned. Each group requires a separate
set of finer-grained scopes to be granted:
Group 1:
* `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis`
Expand All @@ -58,8 +77,15 @@ class SmartFineGrainedScopesGroup < USCoreTestKit::USCoreV610::SmartGranularScop
* `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey`
* `Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh`
[Finer-grained resource constraints using search
parameters](https://hl7.org/fhir/smart-app-launch/STU2/scopes-and-launch-context.html#finer-grained-resource-constraints-using-search-parameters)
Note that Inferno will only request the finer grained scopes in each case,
but the system under test can display more scopes to the tester during
authorization. In this case, it is expected that the tester will only
approve the appropriate scopes in each group as described above.
For more information, please refer to [finer-grained resource constraints
using search
parameters](https://hl7.org/fhir/smart-app-launch/STU2/scopes-and-launch-context.html#finer-grained-resource-constraints-using-search-parameters).
DESCRIPTION

id :g10_smart_fine_grained_scopes
Expand All @@ -68,7 +94,7 @@ class SmartFineGrainedScopesGroup < USCoreTestKit::USCoreV610::SmartGranularScop

children.each(&:run_as_group)

# Replace generic granular scope auth group with which allows standalone or
# Replace generic finer-grained scope auth group with which allows standalone or
# ehr launch with just the standalone launch group
granular_scopes_group1 = children.first
granular_scopes_group1.children[0] = granular_scopes_group1.children.first.children.first
Expand Down

0 comments on commit 6c69524

Please sign in to comment.