Skip to content

Commit

Permalink
Merge pull request #35 from inferno-framework/documentation-update
Browse files Browse the repository at this point in the history
FI-3435: Documentation for DTR Light EHR release
  • Loading branch information
elsaperelli authored Dec 6, 2024
2 parents 5dfceac + 30e1d4f commit 99bb499
Show file tree
Hide file tree
Showing 47 changed files with 840 additions and 367 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ the test home pages include instructions for trying out the tests, including
- For payer server testing: running the tests against the DTR SMART App tests in this Test Kit
- For DTR SMART App testing: a [sample postman collection](config/DTR%20SMART%20App%20Tests%20Postman%20Demo.postman_collection.json)
- For DTR Full EHR testing: [sample postman collection](config/DTR%20Full%20EHR%20Tests%20Postman%20Demo.postman_collection.json)
- For DTR Light EHR testing: running the tests against the Inferno Reference Server using [this preset](config/presets/light_ehr_ref_server_prod.json), or a local instance of the Inferno Reference Server using [this preset](config/presets/light_ehr_ref_server_local.json)

Detailed instructions can be found in the suite descriptions when the tests
are run or within this repository for the
Expand All @@ -80,7 +81,7 @@ You can run the DTR test kit via the [ONC Inferno](https://inferno.healthit.gov/
- In the terminal, run `run.sh`.
- Use a web browser to navigate to `http://localhost`.

## FHIR Server Simulation for the DTR SMART App Suite
## FHIR Server Simulation for the DTR SMART App Suite and DTR Light EHR Suite Demonstration

The DTR SMART App test suite needs to be able to return responses to FHIR read and search APIs.
These responses can be complex and so the suite relies on a full FHIR server to provide
Expand All @@ -90,10 +91,12 @@ with the [Inferno Reference Server](https://github.com/inferno-framework/inferno
- loaded with [patient pat015](https://github.com/inferno-framework/inferno-reference-server/blob/main/resources/dtr_bundle_patient_pat015.json)
- accepting bearer token `SAMPLE_TOKEN` for read access.

This same DTR-specific patient file in the Inferno Reference Server can be used to demonstrate the DTR Light EHR suite capabilities in the absence of a DTR Light EHR implementation.

### Simulation Server Configuration For Local Test Kit Execution

The test kit can be configured to point to either a local instance of the reference server or
to a public instance. The location of the The following are valid configuration approaches:
to a public instance. The location of the following are valid configuration approaches:

1. Point to a public instance of the Inferno reference server at either
`https://inferno.healthit.gov/reference-server/r4/` or
Expand Down Expand Up @@ -129,7 +132,7 @@ particularly the instructions on
To support testing that clients can fetch, populate, and complete various questionnaires with different features, the test kit includes a framework for building different iterations of these tests. At a high-level, the framework includes the ability to associate a set of fixtures with a group of tests including

- a questionnaire that will be sent back when the client makes a $questionnaire-package request
- a questionnaire response that contains expected pre-populated and overriden items. These are indicated by the origin.source extension on items with link ids corresponding to items in the questionnaire with cql expressions for pre-population. When it is `auto` that is the expected answer based on data Inferno has. When it is `override` that is the answer that would be present if the pre-populated answer were used, but Inferno will check that a different value is present since the tester will be expected to override the answer.
- a questionnaire response that contains expected pre-populated and overridden items. These are indicated by the origin.source extension on items with link ids corresponding to items in the questionnaire with cql expressions for pre-population. When it is `auto` that is the expected answer based on data Inferno has. When it is `override` that is the answer that would be present if the pre-populated answer were used, but Inferno will check that a different value is present since the tester will be expected to override the answer.

See logic in `mock_payer`, `dtr_questionnaire_response_validation`, and `fixture_loader`, among others.

Expand Down
110 changes: 0 additions & 110 deletions config/presets/inferno_dtr_server_suite.json

This file was deleted.

110 changes: 110 additions & 0 deletions config/presets/light_ehr_ref_server_local.json

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions config/presets/light_ehr_ref_server_prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"title": "Inferno Reference Server",
"id": "light_ehr_ref_server_prod",
"test_suite_id": "dtr_light_ehr",
"inputs": [
{
"name": "url",
"description": "URL of the FHIR endpoint used by SMART applications",
"title": "FHIR Endpoint",
"type": "text",
"value": "https://inferno.healthit.gov/reference-server/r4"
},
{
"name": "ehr_client_id",
"description": "Client ID provided during registration of Inferno as an EHR launch application",
"title": "EHR Launch Client ID",
"type": "text",
"value": "SAMPLE_PUBLIC_CLIENT_ID"
},
{
"name": "standalone_client_id",
"type": "text",
"value": "SAMPLE_PUBLIC_CLIENT_ID"
},
{
"name": "smart_credentials",
"type": "oauth_credentials",
"title": "OAuth Credentials",
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "credentials",
"type": "oauth_credentials",
"title": "OAuth Credentials",
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "patient_ids",
"type": "text",
"value": "pat015"
},
{
"name": "coverage_ids",
"type": "text",
"value": "cov015"
},
{
"name": "communication_request_ids",
"type": "text",
"value": "comreq015"
},
{
"name": "device_request_ids",
"type": "text",
"value": "devreqe0470"
},
{
"name": "encounter_ids",
"type": "text",
"value": "pat015-rad-encounter"
},
{
"name": "medication_request_ids",
"type": "text",
"value": "medreq015"
},
{
"name": "nutrition_order_ids",
"type": "text",
"value": "nutord015"
},
{
"name": "service_request_ids",
"type": "text",
"value": "servreq-g0180-1"
},
{
"name": "task_ids",
"type": "text",
"value": "tas015"
},
{
"name": "vision_prescription_ids",
"type": "text",
"value": "vispre0151,vispre0152"
}
]
}
1 change: 1 addition & 0 deletions lib/davinci_dtr_test_kit/create_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module DaVinciDTRTestKit
module CreateTest
def perform_create_test(create_resources, resource_type)
skip_if(create_resources.blank?, "No `#{resource_type}` resources to create provided, skipping test.")
assert_valid_json(create_resources)
create_resources_list = JSON.parse(create_resources)
skip_if(!create_resources_list.is_a?(Array), 'Resources to create not inputted in list format, skipping test.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ requirements and may change the test validation logic.
## Test Methodology

Inferno will simulate a DTR payer server that will response to
requests for questionnaires for the EHR under test to interact with.
requests for questionnaires for the EHR under test to interact with.
The EHR will be expected to initiate requests to Inferno to elicit responses. Over the
course of these interactions, Inferno will seek to observe conformant handling of
course of these interactions, Inferno will seek to observe conformant handling of
DTR workflows and requirements around the retrieval, completion, and storage of
questionnaires.

Tests within this suite are associated with specific questionnaires that the EHR will
demonstrate completion of. In each case, the EHR under test will initiate a request to
the payer server simulated by Inferno for a questionnaire using the
the payer server simulated by Inferno for a questionnaire using the
`$questionnaire-package` operation. Inferno will always return the specific questionnaire
for the test being executed regardless of the input provided by the EHR, though it must
be conformant. The EHR will then be asked to complete the questionnaire, including

- Pre-populating answers based on directives in the questionnaire
- Rendering the questionnaire for users and allowing them to make additional updates.
These tests can include specific directions on details to include in the completed
Expand All @@ -34,11 +35,12 @@ be conformant. The EHR will then be asked to complete the questionnaire, includi
EHRs will be required to complete all questionnaires in the suite, which in aggregate
contain all questionnaire features that apps must support. Currently, the suite includes
one questionnaire:
1. A fictious "dinner" questionnaire created for these tests. It tests basic

1. A fictitious "dinner" questionnaire created for these tests. It tests basic
item rendering and pre-population.
Additional questionnaires will be added in the future.
Additional questionnaires will be added in the future.

All requests sent by the app will be checked
All requests sent by the app will be checked
for conformance to the DTR IG requirements individually and used in aggregate to determine
whether required features and functionality are present. HL7® FHIR® resources are
validated with the Java validator using `tx.fhir.org` as the terminology server.
Expand All @@ -49,28 +51,28 @@ validated with the Java validator using `tx.fhir.org` as the terminology server.

In order to run these tests, EHRs must be configured to interact with Inferno's simulated
payer server endpoint. The endpoint will be `[URL prefix]/custom/dtr_full_ehr/fhir` where
`[URL prefix]` can be inferred from the URL of the test session which will be of the form
`[URL prefix]` can be inferred from the URL of the test session which will be of the form
`[URL prefix]/dtr_full_ehr/[session id]`.

In order for Inferno to associate requests sent to locations under these base URLs with this session,
it needs to know the bearer token that the EHR will send on requests, for which
it needs to know the bearer token that the EHR will send on requests, for which
there are two options.

1. If you want to choose your own bearer token, then
1. Select the "2. Basic Workflows" test from the list on the left (or other target test).
2. Click the '*Run All Tests*' button on the right.
3. In the "access_token" field, enter the bearer token that will be sent by the client
under test (as part of the Authorization header - `Bearer <provided value>`).
4. Click the '*Submit*' button at the bottom of the dialog.
1. Select the "2. Basic Workflows" test from the list on the left (or other target test).
2. Click the '_Run All Tests_' button on the right.
3. In the "access_token" field, enter the bearer token that will be sent by the client
under test (as part of the Authorization header - `Bearer <provided value>`).
4. Click the '_Submit_' button at the bottom of the dialog.
2. If you want to use a client_id to obtain an access token, then
1. Click the '*Run All Tests*' button on the right.
2. Provide the EHR's registered id "client_id" field of the input (NOTE, Inferno
doesn't support the registration API, so this must be obtained from another
system or configured manually).
3. Click the '*Submit*' button at the bottom of the dialog.
4. Make a token request that includes the specified client id to the
`[URL prefix]/custom/dtr_full_ehr/mock_auth/token` endpoint to get
an access token to use on the request of the requests.
1. Click the '_Run All Tests_' button on the right.
2. Provide the EHR's registered id "client_id" field of the input (NOTE, Inferno
doesn't support the registration API, so this must be obtained from another
system or configured manually).
3. Click the '_Submit_' button at the bottom of the dialog.
4. Make a token request that includes the specified client id to the
`[URL prefix]/custom/dtr_full_ehr/mock_auth/token` endpoint to get
an access token to use on the request of the requests.

In either case, the tests will continue from that point. Further executions of tests under
this session will also use the selected bearer token.
Expand All @@ -90,16 +92,16 @@ To run the tests using this approach:
1. Start a Da Vinci DTR Full EHR Test Suite Session.
1. Update the postman collection configuration variables found by opening the "DTR Full EHR
Tests Postman Demo" collection and selecting the "Variables" tab.
- **base_url**: corresponds to the where the test suite session is running. Defaults to
`inferno.healthit.gov`. If running in another location, see guidance on the "Overview" tab
of the postman collection.
- **base_url**: corresponds to the where the test suite session is running. Defaults to
`inferno.healthit.gov`. If running in another location, see guidance on the "Overview" tab
of the postman collection.
- **access_token**: note the "Current value" (update if desired) for use later.
1. Return to Inferno and in the test list at the left, select *2 Static Questionnaire Workflow*.
1. Return to Inferno and in the test list at the left, select _2 Static Questionnaire Workflow_.
1. Click the "Run All Tests" button in the upper right.
1. Add the **access_token** configured in postman to the Inferno input with the same name
1. Click the "Submit" button in Inferno.
1. Attest that the EHR has launched its DTR workflow in Inferno by clicking the link for the **true** response.
1. Once the next wait dialog has appeared within Inferno asking for a `$questionnaire-package`
1. Once the next wait dialog has appeared within Inferno asking for a `$questionnaire-package`
request, use postman to submit the "Questionnaire Package for Dinner (Static)" request. Confirm
that the response that looks similar to the "Example Working Response" in postman
and click the link to continue the tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ requirements and may change the test validation logic.

## Test Methodology

Inferno will simulate a DTR SMART App that will connect to the DTR Light EHR system under test. The tester will need to launch Inferno using either an EHR launch or a Standalone launch.

Once the connection between the DTR SMART App and the DTR Light EHR is established, tests within this suite check that the DTR Light EHR API is conformant to US Core and any other requirements outlined in the [Light DTR EHR Capability Statement](https://hl7.org/fhir/us/davinci-dtr/STU2/CapabilityStatement-light-dtr-ehr.html#root).
Inferno will simulate a DTR SMART App that will connect to the DTR Light EHR system under test. The tester will need to launch Inferno using either an EHR launch or a Standalone launch. Once the connection between Inferno's simulated DTR SMART App and the DTR Light EHR under test is established, tests within this suite will make FHIR API requests corresponding to capabilities required by the [Light DTR EHR Capability Statement](https://hl7.org/fhir/us/davinci-dtr/STU2/CapabilityStatement-light-dtr-ehr) and check that the EHR's responses are conformant.

## Running the Tests

If you would like to try out the tests but don't have a DTR payer server implementation, you can run these tests against the [public instance of the Inferno Reference Server](https://inferno.healthit.gov/reference-server/r4/) by using the Inferno Reference Server preset in the test suite.

In order to get the Inferno QA Reference Server to do an EHR launch, navigate to https://inferno.healthit.gov/reference-server/app/app-launch and use https://inferno.healthit.gov/custom/smart/launch as the App Launch URL.
If you would like to try out the tests but don't have a DTR Light EHR implementation, you can run these tests against the [public instance of the Inferno Reference Server](https://inferno.healthit.gov/reference-server/r4/) by using the Inferno Reference Server preset in the test suite. In order to get the Inferno Reference Server to do an EHR launch, navigate to https://inferno.healthit.gov/reference-server/app/app-launch and use https://inferno.healthit.gov/suites/custom/smart/launch as the App Launch URL. When using the Inferno Reference Server preset for the DTR Light EHR test suite, note that the sample patient used for testing (`dtr_bundle_patient_pat015.json`) is focused on DTR-specific data and does not have the complete set of US Core data needed to pass all the US Core tests. In addition, this preset does not test the `create` or `update` tests for DTR QuestionnaireResponse resources and PAS Task resources.

## Limitations

The DTR IG is a complex specification and these tests currently validate conformance to only
a subset of IG requirements. Future versions of the test suite will test further
features.

## DTR 2.0.1 Corrections

The DTR 2.0.1 version of the [Light EHR CapabilityStatement](http://hl7.org/fhir/us/davinci-dtr/CapabilityStatement/light-dtr-ehr) includes two pieces of missing or misleading information that have been corrected:

- The 2.0.1 CapabilityStatement indicates that support for the [Coverage resource type](https://hl7.org/fhir/us/davinci-dtr/STU2/CapabilityStatement-light-dtr-ehr.html#coverage) is required when the [QuestionnaireResponse resource type was intended](https://build.fhir.org/ig/HL7/davinci-dtr/CapabilityStatement-light-dtr-ehr-311.html#questionnaireresponse) (note specifically that the `context` search parameters are not present on the Coverage resource type but is on the QuestionnaireResponse resource type).
- The 2.0.1 CapabilityStatement does not indicate a target profile for the [Task resource type](https://hl7.org/fhir/us/davinci-dtr/STU2/CapabilityStatement-light-dtr-ehr.html#task) but the current version [clarifies](https://build.fhir.org/ig/HL7/davinci-dtr/CapabilityStatement-light-dtr-ehr-311.html#task) that the [PAS Task Profile](http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-task) is intended.

This test suite verifies systems according to these corrections. Additionally, it verifies the `read` interaction for the Coverage resource type.
Loading

0 comments on commit 99bb499

Please sign in to comment.