inferno-framework / bulk-data-test-kit

Inferno Test Kit for servers implementing the Bulk Data Access Implementation Guide
Apache License 2.0
0 stars 0 forks source link

Incorrect CapabilityStatement? #31

Open alex-dzeda opened 2 months ago

alex-dzeda commented 2 months ago

Hi, I work on a bulk FHIR API, and after running the Inferno bulk test kit, we made a change to our CapabilityStatement as a result of a warning about the names of the Patient & Group export operations. After running another test suite, I compared the conflicting results, and believe that https://github.com/inferno-framework/bulk-data-test-kit/blob/04b43676bc96d9fb63df6ffde9a610fa422c5dbe/spec/fixtures/CapabilityStatement.json#L59 and https://github.com/inferno-framework/bulk-data-test-kit/blob/04b43676bc96d9fb63df6ffde9a610fa422c5dbe/spec/fixtures/CapabilityStatement.json#L68 Should be updated to patient-export and group-export respectively.

Based upon https://hl7.org/fhir/uv/bulkdata/CapabilityStatement-bulk-data.json, I see the operation names defined as patient-export and group-export, leading to this train of thought.

Thank you!

dehall commented 2 months ago

The FHIR spec says that the operation.name field here is supposed to be the actual operation name used in the url, in this case you call $export so the name should just be "export".

http://hl7.org/fhir/R4/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.operation.name

Element Id: CapabilityStatement.rest.resource.operation.name Definition: The name of the operation or query. For an operation, this is the name prefixed with $ and used in the URL.

But, that requirement is only a "should" because of the possibility of name conflicts. In the case of bulk data exports, the 3 operations are scoped differently (Patient resource, Group resource, and system-level) so it's safe to name them all "export".

As you saw though, it's only a warning not a failure if you name them eg patient-export and group-export:

Given flexibility in the FHIR specification for declaring constrained OperationDefinitions, this test only verifies that the server declares any operation within the Capability Statement's server operation list. It does not verify that it declares the standard system level export OperationDefinition provided in the Bulk Data specification, nor does it attempt to resolve any non-standard OperationDefinitions to verify if it is a constrained version of the standard OperationDefintion. This test will provide a warning if no operations are declared at /$export, via the CapabilityStatement.rest.operation.name element.