-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add USCore 3.1.1 test group, CRD profile tests #26
base: main
Are you sure you want to change the base?
Conversation
Well, this is interesting. I agree there is no context search parameter on the Coverage resource, not in base FHIR R4 or defined in DTR or CRD. Looking at the current build version of DTR, it looks like the Coverage resource was a mistake and that QuestionnaireResponse was intended. Some of the text in the published version suggests that as well, e.g. "This requires the server to provide access to the specified resources to allow such an app to retrieve and edit QuestionnaireResponses and related resources." and "context (reference): Allows retrieving QuestionnaireResponse for a context" and the context search parameter is defined in the published IG on QuestionnaireResponse. I think this is probably enough for us to switch from Coverage to QuestionnaireResponse and so I think that is what we should do, but will get some leadership opinions before confirming. |
lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_validation.rb
Outdated
Show resolved
Hide resolved
lib/davinci_dtr_test_kit/profiles/questionnaire_response/metadata.yml
Outdated
Show resolved
Hide resolved
lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb
Outdated
Show resolved
Hide resolved
lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb
Outdated
Show resolved
Hide resolved
resource_ids.each do |id| | ||
fhir_read resource_type, id | ||
|
||
assert_response_status(200) |
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.
There are a few other checks that the us core version of the read test performs around making sure that the read id and resource type is what gets returned - see rows 37 and 38. I think those should be added here.
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.
a good example of simplified version of us core read test that steve wrote is this crd test.
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.
let's also try to create a unit test for this one following the idea in this thread. Here's how you stub out responses from the system under test.
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.
a few details to clean-up, but looking good
to address the ci Ruby / test failure, upgrade to us core test kit version 0.9.0 per steve. |
755f922
to
33b3ab5
Compare
end | ||
|
||
run do | ||
perform_request_validation_test(nutrition_order_resources, resource_type, |
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.
looks like this method adds errors to the message set, but doesn't cause the inferno test to fail, so we need to do that step after it. Will be similar to this code, but should be a failure, not a skip.
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'd like to create a separate method for this and then create a unit test for it. The idea is that you can create an anonymous class with a run method and any associated details, and then run it. See this Subscriptions PR for some other infrastructure I'm trying to setup around unit testing and get feedback on that may be helpful. Note that you'll need to stub out calls to the validator as done here.
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.
lets add some unit tests which should help fix the one issue I see
Summary
This task adds US Core 3.1.1 tests to the Light DTR EHR Test Suite as well as tests for the Light DTR EHR REST Capabilities by Resource/Profile.
Originally, the goal of this task was to generate tests using the US Core generator with a capability statement that combined the US Core 3.1.1 capability statement and the Light DTR EHR Capability statement; however, the majority of the CRD Profiles are read only and the US Core generator read test generator relies on search tests in order to work. Therefore, the majority of the tests are handwritten, with the exception of the CRD Coverage patient and context search tests which were generated and brought over (along with the US Core generator infrastructure).
An additional thing to note is the use of the CDex Task profile in the Task validation test since there is seemingly no CRD Task profile.
Testing Guidance
/resources
directorydocker compose down
docker volume rm inferno-reference-server_fhir-pgdata
docker compose up --build
http://localhost:8080/reference-server/r4
pat001
:coverage-example1
communicationrequest-example1
devicerequest-example1
encounter-example1
medicationrequest-example1
nutritionorder-example1
servicerequest-example1
cdex-task-example19
visionprescription-example
,visionprescription-example2
Questions
context
capability. I am not sure how to properly test that since it looks like the example CRD Coverage does not have acontext
field, nor does there seem to be one in the profile Snapshot table.dtr_bundle_patient_pat001.json