NCIOCPL / clinical-trials-listing-api

API for Clinical Trial (Dynamic) Listing Pages
2 stars 2 forks source link

On the /get endpoint, a group of c-code parameters where any does not return a ListingInformation should return a 404 #34

Closed sarinapadilla closed 3 years ago

sarinapadilla commented 3 years ago

Issue description

Currently, if you query the get endpoint with params ccode=chicken and ccode=C1234, then you get back the listing for C1234. The API should return a 404 if any of the codes in the given query param list does not find a match.

ESTIMATE TBD

Steps to reproduce the issue

  1. https://webapis-dev.cancer.gov/triallistingsupport/v1/listing-information/get?ccode=chicken&ccode=C1234
  2. See that the ListingInformation for C1234 is returned instead of a 404

What's the expected result?

What's the actual result?

Additional details / screenshot

Related Tickets

blairlearn commented 3 years ago

As of Elasticsearch v5.6.x, the terms query returns any records where the list of values intersects with the requested values (versus only finding records where they are a subset or full match). It is therefore necessary to add logic to the service to emulate the desired behavior.