onc-healthit / onc-certification-g10-test-kit

ONC Certification (g)(10) Standardized API Tests
Apache License 2.0
34 stars 12 forks source link

(g)(10) 4.5.01 Could not find active values from status #148

Closed skaranfilovski closed 2 years ago

skaranfilovski commented 2 years ago

Hello,

The ONC Certification (g)(10) Standardized API Inferno CareTeam test 4.5.01 is throwing the following error "Could not find active values from status in any of the resources returned for Patient/c27e5be0-4b44-4ec5-a284-4308d6ac2b1a" even though all requests within the test group are passing and the response has the status=active when the filter is set to active (we only support active careteams in our system).

image

Response JSON:

{ "resourceType": "Bundle", "type": "searchset", "total": 1, "link": [ { "relation": "self", "url": "https://nxpartnerapi-dev.azurewebsites.net/api/r4/CareTeam?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=active" }, { "relation": "previous", "url": "https://nxpartnerapi-dev.azurewebsites.net/api/r4/CareTeam?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=active&_getpagesoffset=0&_count=10" }, { "relation": "next", "url": "https://nxpartnerapi-dev.azurewebsites.net/api/r4/CareTeam?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=active&_getpagesoffset=0&_count=10" }, { "relation": "first", "url": "https://nxpartnerapi-dev.azurewebsites.net/api/r4/CareTeam?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=active&_getpagesoffset=0&_count=10" }, { "relation": "last", "url": "https://nxpartnerapi-dev.azurewebsites.net/api/r4/CareTeam?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=active&_getpagesoffset=0&_count=10" } ], "entry": [ { "resource": { "resourceType": "CareTeam", "id": "3", "status": "active", "subject": { "reference": "Patient/c27e5be0-4b44-4ec5-a284-4308d6ac2b1a", "display": "Newman, Alice Jones" }, "participant": [ { "role": [ { "coding": [ { "system": "http://nucc.org/provider-taxonomy", "code": "2086S0122X" } ] } ], "member": { "reference": "Practitioner/5", "display": "Davis, Albert" } }, { "role": [ { "coding": [ { "system": "http://hl7.org/fhir/StructureDefinition/data-absent-reason", "code": "unknown" } ] } ], "member": { "reference": "Practitioner/77", "display": "Davis, Tracy" } }, { "role": [ { "coding": [ { "system": "http://snomed.info/sct", "code": "116154003" } ] } ], "member": { "reference": "Patient/c27e5be0-4b44-4ec5-a284-4308d6ac2b1a", "display": "Newman, Alice Jones" } } ] } } ] }

We are struggling to understand what is the meaning of the error message so any help would be appreciated.

Thank you.

yunwwang commented 2 years ago

@skaranfilovski Thank you for reporting this issue. Can you send me the session id or the url of your testing session? Thank you.

skaranfilovski commented 2 years ago

@yunwwang Here is the url of my testing session https://inferno.healthit.gov/suites/test_sessions/7bb288f6-5373-4030-bbe2-c3b6fff66be1#g10_certification-g10_single_patient_api.

yunwwang commented 2 years ago

@skaranfilovski Thanks.

In 4.5.01, Inferno runs multiple tests. First, it runs test for each single status value, such as

GET ...?patient=123&status=active GET ...?patient=123&status=proposed ...

Then it runs a "composite-or" search query, which concat all the status values together

GET ..?patient=123&status=proposed,active,suspended,inactive,entered-in-error

The composite-or support is required by US Core CareTeam profile:

SHALL support searching using the combination of the [patient](http://hl7.org/fhir/us/core/STU3.1.1/SearchParameter-us-core-careteam-patient.html) and [status](http://hl7.org/fhir/us/core/STU3.1.1/SearchParameter-us-core-careteam-status.html) search parameters:
including support for composite OR search on status (e.g.status={system|}[code],{system|}[code],...)

When I inspect search queries, I observed that the Bundle result for composite-or search query: ...?patient=c27e5be0-4b44-4ec5-a284-4308d6ac2b1a&status=proposed,active,suspended,inactive,entered-in-error has the 0 result and same url for self, previous, next, first and last.

image

That is the reason Inferno fails this test because it expect the Bundle for composite-or search test returns some CareTeam resources matching the status from single status search results.

skaranfilovski commented 2 years ago

Thanks @yunwwang, once we solved the handling of multiple statuses the 4.5.01 test is passing.