inferno-framework / us-core-test-kit

Inferno Test Kit for evaluating API conformance to the US Core Implementation Guide
Apache License 2.0
7 stars 5 forks source link

A bug related to the 2.1.03 - The server is using FHIR R4 #182

Open projkov opened 2 months ago

projkov commented 2 months ago

There is incorrect behavior for test 2.1.03 - The server is using FHIR R4. It appears this test can be passed with any URL because the issue lies in the fhir_client.

Here is an example of the report: Inferno QA Report. I used google.com as a server to check, and please look at the result for test 2.1.03. As you can see, this test passed.

This test uses the method fhir_client.detect_version: https://github.com/inferno-framework/us-core-test-kit/blob/7441d56a02368adac0d64fcdee50d6904d2dc6b5/lib/us_core_test_kit/custom_groups/capability_statement/fhir_version_test.rb#L11

But let's examine how this method is implemented: https://github.com/fhir-crucible/fhir_client/blob/b1fff3131ed293eaec1b92885c23645963d9d0a9/lib/fhir_client/client.rb#L94

It seems this method will return R4 when the CapabilityStatement resource is exactly R4 and also when the CapabilityStatement does not exist.

For this particular test, I suggest adding the following extra actions:

  1. Request the capability statement.
  2. Check the response code.
  3. Verify that it is definitely of the CapabilityStatement type.
dehall commented 2 months ago

Yes that definitely looks like a bug. Thanks for reporting this, we've put it on our list to address