Support compartment-search from fhir-client
Is your feature request related to a problem? Please describe. Our FHIRClient interface defines the following search-related methods:
FHIRResponse search(String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws Exception;
FHIRResponse _search(String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws Exception;
FHIRResponse searchAll(FHIRParameters parameters, boolean isPost, FHIRRequestHeader... headers) throws Exception;
However, the server also supports FHIR "compartment search" which is a search of the form [compartmentName]/[compartmentId]/[resourceType]. For example GET [base]/Patient/123/Observation.
It would be nice to support that from the client.
Describe the solution you'd like A new search method like:
FHIRResponse search(String compartmentName, String compartmentId, String resourceType, FHIRParameters parameters, FHIRRequestHeader... headers) throws Exception;
Describe alternatives you've considered
maybe name it compartmentSearch instead of just search to help users?
maybe update the whole FHIRClient interface to use our new ResourceType enum instead of using strings all over?
Acceptance Criteria
- GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]
Additional context
We should also update the javadoc to indicate that _search performs a POST whereas search will perform a GET...currently the javadoc looks identical.