Skip to content

Commit

Permalink
update docs to account for new adaptive tests (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnaden authored Dec 6, 2024
1 parent 8eb6c2a commit 23b2273
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DTRFullEHRAdaptiveQuestionnaireRequestTest < Inferno::Test
wait(
identifier: access_token,
message: %(
### Questionnaire Retrieval
### Adaptive Questionnaire Retrieval
1. **Questionnaire Package Request**:
- Invoke the `$questionnaire-package` operation by sending a POST request to the following
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def example_client_jwt_payload_part
#{inferno_prompt_cont if smart_app_launch == 'ehr'}
### Questionnaire Retrieval
### Adaptive Questionnaire Retrieval
1. **Questionnaire Package Request**:
- Inferno will expect the SMART App to invoke the DTR Questionnaire Package operation by sending a POST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,26 @@ Tests within this suite are associated with specific questionnaires that the EHR
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
`$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
for the test being executed regardless of the input provided by the EHR, though Inferno will
check that the input is conformant. The EHR will then be asked to complete the questionnaire,
including:

- Pre-populating answers based on directives in the questionnaire
- 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
questionnaire.
- For adaptive questionnaires only, getting additional questions using the `$next-question`
operation until the questionnaire is complete.
- Storing the completed questionnaire for future use as a FHIR QuestionnaireResponse.

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 fictitious "dinner" questionnaire created for these tests. It tests basic
item rendering and pre-population.
Additional questionnaires will be added in the future.
1. Standard and adaptive styles of a fictitious "dinner" questionnaire created for these tests.
They test basic item rendering, control flow, and pre-population.

Additional questionnaires covering further features will be added in the future.

All requests sent by the app will be checked
for conformance to the DTR IG requirements individually and used in aggregate to determine
Expand Down Expand Up @@ -87,16 +91,25 @@ to make requests against Inferno. This does not include the capability to render
questionnaires, but does have samples of correctly and incorrectly completed QuestionnaireResponses.
To run the tests using this approach:

#### Setup
1. Install [postman](https://www.postman.com/downloads/).
1. Import [this Postman collection](https://github.com/inferno-framework/davinci-dtr-test-kit/blob/main/config/DTR%20Full%20EHR%20Tests%20Postman%20Demo.postman_collection.json).

#### Startup
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.
- **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_.

#### Dinner Questionnaire (Standard)

For the standard (static) questionnaire demo, use the requests in the _Static Dinner_ folder in the
Postman collection.

1. Return to the Inferno test session 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.
Expand All @@ -109,21 +122,64 @@ To run the tests using this approach:
with an actual EHR implementation. To see what a valid QuestionnaireResponse looks like, see
the "Sample QuestionnaireResponse for Dinner (Static) ..." request in postman.

#### Dinner Questionnaire (Adaptive)

For the adaptive questionnaire demo, use the requests in the _Adaptive Dinner_ folder in the
Postman collection.

1. Return to the Inferno test session and in the test list at the left, select _3 Adaptive 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 (if not already present)
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 **Adaptive Questionnaire Retrieval** wait dialog has appeared within Inferno asking
for `$questionnaire-package` and `$next-question`
requests, use postman to submit the "Questionnaire Package for Dinner" request followed by the
"Initial Next Question" request. Confirm
that the response that looks similar to the "Example Response" in postman
and click the link to continue the tests.
1. Attest to the next several attestation wait dialogs as desired to get a sense for what is involved
in testing with an actual EHR implementation.
1. Once the **Follow-up Next Question Request** wait dialog has appeared within Inferno asking for
another `$next-question` request, use postman to submit the "Second Next Question" request. Confirm
that the response that looks similar to the "Example Response" in postman
and click the link to continue the tests.
1. Once the **Last Next Question Request** wait dialog has appeared within Inferno asking for
another `$next-question` request, use postman to submit the "Final Next Question" request. Confirm
that the response that looks similar to the "Example Response" in postman
and click the link to continue the tests.

## 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. A few specific features of interest are listed below.

### Heavy Reliance on Attestations
### Questionnaire Response Verification

Currently, these test kits do not have enough information about the data stored on
the EHR to evaluate whether CQL evaluation populated data correctly. However, Inferno
does ask testers to make sure that the target patient meets certain requirements and
directs them to perform certain actions while filling out forms that allow Inferno to
check that calculation is occuring and that the system is correctly keeping track of
items that were pre-populated. This approach may change in future versions of these tests.

### Questionnaire Response Access

For standard (static) questionnaires, Full EHRs are not required by the DTR specification
to store or expose the completed form as a FHIR QuestionnaireResponse instance, though they
are required to store the form in some way and be able to send the QuestionnaireResponse
representation to other systems. Currently, testers are required to provide a
QuestionnaireResponse as an input to the tests once they have completed their workflow.
Future versions of these tests will provide additional options for making that information
available that are more in-line with expected system capabilities.

Currently, these test kits do not have access to the QuestionnaireResponse and so validation
that the EHR performed CQL calculations and generated a conformant QuestionnaireResponse
based on pre-population and manual answers is left to a user attestation rather than a
mechanical check. Some level of mechanical checks are expected to be added in the future.
For adaptive questionnaires, the completed QuestionnaireResponse will be present in the
last `$next-question` invocation by the EHR, so this limitation does not apply to those
cases.

### Questionnaire Feature Coverage

Not all questionnaire features that are must support within the DTR IG are currently represented
in questionnaires tested by the IG. Adaptive questionnaires are a notable omission.
Additional questionnaires testing additional features will be added in the future.
in questionnaires tested by the IG. Additional questionnaires testing additional features will
be added in the future.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ questionnaires from your server, see the _Sample Execution_ section below.

Otherwise, the requests for Inferno to make can be provided in one of two ways:

1. Statically within the Inferno inputs: provide the json request bodies when running
1. **Statically within the Inferno inputs**: provide the json request bodies when running
the tests. This approach works very well for testing standard (static) questionnaires
where there is only one request for Inferno to make (input = _Initial Static Questionnaire Request_). It is less ideal for adaptive
questionnaires as a sequence of `$next-question` requests (inputs = _Initial Adaptive Questionnaire Request_ and _Next Question Requests_) is required, which is provided as a json list of
request body objects.
2. Dynamically during test execution: use a tester-controlled client to provide requests to
2. **Dynamically during test execution**: use a tester-controlled client to provide requests to
Inferno while the tests are running. At points that Inferno needs to make a request, execution
will pause while the request is provided from the client. Inferno uses a bearer token
provided in the test inputs (input = _Access Token_ for the DTR Client Flow (not the
Expand Down Expand Up @@ -97,8 +97,7 @@ using the following steps:
against the client test session, which will respond with a static questionnaire that the
these server tests can validate.

At this time, only the standard questionnaire functionality can be tested using this approach as
the client tests have not implemented an adaptive questionnaire set of tests.
At this time, only the standard questionnaire functionality can be tested using this approach.

## Additional Configuration Details

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ be conformant. The app will then be asked to complete the questionnaire, includi
- 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
questionnaire.
- For adaptive questionnaires only, getting additional questions using the `$next-question`
operation until the questionnaire is complete.
- Storing the completed questionnaire back to the light EHR simulated by Inferno. Inferno
will validate the stored questionnaire, including pre-populated values (Inferno knows
the pre-population logic and the data used in calculation) and other conformance details.
Expand All @@ -39,11 +41,12 @@ Apps will be required to complete all questionnaires in the suite, which in aggr
contain all questionnaire features that apps must support. Currently, the suite includes
two questionnaires:

1. A fictitious "dinner" questionnaire created for these tests. It tests basic
item rendering and pre-population.
2. A Respiratory Assist Device questionnaire pulled from the DTR reference implementation.
1. Standard and adaptive styles of a fictitious "dinner" questionnaire created for these tests.
They test basic item rendering, control flow, and pre-population.
1. A Respiratory Assist Device questionnaire pulled from the DTR reference implementation.
It tests additional features and represents a more realistic questionnaire.
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
for conformance to the DTR IG requirements individually and used in aggregate to determine
Expand Down Expand Up @@ -118,6 +121,11 @@ The following is a list of tests with the Postman requests that can be used with
- **1.1** _Static Questionnaire Workflow_: use requests in the `Static Dinner` folder
- **1.1.1.01** _Invoke the DTR Questionnaire Package operation_: submit request `Questionnaire Package for Dinner (Static)` while this test is waiting.
- **1.1.3.01** _Save the QuestionnaireResponse after completing it_: submit request `Save QuestionnaireResponse for Dinner (Static)` while this test is waiting. If you want to see a failure, submit request `Save QuestionnaireResponse for Dinner (Static) - missing origin extension` instead.
- **1.2** _Adaptive Questionnaire Workflow_: use requests in the `Adaptive Dinner` folder
- **1.2.1.1.01** _Invoke the Questionnaire Package and Initial Next Question Operation_: submit requests `Questionnaire Package for Dinner` and then `Initial Next Question` while this test is waiting.
- **1.2.2.1.01** _Invoke the $next-question operation_: submit request `Second Next Question` while this test is waiting.
- **1.2.3.1.01** _Invoke the $next-question operation_: submit request `Final Next Question` while this test is waiting.
- **1.2.4.01** _Save the QuestionnaireResponse after completing it_: submit request `Save QuestionnaireResponse` while this test is waiting.
- **2.1** _Respiratory Assist Device Questionnaire Workflow_: use requests in the `Respiratory Assist Device` folder
- **2.1.1.01** _Invoke the DTR Questionnaire Package operation_: submit request `Questionnaire Package for Resp Assist Device` while this test is waiting.
- **2.1.3.01** _Save the QuestionnaireResponse after completing it_: submit request `Save Questionnaire Response for Resp Assist Device` while this test is waiting. If you want to see a failure, submit request `Save Questionnaire Response for Resp Assist Device - unexpected override` instead.
Expand Down Expand Up @@ -186,5 +194,5 @@ to retrieve questionnaires.
### Questionnaire Feature Coverage

Not all questionnaire features that are must support within the DTR IG are currently represented
in questionnaires tested by the IG. Adaptive questionnaires are a notable omission.
Additional questionnaires testing additional features will be added in the future.
in questionnaires tested by the IG. Additional questionnaires testing additional features will
be added in the future.

0 comments on commit 23b2273

Please sign in to comment.