Skip to content
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 compartment variants to generated swagger / openapi #1846

Closed
lmsurpre opened this issue Jan 5, 2021 · 1 comment
Closed

Add compartment variants to generated swagger / openapi #1846

lmsurpre opened this issue Jan 5, 2021 · 1 comment
Assignees
Labels
cms-interop This issue is associated with the CMS interoperability rule openapi

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Jan 5, 2021

Is your feature request related to a problem? Please describe.
The IBM FHIR Server supports accessing data via compartment search as defined at https://www.hl7.org/fhir/http.html#vsearch

However, these variants are not listed in our generated swagger / openapi definitions

Describe the solution you'd like
Generated swagger / openapi definition should include these endpoints.

In the case that users have filtered the resource types to include, include only the passed resource types in the compartment.
In the case of the one-definition-per-resource-type case, I think we should generate 1 definition per compartment.
For example, patient-swagger.json would only have the current Patient-scoped operations (e.g. GET Patient/[id]) and we'd have a separate definition like patient-compartment-swagger.json which would have the compartment operations like GET Patient/[id]/Observation

Describe alternatives you've considered
Instead of 1 definition per compartment, we could list the compartment apis underneath the generated api definition for the compartment resources. For example, the patient-swagger.json would have both GET Patient/[id] and GET Patient/[id]/Observation.

Additional context
Add any other context or screenshots about the feature request here.

Suggestion for how to perform QA

  1. For swagger: Go to https://editor.swagger.io/ and copy/paste generated swagger and verify it looks correct.
  2. For openapi: Start up fhir-openapi server, (e.g. https://localhost:9443/openapi/ui/) and verify it looks correct.
@lmsurpre lmsurpre added the cms-interop This issue is associated with the CMS interoperability rule label Jan 22, 2021
@tbieste tbieste self-assigned this Mar 31, 2021
tbieste added a commit that referenced this issue Mar 31, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Mar 31, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Apr 1, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Apr 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
lmsurpre added a commit that referenced this issue Apr 5, 2021
Issue #1846 - Add compartment variants to generated swagger/openapi
@lmsurpre
Copy link
Member Author

lmsurpre commented Apr 9, 2021

I loaded the all-in-one-swagger that we publish with the server by navigating to https://localhost:9443/openapi/ui and I can see the compartment variants under the appropriate resources.

I discussed with @tbieste about whether it makes more sense to have all the compartment-related endpoints grouped under their compartment header, but we decided to keep it this way because otherwise those compartment sections are so long that its easy to get lost on the UI.

I also verified that, when a filter is passed, only the desired resource endpoints are added to the compartment definitions. Further, I confirmed that when all Patient compartment resources are filtered out, the tool skips generation of the Patient compartment swagger definition altogether.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cms-interop This issue is associated with the CMS interoperability rule openapi
Projects
None yet
Development

No branches or pull requests

2 participants