issues 3242 and 3265 - scope search-system and search-history for fhirVersion#3268
Conversation
This changeset adds a JAX-RS RequestFilter that sets a requestContext property, "com.ibm.fhir.server.fhirVersion" with the following order of precedence: 1. "4.3" from the acceptableMediaTypes 2. "4.0" from the acceptableMediaTypes 3. whatever is configured in the fhirServer/core/defaultFhirVersion config property 4. "4.0" Additionally, I updated the Capabilities resource to use the fhirVersion from the request context instead of processing the Accept header itself. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. introduce enums and utilities for working with resource type names
and fhirVersion values ('4.0' and '4.3')
2. use those to provide a better abstraction for working with the
fhir-server-config `fhirServer/resources` property group
(ResourcesConfigAdapter)
3. move fhirVersion MIME-type parameter processing into a new JAX-RS
RequestFilter FHIRVersionRequestFilter and update tests accordingly
4. update FHIRPersistenceUtil.parseSystemHistoryParameters to take into
account the requested fhirVersion and scope the HistoryContext
appropriately
5. update SearchUtil.parseQueryParameters to take into account the
requested fhirVersion and scope the SearchContext appropriately
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. add the FHIRVersionParam to the OperationContext 2. use that with a ResourcesConfigAdapter to get the list of applicable resource types in EverythingOperation.getDefaultIncludedResourceTypes Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
mostly javadoc updates and a couple minor refactorings Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Previously I was only looking in the Accept header. Now, for PUT and POST requests, I'll check the Content-Type header first. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
|
|
||
| assertTrue(historyContext.getResourceTypes().isEmpty(), historyContext.getResourceTypes().toString()); | ||
| } finally { | ||
| FHIRRequestContext.get().setTenantId(originalTenantId); |
There was a problem hiding this comment.
Do you think we should use remove (or at least clear the tenantId here...all tests should be forced to establish their own tenant in the context, so I don't think setting the originalTenantId should be necessary (unless there's a specific use case I'm not thinking of here.)
There was a problem hiding this comment.
yes. i'm not sure how important it is, but i think calling FHIRRequestContext.remove() after each test is probably a good pattern to help prevent us from more errors related to the thread-local
In the latest draft of R4B, these resource types have a new choice type for the subject field. This means that all R4 instances will still be valid in R4B, but not vice-versa. Instead of coding up special support where R4 clients can PUT/POST these resource instances, but not read them, we chose to treat them like backwards-compatible resources and document the incompatibility concern for R4 clients. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
punktilious
left a comment
There was a problem hiding this comment.
LGTM, just some minor comments
1. resolve TODO in Capabilities (replace getSupportedResourceTypes with ResourcesConfigAdapter) 2. fix stale javadoc for SearchUtil.useStoredCompartmentParam Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
|
the latest runs failed due to an unrelated issue in our CI that has already been fixed in main, so I'm gonna go ahead and merge this into |
and fhirVersion values ('4.0' and '4.3') in fhir-core (we had similar in fhir-model,
but those weren't available to fhir-config and the added complexity of the FHIR
model makes them a tad harder to work with)
fhir-server-config
fhirServer/resourcesproperty group(ResourcesConfigAdapter)
RequestFilter FHIRVersionRequestFilter and update the JAX-RS resources and
tests accordingly
account the requested fhirVersion and scope the HistoryContext
appropriately
requested fhirVersion and scope the SearchContext appropriately
resource types in EverythingOperation.getDefaultIncludedResourceTypes
also included the small removal for #3265